👌 IMPROVE: Simplify `normalize_uri` (#98)

`html.quote` can take a string and do utf-8 encoding internally
1 file changed
tree: bf653702fb70b172a9948821a7538500b896b9b3
  1. .circleci/
  2. .flake8
  3. .github/
  4. .gitignore
  5. .mypy.ini
  6. .pre-commit-config.yaml
  7. .readthedocs.yml
  10. LICENSE.markdown-it
  11. MANIFEST.in
  12. README.md
  13. benchmarking/
  14. codecov.yml
  15. docs/
  16. docstring.fmt.mustache
  17. markdown_it/
  18. setup.py
  19. tests/
  20. 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


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 markdown_it.extensions.front_matter import front_matter_plugin
from markdown_it.extensions.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)

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.