Skip to main content

Add pythonmarkdownn field type to Lektor to make use of python-markdown as a renderer.

Project description

Lektor Python-Markdown Plugin

pipeline status

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


Add lektor-pythonmarkdown to your project from command line:

lektor plugins add lektor-pythonmarkdown


In your model, you need to define the type of field as follow:

name = Page

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:

# Define the configuration of python-markdown.
# Reference:

#output_format = xhtml1
#tab_length = 4
#safe_mode = False
#enable_attributes = True
#smart_emphasis = True
#lazy_ol = True

# 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

# Specific configuration for an extension.
# Reference:
linenums = True
#guess_lang = True
#css_class = codehilite
#pygments_style = default
#noclasses = False
#use_pygments = True

Project details

Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Files for lektor-pythonmarkdown, version 1.0b8
Filename, size File type Python version Upload date Hashes
Filename, size lektor_pythonmarkdown-1.0b8-py2-none-any.whl (4.6 kB) File type Wheel Python version py2 Upload date Hashes View
Filename, size lektor-pythonmarkdown-1.0b8.tar.gz (167.6 kB) File type Source Python version None Upload date Hashes View

Supported by

AWS AWS Cloud computing Datadog Datadog Monitoring DigiCert DigiCert EV certificate Facebook / Instagram Facebook / Instagram PSF Sponsor Fastly Fastly CDN Google Google Object Storage and Download Analytics Microsoft Microsoft PSF Sponsor Pingdom Pingdom Monitoring Salesforce Salesforce PSF Sponsor Sentry Sentry Error logging StatusPage StatusPage Status page