Skip to main content

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

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.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

References

Release files for lektor-pythonmarkdown 1.2

For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.

Source distribution (sdist)

Source distribution for lektor-pythonmarkdown 1.2
File Size Uploaded
lektor-pythonmarkdown-1.2.tar.gz 168.4 kB Details

Built distribution (wheel)

Table of built distributions (wheels) for lektor-pythonmarkdown 1.2
File Interpreter ABI Platform
lektor_pythonmarkdown-1.2-py2-none-any.whl Python 2 none any Details

Total release size: 173.2 kB

Release files / lektor-pythonmarkdown-1.2.tar.gz

Download URL lektor-pythonmarkdown-1.2.tar.gz
Size 168.4 kB
Tags Source
SHA-256 checksum
How to use checksums
016f7036faddf575070ba7df813dee92d4589f45c601fb1d11dfca49e3bf5e9e
BLAKE2b-256 checksum
How to use checksums
7b805b3b417043ca67a55164185bdb11ac58104053e196574afe6a2927eb2c1f
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/1.12.1 pkginfo/1.4.2 requests/2.18.4 setuptools/39.2.0 requests-toolbelt/0.8.0 tqdm/4.23.4 CPython/3.5.3

Release files / lektor_pythonmarkdown-1.2-py2-none-any.whl

Download URL lektor_pythonmarkdown-1.2-py2-none-any.whl
Size 4.8 kB
Tags Python 2
SHA-256 checksum
How to use checksums
be5fd77eb64bdbdfa06c197595ffbce6f3c0cb0661a66e974054dc0ccadfd3d9
BLAKE2b-256 checksum
How to use checksums
c8fc5013c82771da051444a3611702a5348ea6612d1872401a587610aee5190a
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/1.12.1 pkginfo/1.4.2 requests/2.18.4 setuptools/39.2.0 requests-toolbelt/0.8.0 tqdm/4.23.4 CPython/3.5.3
Anthropic, PBC Visionary sponsor Bloomberg Visionary sponsor Hudson River Trading Visionary sponsor Meta Visionary sponsor NVIDIA Visionary sponsor Microsoft Sustainability sponsor Depot Continuous Integration AWS Cloud computing and Security Sponsor Datadog Monitoring Fastly CDN Google Download Analytics Sentry Error logging StatusPage Status page