Markdown is "just enough markup" to write most of the documents I write, and is very readable for humans. (Aside: it is good to have a cheatsheet handy while typing!)
Here are three I have found valuable, with a brief description about the why and when you might use each.
Simple, fast, stable, and works on Windows as well as Linux, Mac, and other platforms. It also supports GitHub Flavored Markdown. Try this one first; it is likely all you need.
This one is fast, configurable, and does not generally work on Windows. The maintainer is active, and keeps the project updated. Use this if you only need it to work on Linux and Mac, and especially if you want low-level access to the parser, for customization.
Try them all!
import cmarkgfm import paka.cmark import mistletoe MARKDOWN = "**Hello**, _World_" print(cmarkgfm.markdown_to_html(MARKDOWN)) print(paka.cmark.to_html(MARKDOWN)) print(mistletoe.markdown(MARKDOWN))
Here is an idea for a module-agnostic implementation that will succeed if any of the above are installed:
try: from cmarkgfm import markdown_to_html as md_to_html except ModuleNotFoundError: try: from paka.cmark import to_html as md_to_html except ModuleNotFoundError: from mistletoe import markdown as md_to_html MARKDOWN = "**Hello**, _World_" print(md_to_html(MARKDOWN))