Compile Markdown into HTML with CommonMark instead of python-markdown

To install, run nikola plugin -i commonmark

CommonMark (formerly known as Common Markdown and Standard Markdown before renaming due to licensing disputes) strives to be a strongly specified and highly compatible implementation of Markdown, the markup language created by John Gruber in 2004.

The commonmark Nikola plugin is a post compiler, using the CommonMark Python package to compile Markdown code. The package is a pure-Python port of stmd.js, a reference JavaScript implementation of CommonMark.

This plugin is an alternative to the markdown plugin (which is using python-markdown), pandoc (using Pandoc, which handles many more input formats), and misaka (yet another custom Markdown implementation). All the plugins can be used on one site, provided that file extensions differ.

This plugin does not support MarkdownExtension plugins. They are only compatible with the markdown plugin and python-markdown.

For syntax highlighting you can use highlight.js by adding it in your configuration file:

BODY_END += """
<link rel="stylesheet" href="//">
<script src="//"></script>

Suggested Configuration:

# In order to use CommonMark, you must either disable the original
# Markdown plugin, or use different file extensions for the two.

    "commonmark": ('.md', '.mdown', '.markdown'),

    ("posts/*.md", "posts", "post.tmpl"),
    ("posts/*.mdown", "posts", "post.tmpl"),
    ("posts/*.markdown", "posts", "post.tmpl"),
    ("stories/*.md", "stories", "story.tmpl"),
    ("stories/*.mdown", "stories", "story.tmpl"),
    ("stories/*.markdown", "stories", "story.tmpl"),


  • commonmark (Python package)

Issues? Questions?

You can report issues with this plugin and request help via GitHub Issues.