Extensions

As Verto is an extension of the Python Markdown package, you should be able to include any extension for the original package. This page details using extensions with Verto, plus listing a few useful extensions that we recommend.

To include a package, pass a list of extensions to the extensions keyword when creating the Verto object. For example:

extra_extensions = [
    'markdown.extensions.fenced_code',
    'markdown.extensions.codehilite',
    'markdown.extensions.sane_lists',
    mdx_math.MathExtension(enable_dollar_delimiter=True)
]
converter = Verto(extensions=extra_extensions)

A list of extensions for the Markdown package can be found in their official documentation.

Math

Math can be rendered by including the Python Markdown Math package, and passing it through to Verto as an extension to use. A guide on how to install and use the extension can be found in the package’s README file.

Fenced Code

The Fenced Code Blocks extension adds a secondary way to define code blocks, which overcomes a few limitations of the indented code blocks. More details on the Fenced Code extension can be found in the Fenced Code documentation.

Code Highlighting

The CodeHilite extension adds code/syntax highlighting to standard Python-Markdown code blocks using Pygments. More details on the CodeHilite extension can be found in the CodeHilite documentation.

Sane Lists

The Sane Lists extension alters the behavior of the Markdown List syntax to be less surprising. More details on the Sane Lists extension can be found in the Sane Lists documentation.