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_format
is a string indicating the version of HTML to output. Python Markdown setsxhtml1
by default.xhtml1
is replaced byhtml5
.lazy_ol
is a boolean indicating whether ordered lists should start at the number in the Markdown code. Python Markdown setsTrue
by default, which always starts ordered lists at1
.True
is 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.