-
Notifications
You must be signed in to change notification settings - Fork 436
Extras
Trent Mick edited this page Jul 16, 2011
·
36 revisions
By default markdown2.py
's processing attempts to produce output exactly as
defined by http://daringfireball.net/projects/markdown/syntax -- the "Markdown
core." However, a few optional extras are also provided.
-
code-friendly: Disable
_
and__
forem
andstrong
. - Footnotes: support footnotes as in use on daringfireball.net and implemented in other Markdown processors (tho not in Markdown.pl v1.0.1).
-
Code Color: Pygments-based syntax coloring of
<code>
sections. - Link Patterns: Auto-link given regex patterns in text (e.g. bug number references, revision number references).
- Cuddled Lists: Allow lists to be cuddled to the preceding paragraph.
-
pyshell: Treats unindented Python interactive shell sessions as
<code>
blocks. (TODO: wiki page for this) - xml: Passes one-liner processing instructions and namespaced XML tags. (TODO: wiki page for this)
Extras are all off by default and turned on as follows on the command line:
python markdown2.py --extras name1,name2 ...
and via the module interface:
>>> import markdown2
>>> html = markdown2.markdown_path(path, ..., extras=["name1", "name2"])
>>> html = markdown2.markdown("some markdown", ..., extras=["name1", "name2"])
>>> markdowner = Markdown(..., extras=["name1", "name2"])
>>> markdowner.convert("*boo!*")
<em>boo!</em>
(New in v1.0.1.2) You can also now specify extras via the "markdown-extras" emacs-style local variable in the markdown text:
<!-- markdown-extras: code-friendly, footnotes -->
This markdown text will be converted with the "code-friendly" and "footnotes"
extras enabled.
or:
This markdown text will be converted with the "code-friendly" and "footnotes"
extras enabled.
<!--
Local Variables:
markdown-extras: code-friendly, footnotes
End:
-->
- smartypants (http://daringfireball.net/projects/smartypants/)
- table of contents
- see a lot more in TODO.txt