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

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

Project details


Download files

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

Source Distribution

lektor-pythonmarkdown-1.2.tar.gz (168.4 kB view details)

Uploaded Source

Built Distribution

lektor_pythonmarkdown-1.2-py2-none-any.whl (4.8 kB view details)

Uploaded Python 2

File details

Details for the file lektor-pythonmarkdown-1.2.tar.gz.

File metadata

  • Download URL: lektor-pythonmarkdown-1.2.tar.gz
  • Upload date:
  • Size: 168.4 kB
  • Tags: Source
  • Uploaded using 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

File hashes

Hashes for lektor-pythonmarkdown-1.2.tar.gz
Algorithm Hash digest
SHA256 016f7036faddf575070ba7df813dee92d4589f45c601fb1d11dfca49e3bf5e9e
MD5 e909ee8df40c22e9a932749381156bfd
BLAKE2b-256 7b805b3b417043ca67a55164185bdb11ac58104053e196574afe6a2927eb2c1f

See more details on using hashes here.

File details

Details for the file lektor_pythonmarkdown-1.2-py2-none-any.whl.

File metadata

  • Download URL: lektor_pythonmarkdown-1.2-py2-none-any.whl
  • Upload date:
  • Size: 4.8 kB
  • Tags: Python 2
  • Uploaded using 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

File hashes

Hashes for lektor_pythonmarkdown-1.2-py2-none-any.whl
Algorithm Hash digest
SHA256 be5fd77eb64bdbdfa06c197595ffbce6f3c0cb0661a66e974054dc0ccadfd3d9
MD5 a2505db452402e1e114d1acd3af0ab9f
BLAKE2b-256 c8fc5013c82771da051444a3611702a5348ea6612d1872401a587610aee5190a

See more details on using hashes here.

Supported by

AWS AWS Cloud computing and Security Sponsor Datadog Datadog Monitoring Fastly Fastly CDN Google Google Download Analytics Microsoft Microsoft PSF Sponsor Pingdom Pingdom Monitoring Sentry Sentry Error logging StatusPage StatusPage Status page