|
Extras
Extras provided by markdown2.py
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. Implemented Extras
How to turn on extrasExtras 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: --> extras TODO
|
Sign in to add a comment
Did you mean:
# -- markdown-extras: code-friendly, footnotes; --
How extension friendly is python-markdown2?
@xlii: yes, I meant something like:
@hannson: python-markdown2 doesn't have a real extension story. One could subclass the Markdown class to achieve a number of types of tweaks to the processing, but there aren't explicit hooks (so some tweaks might be difficult) and there isn't an internal intermediary parsed representation (as there is in the current markdown.py) on which some transformations by an extension might be convenient.
Hi, i'm very new to markdown and markdown2. Where do we add that <!-- markdown-extras: code-friendly, footnotes --> line?