PyMdown Extensions is a collection of extensions for Python Markdown. They were originally written to make writing documentation more enjoyable. They cover a wide range of solutions, and while not every extension is needed by all people, there is usually at least one useful extension for everybody.
All extensions are found under the module namespace of
pymdownx. Assuming we wanted to specify the use of the MagicLink extension, we would include it in Python Markdown like so:
>>> import markdown >>> text = "A link https://google.com" >>> html = markdown.markdown(text, extensions=['pymdownx.magiclink']) '<p>A link <a href="https://google.com">https://google.com</a></p>'
Check out documentation on each extension to learn more about how to configure and use each one.
Please read the Usage Notes for information on extension compatibility and general notes to be aware of when using these extensions.
B64 converts all local images in a document to base64 encoding and embeds them in the document.
BetterEm is a different approach to emphasis than Python Markdown's default. It works similar but handles certain corner cases differently.
Caret is an extension that is syntactically built around the
^ character. It adds support for inserting superscripts and adds an easy way to place in an
Details creates collapsible elements with
Emoji makes adding emoji via Markdown easy .
EscapeAll allows the escaping of any character, some with additional effects. Check it out to learn more.
Extra is just like Python Markdown's Extra package except it uses PyMdown Extensions to substitute similar extensions.
InlineHilite highlights inline code:
from module import function as func.
Keys makes inserting key inputs into documents as easy as pressing Ctrl＋Alt＋Del.
MagicLink linkafies URL and email links without having to wrap them in Markdown syntax. Also, shortens repository issue, pull request, and commit links automatically for popular code hosting providers. You can even use special shorthand syntax to link to issues, diffs, and even mention people
Mark allows you to mark words easily.
PathConverter converts paths to absolute or relative to a given base path.
ProgressBar creates progress bars quick and easy.
SaneHeaders modifies hash headers to only be evaluated if the starting hash symbols are followed by at least one space. This is useful if you use other extensions that also use the hash symbol (like our own MagicLink extension).
SmartSymbols inserts commonly used Unicode characters via simple ASCII representations:
=/= → ≠.
Snippets include other Markdown or HTML snippets into the current Markdown file being parsed.
StripHTML can strip out HTML comments and specific tag attributes.
SuperFences is like Python Markdown's fences, but better. Nest fences under lists, admonitions, and other syntaxes. You can even create special custom fences for content like UML.
graph TB c1-->a2 subgraph one a1-->a2 end subgraph two b1-->b2 end subgraph three c1-->c2 end
```mermaid graph TB c1-->a2 subgraph one a1-->a2 end subgraph two b1-->b2 end subgraph three c1-->c2 end ```
Tabbed allows for tabbed Markdown content:
More Markdown content.
Tasklist allows inserting lists with check boxes.
Tilde is syntactically built around the
~ character. It adds support for inserting subscripts and adds an easy way to place
text in a