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
User | Most Recent Commit | # Commits |
---|
Other Committers
User | Most Recent Commit | # Commits |
---|
This plugin adds support for syntax highlighting through Pygments to Lektor's markdown support.
To enable the plugin run this command:
or plugins add markdown-highlighter
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.
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 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') }}