Skip to content

Move to CommonMark #133

@minchinweb

Description

@minchinweb

I've been thinking for a while that I would like to move to a CommonMark Markdown parser. The goal would be to have consistence performance, backed by a spec that has worked through many of the edge cases. As well, the hope is to make it easier to move Markdown content between applications (like to/from Obsidian).

Also, Pelican has taken to installing a CommonMark parser (markdown-it-py) as a sub-dependency of rich, which Pelican has taken to using as a CLI output library. So we already have the parser installed!

One complication is that the original Python commonmark.py parser (available on PyPI as commonmark) has been deprecated in favour of markdown-it-py (available as markdown-it-py[plugins]).

Markdown-it-py does support plugins. This is another complication in that I use several Markdown plugins currently, and not entirely standard Markdown as is.

Another issue is how to deal with front matter; I think Pelican is using it's own standard.

Available, existing Pelican Plugins:

  • Markdown-IT reader -- actually supports Markdown-it. Available on PyPI. Last updated Dec 2021. Bundles and auto-activates a few plugins
  • Pelican FrontMark -- relies on the commonmark package. Available on PyPI. Last updated in Dec 2022.
    • has an open issue about dealing with dates, as expected by Pelican\
    • has an (unsubmitted) PR to allow using the MARKDOWN setting. c.f. Issue #3
  • pelican_commonmark plugin -- relies on the commonmark package. Intended to be available as part of the pelican-plugins repo, but never went beyond PR from 2015.
  • CommonMark for Pelican -- relies on the commonmark package. Available on PyPI. Last updated Jan 2022. I actually have an open issue (from 2016!) here due to the commonmark package changing their API, and this never got updated to match.
  • pelican-gfm plugin -- actually implementing GitHub Flavoured Markdown. Never progressed past a PR for 2019.

There doesn't appear to be anything in the pelican-plugins organization.

c.f. getpelican/pelican#2984

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions