Settings¶
The template tag offers one setting that nests options as a dictionary. By default, it is:
MARKDOWNY = {
'output_format': 'html5',
'lazy_ol': False,
}
The keys of the dictionary correspond to the keyword argument options of Python Markdown’s Markdown, which means you’re free to use any of several options, such as extensions or output_format. Python Markdown faithfully reproduces Markdown, almost slavishly so. Two opinionated default options include:
output_formatis a string indicating the version of HTML to output. Python Markdown setsxhtml1by default.xhtml1is replaced byhtml5.lazy_olis a boolean indicating whether ordered lists should start at the number in the Markdown code. Python Markdown setsTrueby default, which always starts ordered lists at1.Trueis replaced byFalse.
A more customized example might look like:
MARKDOWNY = {
'extensions': [
'abbr',
'codehilite',
'fenced_code',
'sane_lists',
'smart_strong',
],
'extension_configs': {},
'output_format': 'xhtml1',
'tab_length': 4,
'smart_emphasis': True,
'lazy_ol': True,
}
See Python Markdown documentation for all officially supported extensions.
This setting is also available on a per-template basis. See examples in Usage for details.