lektor/lektor-markdown-highlighter

Name: lektor-markdown-highlighter

Owner: Lektor CMS

Description: null

Created: 2015-12-24 23:06:15.0

Updated: 2018-05-12 20:32:25.0

Pushed: 2018-05-12 20:32:24.0

Homepage: null

Size: 4

Language: Python

GitHub Committers

UserMost Recent Commit# Commits

Other Committers

UserEmailMost Recent Commit# Commits

README

lektor-markdown-highlighter

This plugin adds support for syntax highlighting through Pygments to Lektor's markdown support.

Enabling the Plugin

To enable the plugin run this command:

or plugins add markdown-highlighter
Configuring the Plugin

The plugin has a config file that is used to configure a few things for Pygments. Just create a file named markdown-highlighter.ini into your configs/ folder. Currently only pygments.style is used:

ments]
e = tango

You can use this to select any of the built-in Pygments styles. Support for custom styles will come in the future.

In Markdown

To use the syntax highlighter you need to use fenced blocks and pass the name of the pygments lexer after the opening fence:

```python
print("Hello World!")
```
In Templates

In templates the plugin provides the get_pygments_stylesheet function which can be used to generate and retrieve a link to the pygments stylesheet:

k rel="stylesheet" href="{{ get_pygments_stylesheet()|url }}">

In addition the |pygmentize filter can be used to highlight code from templates. It takes one argument which is the lexer name:

print "Hello World!"'|pygmentize('python') }}

This work is supported by the National Institutes of Health's National Center for Advancing Translational Sciences, Grant Number U24TR002306. This work is solely the responsibility of the creators and does not necessarily represent the official views of the National Institutes of Health.