diff options
author | Waylan Limberg <waylan.limberg@icloud.com> | 2014-08-21 11:11:40 -0400 |
---|---|---|
committer | Waylan Limberg <waylan.limberg@icloud.com> | 2014-08-21 11:11:40 -0400 |
commit | 31ea829c686f6ed4cca5258967c0a30077f933f6 (patch) | |
tree | fbbaeb24ee32efcc3dbe458d1f49161fb8436208 /markdown/extensions/headerid.py | |
parent | 96636540ed04d29d6726f253ae014e89ecb0713c (diff) | |
download | markdown-31ea829c686f6ed4cca5258967c0a30077f933f6.tar.gz markdown-31ea829c686f6ed4cca5258967c0a30077f933f6.tar.bz2 markdown-31ea829c686f6ed4cca5258967c0a30077f933f6.zip |
Standardized all extension header comments to a uniform format.
Diffstat (limited to 'markdown/extensions/headerid.py')
-rw-r--r-- | markdown/extensions/headerid.py | 75 |
1 files changed, 8 insertions, 67 deletions
diff --git a/markdown/extensions/headerid.py b/markdown/extensions/headerid.py index f96f239..5ae84f3 100644 --- a/markdown/extensions/headerid.py +++ b/markdown/extensions/headerid.py @@ -4,73 +4,14 @@ HeaderID Extension for Python-Markdown Auto-generate id attributes for HTML headers. -Basic usage: - - >>> import markdown - >>> text = "# Some Header #" - >>> md = markdown.markdown(text, ['headerid']) - >>> print(md) - <h1 id="some-header">Some Header</h1> - -All header IDs are unique: - - >>> text = ''' - ... #Header - ... #Header - ... #Header''' - >>> md = markdown.markdown(text, ['headerid']) - >>> print(md) - <h1 id="header">Header</h1> - <h1 id="header_1">Header</h1> - <h1 id="header_2">Header</h1> - -To fit within a html template's hierarchy, set the header base level: - - >>> text = ''' - ... #Some Header - ... ## Next Level''' - >>> md = markdown.markdown(text, ['headerid(level=3)']) - >>> print(md) - <h3 id="some-header">Some Header</h3> - <h4 id="next-level">Next Level</h4> - -Works with inline markup. - - >>> text = '#Some *Header* with [markup](http://example.com).' - >>> md = markdown.markdown(text, ['headerid']) - >>> print(md) - <h1 id="some-header-with-markup">Some <em>Header</em> with <a href="http://example.com">markup</a>.</h1> - -Turn off auto generated IDs: - - >>> text = ''' - ... # Some Header - ... # Another Header''' - >>> md = markdown.markdown(text, ['headerid(forceid=False)']) - >>> print(md) - <h1>Some Header</h1> - <h1>Another Header</h1> - -Use with MetaData extension: - - >>> text = '''header_level: 2 - ... header_forceid: Off - ... - ... # A Header''' - >>> md = markdown.markdown(text, ['headerid', 'meta']) - >>> print(md) - <h2>A Header</h2> - -Copyright 2007-2011 [Waylan Limberg](http://achinghead.com/). - -Project website: <https://pythonhosted.org/Markdown/extensions/header_id.html> -Contact: markdown@freewisdom.org - -License: BSD (see ../docs/LICENSE for details) - -Dependencies: -* [Python 2.3+](http://python.org) -* [Markdown 2.0+](https://pythonhosted.org/Markdown/) +See <https://pythonhosted.org/Markdown/extensions/header_id.html> +for documentation. + +Original code Copyright 2007-2011 [Waylan Limberg](http://achinghead.com/). + +All changes Copyright 2011-2014 The Python Markdown Project + +License: [BSD](http://www.opensource.org/licenses/bsd-license.php) """ |