Add pythonmarkdownn field type to Lektor to make use of python-markdown as a renderer.
Project description
Lektor Python-Markdown Plugin
A Lektor plugin to parse markdown using
Python-Markdown. By default, lektor
uses mistune to parse markdown
field.
With this plugin, you can chose which parser is to be used by setting a
different type on the field. Either: markdown
or pythonmarkdown
Installation
Add lektor-pythonmarkdown to your project from command line:
lektor plugins add lektor-pythonmarkdown
Usage
In your model, you need to define the type of field as follow:
[model]
name = Page
[fields.body]
label = Body
type = pythonmarkdown
Warning !
This plugins is is obviously incompatible with all of the mistune-specific events and plugins. Namely, all of markdown-*
events and the plugins built around them.
Advance configuration
This lektor plugins provide a nice way to configure python-markdown. For instance, it's possible to explicitly define the extentions to be enabled and to configure each of them seperatly.
For an advance configuration, you need to create a file named pythonmarkdown.ini
in the configs
folder.
In that file you may write something similar to the following:
[markdown]
# Define the configuration of python-markdown.
# Reference: https://python-markdown.github.io/reference/#markdown
#output_format = xhtml1
#tab_length = 4
#safe_mode = False
#enable_attributes = True
#smart_emphasis = True
#lazy_ol = True
[extensions]
# List extensions to be enabled.
markdown.extensions.extra = 1
markdown.extensions.admonition = 1
markdown.extensions.codehilite = 1
markdown.extensions.headerid = 1
markdown.extensions.meta = 1
markdown.extensions.nl2br = 1
markdown.extensions.sane_lists = 1
markdown.extensions.smarty = 1
markdown.extensions.toc = 1
markdown.extensions.wikilinks = 1
[markdown.extensions.codehilite]
# Specific configuration for an extension.
# Reference: https://python-markdown.github.io/extensions/code_hilite/#usage
linenums = True
#guess_lang = True
#css_class = codehilite
#pygments_style = default
#noclasses = False
#use_pygments = True
Project details
Release history Release notifications | RSS feed
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
Source Distribution
Built Distribution
Hashes for lektor-pythonmarkdown-1.0b6.tar.gz
Algorithm | Hash digest | |
---|---|---|
SHA256 | 4af21c15577ece854aa927acac68b1c3c1187991f2992ddfcaddb1f63705a526 |
|
MD5 | 5b8d046b68dd750fa10c9ccaa7b385e8 |
|
BLAKE2b-256 | 1e99b99bbd8c8350df0374b3c69ee514052d9bebd678ee3fc8878192f234279c |
Hashes for lektor_pythonmarkdown-1.0b6-py2-none-any.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | 3700c97be9a28331c8e27cdc26266ff7edc2d0b282dbef873eea58e880a83111 |
|
MD5 | 3224f76295f979c7bea37f5411e855d7 |
|
BLAKE2b-256 | 2a1b884e5ba6a8e35a70ed37e47ba1bfe061189253694fdc8d69db1c73b2ce93 |