title: Extra Extension
A compilation of various Python-Markdown extensions that (mostly) imitates PHP Markdown Extra.
The supported extensions include:
See each individual extension for syntax documentation. Extra and all its supported extensions are included in the standard Markdown library.
!!! Note
This extension is in __maintenance mode__. We will continue to fix bugs
and keep it up-to-date with the core parser, but no new features or
changes in behavior will be made. If you need a feature that this
extension does not offer, then you have three options (1) find an
existing [third-party extension] which meets your needs, (2) [build your
own extension], or (3) fork this extension (pursuant to its licensing
requirements) and maintain it as a third-party extension.
From the Python interpreter:
>>> import markdown
>>> html = markdown.markdown(text, extensions=['extra'])To pass configuration options to the extensions included with Extra, they must be passed to Extra, with the underlying extension identified as well. In that way Extra will have access to the options and can pass them on to the appropriate underlying extension.
config = {
'extra': {
'footnotes': {
'UNIQUE_IDS': True
},
'fenced_code': {
'lang_prefix': 'lang-'
}
},
'toc': {
'permalink': True
}
}
html = markdown.markdown(text, extensions=['extra', 'toc'], extension_configs=config)Note that in the above example, footnotes and fenced_code are both nested under the extra key as those
extensions are included with Extra. However, the toc extension is not included with extra and therefore its
configuration options are not nested under the extra key.
See each individual extension for a list of supported configuration options.
There are many other extensions which are distributed with Python-Markdown that are not included here in Extra. The features of those extensions are not part of PHP Markdown Extra, and therefore, not part of Python-Markdown Extra.