‼️ BREAKING: Move `mdit-py-plugins` install to `plugins` extra (#159)

`mdit-py-plugins` is no longer a core install requirement.
`markdown_it.extensions` was already deprecated,
and has now been removed, as have all the tests for plugins.

To help still check if changes will break plugins,
a tox env and GH actions job have been added
that clones the `mdit-py-plugins` package and runs its test suite.
54 files changed
tree: 4ebd711eefb58cefd856e560676dec6b56c3a07a
  1. .github/
  2. .gitignore
  3. .pre-commit-config.yaml
  4. .readthedocs.yml
  7. LICENSE.markdown-it
  8. MANIFEST.in
  9. README.md
  10. benchmarking/
  11. codecov.yml
  12. docs/
  13. docstring.fmt.mustache
  14. markdown_it/
  15. pyproject.toml
  16. setup.cfg
  17. setup.py
  18. tests/
  19. tox.ini


Github-CI Coverage Status PyPI Conda Code style: black PyPI - Downloads

Markdown parser done right.

This is a Python port of markdown-it, and some of its associated plugins. For more details see: https://markdown-it-py.readthedocs.io.

For details on markdown-it itself, see:


conda install -c conda-forge markdown-it-py


pip install markdown-it-py[plugins]

or with extras

conda install -c conda-forge markdown-it-py linkify-it-py mdit-py-plugins
pip install markdown-it-py[linkify,plugins]


Python API Usage

Render markdown to HTML with markdown-it-py and a custom configuration with and without plugins and features:

from markdown_it import MarkdownIt
from mdit_py_plugins.front_matter import front_matter_plugin
from mdit_py_plugins.footnote import footnote_plugin

md = (
text = ("""
a: 1

a | b
- | -
1 | 2

A footnote [^1]

[^1]: some details
tokens = md.parse(text)
html_text = md.render(text)

## To export the html to a file, uncomment the lines below:
# from pathlib import Path
# Path("output.html").write_text(html_text)

Command-line Usage

Render markdown to HTML with markdown-it-py from the command-line:

usage: markdown-it [-h] [-v] [filenames [filenames ...]]

Parse one or more markdown files, convert each to HTML, and print to stdout

positional arguments:
  filenames      specify an optional list of files to convert

optional arguments:
  -h, --help     show this help message and exit
  -v, --version  show program's version number and exit


  $ markdown-it
  markdown-it-py [version 0.0.0] (interactive)
  Type Ctrl-D to complete input, or Ctrl-C to exit.
  >>> # Example
  ... > markdown *input*
  <p>markdown <em>input</em></p>


  $ markdown-it README.md README.footer.md > index.html

References / Thanks

Big thanks to the authors of markdown-it:

Also John MacFarlane for his work on the CommonMark spec and reference implementations.