aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--.gitignore1
-rw-r--r--CODE_OF_CONDUCT.md1
-rw-r--r--INSTALL.md4
-rw-r--r--LICENSE.md25
-rw-r--r--README.md55
-rwxr-xr-xcheckspelling.sh8
-rw-r--r--docs/_template.html81
-rw-r--r--docs/authors.md58
-rw-r--r--docs/authors.txt60
-rw-r--r--docs/basic.css445
-rw-r--r--docs/change_log/index.md (renamed from docs/change_log.txt)28
-rw-r--r--docs/change_log/release-2.0.md (renamed from docs/release-2.0.txt)42
-rw-r--r--docs/change_log/release-2.1.md (renamed from docs/release-2.1.0.txt)141
-rw-r--r--docs/change_log/release-2.2.md (renamed from docs/release-2.2.0.txt)132
-rw-r--r--docs/change_log/release-2.3.md85
-rw-r--r--docs/change_log/release-2.4.md73
-rw-r--r--docs/change_log/release-2.5.md189
-rw-r--r--docs/change_log/release-2.6.md306
-rw-r--r--docs/cli.md (renamed from docs/cli.txt)148
-rw-r--r--docs/default.css261
-rw-r--r--docs/extensions/abbreviations.md45
-rw-r--r--docs/extensions/abbreviations.txt45
-rw-r--r--docs/extensions/admonition.md (renamed from docs/extensions/admonition.txt)61
-rw-r--r--docs/extensions/api.md (renamed from docs/extensions/api.txt)596
-rw-r--r--docs/extensions/attr_list.md (renamed from docs/extensions/attr_list.txt)76
-rw-r--r--docs/extensions/code_hilite.md (renamed from docs/extensions/code_hilite.txt)76
-rw-r--r--docs/extensions/definition_lists.md52
-rw-r--r--docs/extensions/definition_lists.txt53
-rw-r--r--docs/extensions/extra.md (renamed from docs/extensions/extra.txt)71
-rw-r--r--docs/extensions/fenced_code_blocks.md (renamed from docs/extensions/fenced_code_blocks.txt)108
-rw-r--r--docs/extensions/footnotes.md (renamed from docs/extensions/footnotes.txt)63
-rw-r--r--docs/extensions/header_id.md (renamed from docs/extensions/header_id.txt)65
-rw-r--r--docs/extensions/index.md (renamed from docs/extensions/index.txt)57
-rw-r--r--docs/extensions/meta_data.md (renamed from docs/extensions/meta_data.txt)89
-rw-r--r--docs/extensions/nl2br.md35
-rw-r--r--docs/extensions/nl2br.txt37
-rw-r--r--docs/extensions/sane_lists.md (renamed from docs/extensions/sane_lists.txt)64
-rw-r--r--docs/extensions/smart_strong.md39
-rw-r--r--docs/extensions/smart_strong.txt41
-rw-r--r--docs/extensions/smarty.md (renamed from docs/extensions/smarty.txt)42
-rw-r--r--docs/extensions/tables.md58
-rw-r--r--docs/extensions/tables.txt58
-rw-r--r--docs/extensions/toc.md (renamed from docs/extensions/toc.txt)97
-rw-r--r--docs/extensions/wikilinks.md (renamed from docs/extensions/wikilinks.txt)103
-rw-r--r--docs/favicon.icobin0 -> 15086 bytes
-rw-r--r--docs/index.md (renamed from docs/index.txt)88
-rw-r--r--docs/install.md (renamed from docs/install.txt)48
-rw-r--r--docs/reference.md (renamed from docs/reference.txt)308
-rw-r--r--docs/release-2.0.1.txt22
-rw-r--r--docs/release-2.0.2.txt15
-rw-r--r--docs/release-2.1.1.txt13
-rw-r--r--docs/release-2.2.1.txt12
-rw-r--r--docs/release-2.3.txt88
-rw-r--r--docs/release-2.4.txt77
-rw-r--r--docs/release-2.5.txt187
-rw-r--r--docs/release-2.6.txt263
-rw-r--r--docs/siteindex.txt78
-rw-r--r--docs/test_suite.md (renamed from docs/test_suite.txt)58
-rw-r--r--makefile5
-rw-r--r--markdown/__init__.py2
-rw-r--r--markdown/__main__.py2
-rw-r--r--markdown/extensions/abbr.py2
-rw-r--r--markdown/extensions/admonition.py2
-rw-r--r--markdown/extensions/attr_list.py2
-rw-r--r--markdown/extensions/codehilite.py2
-rw-r--r--markdown/extensions/def_list.py2
-rw-r--r--markdown/extensions/extra.py2
-rw-r--r--markdown/extensions/fenced_code.py2
-rw-r--r--markdown/extensions/footnotes.py2
-rw-r--r--markdown/extensions/headerid.py2
-rw-r--r--markdown/extensions/meta.py2
-rw-r--r--markdown/extensions/nl2br.py2
-rw-r--r--markdown/extensions/sane_lists.py2
-rw-r--r--markdown/extensions/smart_strong.py2
-rw-r--r--markdown/extensions/smarty.py2
-rw-r--r--markdown/extensions/tables.py2
-rw-r--r--markdown/extensions/toc.py2
-rw-r--r--markdown/extensions/wikilinks.py2
-rw-r--r--mkdocs.yml57
-rwxr-xr-xsetup.py158
-rw-r--r--test-requirements.txt3
-rw-r--r--tests/misc/em-around-links.html10
-rw-r--r--tests/misc/em-around-links.txt10
83 files changed, 2438 insertions, 3274 deletions
diff --git a/.gitignore b/.gitignore
index 6ac9fff..96c6778 100644
--- a/.gitignore
+++ b/.gitignore
@@ -6,6 +6,7 @@ test-output.html
build/*
dist/*
tmp/*
+site/*
MANIFEST
.venv
*~
diff --git a/CODE_OF_CONDUCT.md b/CODE_OF_CONDUCT.md
index e8679d6..10044e4 100644
--- a/CODE_OF_CONDUCT.md
+++ b/CODE_OF_CONDUCT.md
@@ -41,7 +41,6 @@ is deemed necessary and appropriate to the circumstances. Maintainers are
obligated to maintain confidentiality with regard to the reporter of an
incident.
-
This Code of Conduct is adapted from the [Contributor Covenant][homepage],
version 1.3.0, available at
[http://contributor-covenant.org/version/1/3/0/][version]
diff --git a/INSTALL.md b/INSTALL.md
index 6e6ab8c..a314fb6 100644
--- a/INSTALL.md
+++ b/INSTALL.md
@@ -5,5 +5,5 @@ As an Admin/Root user on your system do:
pip install markdown
-Or for more specific instructions, view the documentation in `docs/install.txt`
-or on the website at <https://pythonhosted.org/Markdown/install.html>.
+Or for more specific instructions, view the documentation in `docs/install.md`
+or on the website at <https://Python-Markdown.github.io/install/>.
diff --git a/LICENSE.md b/LICENSE.md
index 4cd8b14..2652d97 100644
--- a/LICENSE.md
+++ b/LICENSE.md
@@ -1,20 +1,20 @@
-Copyright 2007, 2008 The Python Markdown Project (v. 1.7 and later)
-Copyright 2004, 2005, 2006 Yuri Takhteyev (v. 0.2-1.6b)
-Copyright 2004 Manfred Stienstra (the original version)
+Copyright 2007, 2008 The Python Markdown Project (v. 1.7 and later)
+Copyright 2004, 2005, 2006 Yuri Takhteyev (v. 0.2-1.6b)
+Copyright 2004 Manfred Stienstra (the original version)
All rights reserved.
Redistribution and use in source and binary forms, with or without
modification, are permitted provided that the following conditions are met:
-
-* Redistributions of source code must retain the above copyright
- notice, this list of conditions and the following disclaimer.
-* Redistributions in binary form must reproduce the above copyright
- notice, this list of conditions and the following disclaimer in the
- documentation and/or other materials provided with the distribution.
-* Neither the name of the <organization> nor the
- names of its contributors may be used to endorse or promote products
- derived from this software without specific prior written permission.
+
+* Redistributions of source code must retain the above copyright
+ notice, this list of conditions and the following disclaimer.
+* Redistributions in binary form must reproduce the above copyright
+ notice, this list of conditions and the following disclaimer in the
+ documentation and/or other materials provided with the distribution.
+* Neither the name of the Python Markdown Project nor the
+ names of its contributors may be used to endorse or promote products
+ derived from this software without specific prior written permission.
THIS SOFTWARE IS PROVIDED BY THE PYTHON MARKDOWN PROJECT ''AS IS'' AND ANY
EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED
@@ -27,4 +27,3 @@ INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
POSSIBILITY OF SUCH DAMAGE.
-
diff --git a/README.md b/README.md
index 5e8dc84..33b4f71 100644
--- a/README.md
+++ b/README.md
@@ -1,45 +1,56 @@
[Python-Markdown][]
===================
-[![Build Status](http://img.shields.io/travis/Python-Markdown/markdown.svg)](https://travis-ci.org/Python-Markdown/markdown)
-[![Coverage Status](https://codecov.io/gh/Python-Markdown/markdown/branch/master/graph/badge.svg)](https://codecov.io/gh/Python-Markdown/markdown)
-[![Latest Version](http://img.shields.io/pypi/v/Markdown.svg)](http://pypi.python.org/pypi/Markdown)
-[![Python Versions](http://img.shields.io/pypi/pyversions/Markdown.svg)](http://pypi.python.org/pypi/Markdown)
-[![BSD License](http://img.shields.io/badge/license-BSD-yellow.svg)](http://opensource.org/licenses/BSD-3-Clause)
-[![Code of Conduct](https://img.shields.io/badge/code%20of%20conduct-contributor%20covenant-green.svg?style=flat-square)][Code of Conduct]
-
-This is a Python implementation of John Gruber's [Markdown][].
+[![Build Status][travis-button]][travis]
+[![Coverage Status][codecov-button]][codecov]
+[![Latest Version][mdversion-button]][md-pypi]
+[![Python Versions][pyversion-button]][md-pypi]
+[![BSD License][bsdlicense-button]][bsdlicense]
+[![Code of Conduct][codeofconduct-button]][Code of Conduct]
+
+[travis-button]: http://img.shields.io/travis/Python-Markdown/markdown.svg
+[travis]: https://travis-ci.org/Python-Markdown/markdown
+[codecov-button]: https://codecov.io/gh/Python-Markdown/markdown/branch/master/graph/badge.svg
+[codecov]: https://codecov.io/gh/Python-Markdown/markdown
+[mdversion-button]: http://img.shields.io/pypi/v/Markdown.svg
+[md-pypi]: http://pypi.python.org/pypi/Markdown
+[pyversion-button]: http://img.shields.io/pypi/pyversions/Markdown.svg
+[bsdlicense-button]: http://img.shields.io/badge/license-BSD-yellow.svg
+[bsdlicense]: http://opensource.org/licenses/BSD-3-Clause
+[codeofconduct-button]: https://img.shields.io/badge/code%20of%20conduct-contributor%20covenant-green.svg?style=flat-square
+[Code of Conduct]: https://github.com/Python-Markdown/markdown/blob/master/CODE_OF_CONDUCT.md
+
+This is a Python implementation of John Gruber's [Markdown][].
It is almost completely compliant with the reference implementation,
-though there are a few known issues. See [Features][] for information
-on what exactly is supported and what is not. Additional features are
+though there are a few known issues. See [Features][] for information
+on what exactly is supported and what is not. Additional features are
supported by the [Available Extensions][].
-[Python-Markdown]: https://pythonhosted.org/Markdown/
+[Python-Markdown]: https://Python-Markdown.github.io/
[Markdown]: http://daringfireball.net/projects/markdown/
-[Features]: https://pythonhosted.org/Markdown/index.html#Features
-[Available Extensions]: https://pythonhosted.org/Markdown/extensions/index.html
-
+[Features]: https://Python-Markdown.github.io#Features
+[Available Extensions]: https://Python-Markdown.github.io/extensions
Documentation
-------------
Installation and usage documentation is available in the `docs/` directory
-of the distribution and on the project website at
-<https://pythonhosted.org/Markdown/>.
+of the distribution and on the project website at
+<https://Python-Markdown.github.io/>.
-See the change log at <https://pythonhosted.org/Markdown/change_log.html>.
+See the change log at <https://Python-Markdown.github.io/change_log>.
Support
-------
-You may ask for help and discuss various other issues on the [mailing list][] and report bugs on the [bug tracker][].
+You may ask for help and discuss various other issues on the [mailing list][]
+and report bugs on the [bug tracker][].
[mailing list]: http://lists.sourceforge.net/lists/listinfo/python-markdown-discuss
-[bug tracker]: http://github.com/Python-Markdown/markdown/issues
+[bug tracker]: http://github.com/Python-Markdown/markdown/issues
Code of Conduct
---------------
-Everyone interacting in the Python-Markdown project's codebases, issue trackers, and mailing lists is expected to follow the [Code of Conduct].
-
-[Code of Conduct]: https://github.com/Python-Markdown/markdown/blob/master/CODE_OF_CONDUCT.md
+Everyone interacting in the Python-Markdown project's codebases, issue trackers,
+and mailing lists is expected to follow the [Code of Conduct].
diff --git a/checkspelling.sh b/checkspelling.sh
index 4ae20cc..654fef0 100755
--- a/checkspelling.sh
+++ b/checkspelling.sh
@@ -1,14 +1,14 @@
#!/bin/bash
echo "Building docs..."
-python setup.py --quiet build_docs --force
+mkdocs build --clean
echo "Compiling Dictionary..."
aspell --lang=en create master ./tmp <.spell-dict
-echo "Checking spelling...\n"
+echo "Checking spelling..."
let "fails=0"
-for file in $(find build/docs/ -type f -name "*.html"); do
+for file in $(find site/ -type f -name "*.html"); do
words=$(aspell list --lang=en --mode=html --add-html-skip=code --extra-dicts=./tmp <$file)
if [ "$words" ]; then
uniquewords=$(tr ' ' '\n' <<< "${words[@]}" | sort -u | tr '\n' ' ')
@@ -22,7 +22,7 @@ for file in $(find build/docs/ -type f -name "*.html"); do
fi
done
rm -f ./tmp
-rm -rf build
+rm -rf site
if [ $fails -gt 0 ]; then
echo "$fails files with misspelled words."
diff --git a/docs/_template.html b/docs/_template.html
deleted file mode 100644
index 58e9967..0000000
--- a/docs/_template.html
+++ /dev/null
@@ -1,81 +0,0 @@
-<!DOCTYPE html>
-<html>
-<head>
-<meta charset=utf-8>
-<title>%(page_title)s</title>
-<link rel="stylesheet" href="%(base)sdefault.css" type="text/css">
-</head>
-<body>
-
-<div class="related">
- <h3>Navigation</h3>
- <ul>
- <li class="right" style="margin-right: 10px">
- <a href="%(base)ssiteindex.html" title="General Index">index</a></li>
- <li class="right">
- <a href="%(next_url)s" title="%(next_title)s"
- accesskey="N">next</a> |</li>
- <li class="right">
- <a href="%(prev_url)s" title="%(prev_title)s"
- accesskey="P">previous</a> |</li>
- <li><img src="%(base)spy.png" alt=""
- style="vertical-align: middle; margin-top: -1px"/></li>
- <li><a href="%(base)sindex.html">Python Markdown v%(version)s documentation</a> &raquo;</li>
- %(crumb)s
- </ul>
-</div> <!-- .related -->
-
-<div class="document">
- <div class="documentwrapper">
- <div class="bodywrapper">
- <div class="body">
-%(body)s
- </div> <!-- .body -->
- </div> <!-- .bodywrapper -->
- </div> <!-- .documentwrapper -->
-
- <div class="sphinxsidebar">
- <div class="sphinxsidebarwrapper">
- <h3>Table Of Contents</h3>
- %(toc)s
-
- <h4>Previous topic</h4>
- <p class="topless"><a href="%(prev_url)s"
- title="previous chapter">%(prev_title)s</a></p>
- <h4>Next topic</h4>
- <p class="topless"><a href="%(next_url)s"
- title="next chapter">%(next_title)s</a></p>
- <h3>This Page</h3>
- <ul class="this-page-menu">
- <li><a href="https://github.com/Python-Markdown/markdown/issues"
- >Report a Bug</a></li>
- <li><a href="%(source)s"
- rel="nofollow">Show Source</a></li>
- </ul>
- </div> <!-- .sphinxsidebarwrapper -->
- </div> <!-- .sphinxsidebar -->
-
- <div class="clearer"></div>
-</div> <!-- .document -->
-
-<div class="related">
- <h3>Navigation</h3>
- <ul>
- <li class="right" style="margin-right: 10px">
- <a href="%(base)ssiteindex.html" title="General Index">index</a></li>
- <li class="right">
- <a href="%(next_url)s" title="%(next_title)s"
- accesskey="N">next</a> |</li>
- <li class="right">
- <a href="%(prev_url)s" title="%(prev_title)s"
- accesskey="P">previous</a> |</li>
- <li><img src="%(base)spy.png" alt=""
- style="vertical-align: middle; margin-top: -1px"/></li>
- <li><a href="%(base)sindex.html">Python Markdown v%(version)s documentation</a> &raquo;</li>
- %(crumb)s
- </ul>
-</div> <!-- .related -->
-
-<div class="footer">&copy; 2010-2012 Python Markdown Project</div>
-</body>
-</html>
diff --git a/docs/authors.md b/docs/authors.md
new file mode 100644
index 0000000..658707d
--- /dev/null
+++ b/docs/authors.md
@@ -0,0 +1,58 @@
+title: Authors
+
+Primary Authors
+===============
+
+* __[Waylan Limberg](http://achinghead.com/)__
+
+ Waylan is the current maintainer of the code and has written much of the
+ current code base, included a complete refactor of the core. He started out
+ by authoring many of the available extensions and later was asked to join
+ Yuri, where he began fixing numerous bugs, adding documentation and making
+ general improvements to the existing code base.
+
+* __[Yuri Takteyev](http://freewisdom.org/)__
+
+ Yuri wrote most of the code found in version 1.x while procrastinating his
+ Ph.D. Various pieces of his code still exist, most notably the basic
+ structure.
+
+* __[Manfed Stienstra](http://www.dwerg.net/)__
+
+ Manfed wrote the original version of the script and is responsible for
+ various parts of the existing code base.
+
+* __Artem Yunusov__
+
+ Artem, who as part of a 2008 GSoC project, refactored inline patterns,
+ replaced the NanoDOM with ElementTree support and made various other
+ improvements.
+
+* __David Wolever__
+
+ David refactored the extension API and made other improvements
+ as he helped to integrate Markdown into Dr.Project.
+
+Other Contributors
+==================
+
+The incomplete list of individuals below have provided patches or otherwise
+contributed to the project in various ways. We would like to thank everyone
+who has contributed to the project in any way.
+
+* Eric Abrahamsen
+* Jeff Balogh
+* Sergej Chodarev
+* Chris Clark
+* Tiago Cogumbreiro
+* Kjell Magne Fauske
+* G. Clark Haynes
+* Daniel Krech
+* Steward Midwinter
+* Jack Miller
+* Neale Pickett
+* Paul Stansifer
+* John Szakmeister
+* Malcolm Tredinnick
+* Ben Wilson
+* and many others who helped by reporting bugs
diff --git a/docs/authors.txt b/docs/authors.txt
deleted file mode 100644
index 84c69d0..0000000
--- a/docs/authors.txt
+++ /dev/null
@@ -1,60 +0,0 @@
-title: Authors
-prev_title: Release Notes for v2.0
-prev_url: release-2.0.html
-next_title: Table of Contents
-next_url: siteindex.html
-
-Primary Authors
-===============
-
-[Yuri Takteyev](http://freewisdom.org/)
-
-: Yuri has written much of the current code while procrastinating his Ph.D.
-
-[Waylan Limberg](http://achinghead.com/)
-
-: Waylan is the current maintainer of the code and has written much the current
- code base, included a complete refactor of the core. He started out by
- authoring many of the available extensions and later was asked to join Yuri,
- where he began fixing numerous bugs, adding documentation and making general
- improvements to the existing code base.
-
-Artem Yunusov
-
-: Artem, who as part of a 2008 GSoC project, refactored inline patterns,
- replaced the NanoDOM with ElementTree support and made various other
- improvements.
-
-[Manfed Stienstra](http://www.dwerg.net/)
-
-: Manfed wrote the original version of the script and is responsible for
- various parts of the existing code base.
-
-David Wolever
-
-: David refactored the extension API and made other improvements
- as he helped to integrate Markdown into Dr.Project.
-
-Other Contributors
-==================
-
-The incomplete list of individuals below have provided patches or otherwise
-contributed to the project in various ways. We would like to thank everyone
-who has contributed to the project in any way.
-
-* Eric Abrahamsen
-* Jeff Balogh
-* Sergej Chodarev
-* Chris Clark
-* Tiago Cogumbreiro
-* Kjell Magne Fauske
-* G. Clark Haynes
-* Daniel Krech
-* Steward Midwinter
-* Jack Miller
-* Neale Pickett
-* Paul Stansifer
-* John Szakmeister
-* Malcolm Tredinnick
-* Ben Wilson
-* and many others who helped by reporting bugs
diff --git a/docs/basic.css b/docs/basic.css
deleted file mode 100644
index 3f7ad80..0000000
--- a/docs/basic.css
+++ /dev/null
@@ -1,445 +0,0 @@
-/**
- * Sphinx stylesheet -- basic theme
- * ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
- */
-
-/* -- main layout ----------------------------------------------------------- */
-
-div.clearer {
- clear: both;
-}
-
-/* -- relbar ---------------------------------------------------------------- */
-
-div.related {
- width: 100%;
- font-size: 90%;
-}
-
-div.related h3 {
- display: none;
-}
-
-div.related ul {
- margin: 0;
- padding: 0 0 0 10px;
- list-style: none;
-}
-
-div.related li {
- display: inline;
-}
-
-div.related li.right {
- float: right;
- margin-right: 5px;
-}
-
-/* -- sidebar --------------------------------------------------------------- */
-
-div.sphinxsidebarwrapper {
- padding: 10px 5px 0 10px;
-}
-
-div.sphinxsidebar {
- float: left;
- width: 230px;
- margin-left: -100%;
- font-size: 90%;
-}
-
-div.sphinxsidebar ul {
- list-style: none;
-}
-
-div.sphinxsidebar ul ul,
-div.sphinxsidebar ul.want-points {
- margin-left: 20px;
- list-style: square;
-}
-
-div.sphinxsidebar ul ul {
- margin-top: 0;
- margin-bottom: 0;
-}
-
-div.sphinxsidebar form {
- margin-top: 10px;
-}
-
-div.sphinxsidebar input {
- border: 1px solid #98dbcc;
- font-family: sans-serif;
- font-size: 1em;
-}
-
-img {
- border: 0;
-}
-
-/* -- search page ----------------------------------------------------------- */
-
-ul.search {
- margin: 10px 0 0 20px;
- padding: 0;
-}
-
-ul.search li {
- padding: 5px 0 5px 20px;
- background-image: url(file.png);
- background-repeat: no-repeat;
- background-position: 0 7px;
-}
-
-ul.search li a {
- font-weight: bold;
-}
-
-ul.search li div.context {
- color: #888;
- margin: 2px 0 0 30px;
- text-align: left;
-}
-
-ul.keywordmatches li.goodmatch a {
- font-weight: bold;
-}
-
-/* -- index page ------------------------------------------------------------ */
-
-table.contentstable {
- width: 90%;
-}
-
-table.contentstable p.biglink {
- line-height: 150%;
-}
-
-a.biglink {
- font-size: 1.3em;
-}
-
-span.linkdescr {
- font-style: italic;
- padding-top: 5px;
- font-size: 90%;
-}
-
-/* -- general index --------------------------------------------------------- */
-
-table.indextable td {
- text-align: left;
- vertical-align: top;
-}
-
-table.indextable dl, table.indextable dd {
- margin-top: 0;
- margin-bottom: 0;
-}
-
-table.indextable tr.pcap {
- height: 10px;
-}
-
-table.indextable tr.cap {
- margin-top: 10px;
- background-color: #f2f2f2;
-}
-
-img.toggler {
- margin-right: 3px;
- margin-top: 3px;
- cursor: pointer;
-}
-
-/* -- general body styles --------------------------------------------------- */
-
-a.headerlink {
- visibility: hidden;
-}
-
-h1:hover > a.headerlink,
-h2:hover > a.headerlink,
-h3:hover > a.headerlink,
-h4:hover > a.headerlink,
-h5:hover > a.headerlink,
-h6:hover > a.headerlink,
-dt:hover > a.headerlink {
- visibility: visible;
-}
-
-div.body p.caption {
- text-align: inherit;
-}
-
-div.body td {
- text-align: left;
-}
-
-.field-list ul {
- padding-left: 1em;
-}
-
-.first {
- margin-top: 0 !important;
-}
-
-p.rubric {
- margin-top: 30px;
- font-weight: bold;
-}
-
-/* -- sidebars -------------------------------------------------------------- */
-
-div.sidebar {
- margin: 0 0 0.5em 1em;
- border: 1px solid #ddb;
- padding: 7px 7px 0 7px;
- background-color: #ffe;
- width: 40%;
- float: right;
-}
-
-p.sidebar-title {
- font-weight: bold;
-}
-
-/* -- topics ---------------------------------------------------------------- */
-
-div.topic {
- border: 1px solid #ccc;
- padding: 7px 7px 0 7px;
- margin: 10px 0 10px 0;
-}
-
-p.topic-title {
- font-size: 1.1em;
- font-weight: bold;
- margin-top: 10px;
-}
-
-/* -- admonitions ----------------------------------------------------------- */
-
-div.admonition {
- margin-top: 10px;
- margin-bottom: 10px;
- padding: 7px;
-}
-
-div.admonition dt {
- font-weight: bold;
-}
-
-div.admonition dl {
- margin-bottom: 0;
-}
-
-p.admonition-title {
- margin: 0px 10px 5px 0px;
- font-weight: bold;
-}
-
-div.body p.centered {
- text-align: center;
- margin-top: 25px;
-}
-
-/* -- tables ---------------------------------------------------------------- */
-
-table {
- border: 0 solid #dce;
- border-collapse: collapse;
-}
-
-table td, table th {
- padding: 2px 5px 2px 5px;
-}
-
-table td {
- border: 1px solid #ddd;
- background-color: #eef;
-}
-
-table td p.last, table th p.last {
- margin-bottom: 0;
-}
-
-table.field-list td, table.field-list th {
- border: 0 !important;
-}
-
-table.footnote td, table.footnote th {
- border: 0 !important;
-}
-
-table th {
- border: 1px solid #cac;
- background-color: #ede;
-}
-
-th {
- text-align: left;
- padding-right: 5px;
-}
-
-th.head {
- text-align: center;
-}
-
-/* -- other body styles ----------------------------------------------------- */
-
-dl {
- margin-bottom: 15px;
-}
-
-dd p {
- margin-top: 0px;
-}
-
-dd ul, dd table {
- margin-bottom: 10px;
-}
-
-dd {
- margin-top: 3px;
- margin-bottom: 10px;
- margin-left: 30px;
-}
-
-dt:target, .highlight {
- background-color: #fbe54e;
-}
-
-dl.glossary dt {
- font-weight: bold;
- font-size: 1.1em;
-}
-
-.field-list ul {
- margin: 0;
- padding-left: 1em;
-}
-
-.field-list p {
- margin: 0;
-}
-
-.refcount {
- color: #060;
-}
-
-.optional {
- font-size: 1.3em;
-}
-
-.versionmodified {
- font-style: italic;
-}
-
-p.deprecated {
- background-color: #ffe4e4;
- border: 1px solid #f66;
- padding: 7px
-}
-
-.system-message {
- background-color: #fda;
- padding: 5px;
- border: 3px solid red;
-}
-
-.footnote:target {
- background-color: #ffa;
-}
-
-.impl-detail {
- margin-top: 10px;
- margin-bottom: 10px;
- padding: 7px;
- border: 1px solid #ccc;
-}
-
-.impl-detail .compound-first {
- margin-top: 0;
-}
-
-.impl-detail .compound-last {
- margin-bottom: 0;
-}
-
-/* -- code displays --------------------------------------------------------- */
-
-pre {
- overflow: auto;
- overflow-y: hidden;
-}
-
-code {
- font-size: 1.1em;
-}
-
-td.linenos pre {
- padding: 5px 0px;
- border: 0;
- background-color: transparent;
- color: #aaa;
-}
-
-table.highlighttable {
- margin-left: 0.5em;
-}
-
-table.highlighttable td {
- padding: 0 0.5em 0 0.5em;
-}
-
-tt.descname {
- background-color: transparent;
- font-weight: bold;
- font-size: 1.2em;
-}
-
-tt.descclassname {
- background-color: transparent;
-}
-
-tt.xref, a tt {
- background-color: transparent;
- font-weight: bold;
-}
-
-h1 tt, h2 tt, h3 tt, h4 tt, h5 tt, h6 tt {
- background-color: transparent;
-}
-
-/* -- math display ---------------------------------------------------------- */
-
-img.math {
- vertical-align: middle;
-}
-
-div.body div.math p {
- text-align: center;
-}
-
-span.eqno {
- float: right;
-}
-
-/* -- printout stylesheet --------------------------------------------------- */
-
-@media print {
- div.document,
- div.documentwrapper,
- div.bodywrapper {
- margin: 0 !important;
- width: 100%;
- }
-
- div.sphinxsidebar,
- div.related,
- div.footer,
- #top-link {
- display: none;
- }
-}
diff --git a/docs/change_log.txt b/docs/change_log/index.md
index c9478a2..8f921e1 100644
--- a/docs/change_log.txt
+++ b/docs/change_log/index.md
@@ -1,8 +1,4 @@
title: Change Log
-prev_title: Test Suite
-prev_url: test_suite.html
-next_title: Release Notes for v2.6
-next_url: release-2.6.html
Python-Markdown Change Log
=========================
@@ -27,35 +23,35 @@ Mar 8, 2015: Released version 2.6.1 (a bug-fix release). The (new)
`yaml` option has been removed from the Meta-Data Extension as it was buggy
(see [#390](https://github.com/Python-Markdown/markdown/issues/390)).
-Feb 19, 2015: Released version 2.6 ([Notes](release-2.6.html)).
+Feb 19, 2015: Released version 2.6 ([Notes](release-2.6.md)).
Nov 19, 2014: Released version 2.5.2 (a bug-fix release).
Sept 26, 2014: Released version 2.5.1 (a bug-fix release).
-Sept 12, 2014: Released version 2.5.0 ([Notes](release-2.5.html)).
+Sept 12, 2014: Released version 2.5.0 ([Notes](release-2.5.md)).
-Feb 16, 2014: Released version 2.4.0 ([Notes](release-2.4.html)).
+Feb 16, 2014: Released version 2.4.0 ([Notes](release-2.4.md)).
Mar 22, 2013: Released version 2.3.1 (a bug-fix release).
-Mar 14, 2013: Released version 2.3.0 ([Notes](release-2.3.html))
+Mar 14, 2013: Released version 2.3.0 ([Notes](release-2.3.md))
-Nov 4, 2012: Released version 2.2.1 ([Notes](release-2.2.1.html)).
+Nov 4, 2012: Released version 2.2.1 (a bug-fix release).
-Jul 5, 2012: Released version 2.2.0 ([Notes](release-2.2.0.html)).
+Jul 5, 2012: Released version 2.2.0 ([Notes](release-2.2.md)).
-Jan 22, 2012: Released version 2.1.1 ([Notes](release-2.1.1.html)).
+Jan 22, 2012: Released version 2.1.1 (a bug-fix release).
-Nov 24, 2011: Released version 2.1.0 ([Notes](release-2.1.0.html)).
+Nov 24, 2011: Released version 2.1.0 ([Notes](release-2.1.md)).
-Oct 7, 2009: Released version 2.0.3.
+Oct 7, 2009: Released version 2.0.3. (a bug-fix release).
-Sept 28, 2009: Released version 2.0.2 ([Notes](release-2.0.2.html)).
+Sept 28, 2009: Released version 2.0.2 (a bug-fix release).
-May 20, 2009: Released version 2.0.1 ([Notes](release-2.0.1.html)).
+May 20, 2009: Released version 2.0.1 (a bug-fix release).
-Mar 30, 2009: Released version 2.0 ([Notes](release-2.0.html)).
+Mar 30, 2009: Released version 2.0 ([Notes](release-2.0.md)).
Mar 8, 2009: Release Candidate 2.0-rc-1.
diff --git a/docs/release-2.0.txt b/docs/change_log/release-2.0.md
index f44b0c5..abd8d29 100644
--- a/docs/release-2.0.txt
+++ b/docs/change_log/release-2.0.md
@@ -1,40 +1,36 @@
-title: Release Notes for v2.0
-prev_title: Release Notes for v2.0.1
-prev_url: release-2.0.1.html
-next_title: Authors
-next_url: authors.html
+title: Release Notes for v2.0
Python-Markdown 2.0 Release Notes
=================================
-We are happy to release Python-Markdown 2.0, which has been over a year in the
-making. We have rewritten significant portions of the code, dramatically
-extending the extension API, increased performance, and added numerous
+We are happy to release Python-Markdown 2.0, which has been over a year in the
+making. We have rewritten significant portions of the code, dramatically
+extending the extension API, increased performance, and added numerous
extensions to the distribution (including an extension that mimics PHP Markdown
Extra), all while maintaining backward compatibility with the end user API in
version 1.7.
-Python-Markdown supports Python versions 2.3, 2.4, 2.5, and 2.6. We have even
+Python-Markdown supports Python versions 2.3, 2.4, 2.5, and 2.6. We have even
released a version converted to Python 3.0!
Backwards-incompatible Changes
------------------------------
-While Python-Markdown has experienced numerous internal changes, those changes
-should only affect extension authors. If you have not written your own
-extensions, then you should not need to make any changes to your code.
+While Python-Markdown has experienced numerous internal changes, those changes
+should only affect extension authors. If you have not written your own
+extensions, then you should not need to make any changes to your code.
However, you may want to ensure that any third party extensions you are using
are compatible with the new API.
-The new extension API is fully [documented](extensions/api.html) in the docs.
+The new extension API is fully [documented](../extensions/api.md) in the docs.
Below is a summary of the significant changes:
* The old home-grown NanoDOM has been replaced with ElementTree. Therefore all
extensions must use ElementTree rather than the old NanoDOM.
-* The various processors and patterns are now stored with OrderedDicts rather
- than lists. Any code adding processors and/or patterns into Python-Markdown
+* The various processors and patterns are now stored with OrderedDicts rather
+ than lists. Any code adding processors and/or patterns into Python-Markdown
will need to be adjusted to use the new API using OrderedDicts.
-* The various types of processors available have been either combined, added,
+* The various types of processors available have been either combined, added,
or removed. Ensure that your processors match the currently supported types.
What's New in Python-Markdown 2.0
@@ -45,20 +41,20 @@ ElementTree internally to build the (X)HTML document from markdown source text.
This has resolved various issues with the older home-grown NanoDOM and made
notable increases in performance.
-Artem also refactored the Inline Patterns to better support nested patterns
-which has resolved many inconsistencies in Python-Markdown's parsing of the
+Artem also refactored the Inline Patterns to better support nested patterns
+which has resolved many inconsistencies in Python-Markdown's parsing of the
markdown syntax.
-The core parser had been completely rewritten, increasing performance and, for
+The core parser had been completely rewritten, increasing performance and, for
the first time, making it possible to override/add/change the way block level
content is parsed.
-Python-Markdown now parses markdown source text more closely to the other
+Python-Markdown now parses markdown source text more closely to the other
popular implementations (Perl, PHP, etc.) than it ever has before. With the
exception of a few minor insignificant differences, any difference should be
considered a bug, rather than a limitation of the parser.
-The option to return HTML4 output as apposed to XHTML has been added. In
+The option to return HTML4 output as apposed to XHTML has been added. In
addition, extensions should be able to easily add additional output formats.
As part of implementing markdown in the Dr. Project project (a Trac fork), among
@@ -67,7 +63,7 @@ accepts either the extension names as strings or instances of extensions. This
makes it possible to include multiple extensions in a single module.
Numerous extensions are included in the distribution by default. See
-[available_extensions](extensions/index.html) for a complete list.
+[available_extensions](../extensions/index.md) for a complete list.
-See the [Change Log](change_log.html) for a full list of changes.
+See the [Change Log](index.md) for a full list of changes.
diff --git a/docs/release-2.1.0.txt b/docs/change_log/release-2.1.md
index 43230dc..30cf0b2 100644
--- a/docs/release-2.1.0.txt
+++ b/docs/change_log/release-2.1.md
@@ -1,20 +1,16 @@
-title: Release Notes for v2.1.0
-prev_title: Release Notes for v2.1.1
-prev_url: release-2.1.1.html
-next_title: Release Notes for v2.0.2
-next_url: release-2.0.2.html
-
-Python-Markdown 2.1.0 Release Notes
-===================================
-
-We are pleased to release Python-Markdown 2.1 which makes many
-improvements on 2.0. In fact, we consider 2.1 to be what 2.0 should have been.
-While 2.1 consists mostly of bug fixes, bringing Python-Markdown more inline
-with other implementations, some internal improvements were made to the parser,
+title: Release Notes for v2.1
+
+Python-Markdown 2.1 Release Notes
+=================================
+
+We are pleased to release Python-Markdown 2.1 which makes many
+improvements on 2.0. In fact, we consider 2.1 to be what 2.0 should have been.
+While 2.1 consists mostly of bug fixes, bringing Python-Markdown more inline
+with other implementations, some internal improvements were made to the parser,
a few new built-in extensions were added, and HTML5 support was added.
-Python-Markdown supports Python versions 2.4, 2.5, 2.6, 2.7, 3.1, and 3.2 out
-of the box. In fact, the same code base installs on Python 3.1 and 3.2 with no
+Python-Markdown supports Python versions 2.4, 2.5, 2.6, 2.7, 3.1, and 3.2 out
+of the box. In fact, the same code base installs on Python 3.1 and 3.2 with no
extra work by the end user.
Backwards-incompatible Changes
@@ -23,69 +19,70 @@ Backwards-incompatible Changes
While Python-Markdown has received only minor internal changes since the last
release, there are a few backward-incompatible changes to note:
-* Support had been dropped for Python 2.3. No guarantees are made that the
-library will work in any version of Python lower than 2.4. Additionally, while
-the library had been tested with Python 2.4, consider Python 2.4 support to be
-depreciated. It is not likely that any future versions will continue to support
-any version of Python less than 2.5. Note that Python 3.0 is not supported due
-to a bug in its 2to3 tool. If you must use Python-Markdown with Python 3.0, it
-is suggested you manually use Python 3.1's 2to3 tool to do a conversion.
+* Support had been dropped for Python 2.3. No guarantees are made that the
+ library will work in any version of Python lower than 2.4. Additionally, while
+ the library had been tested with Python 2.4, consider Python 2.4 support to be
+ depreciated. It is not likely that any future versions will continue to
+ support any version of Python less than 2.5. Note that Python 3.0 is not
+ supported due to a bug in its 2to3 tool. If you must use Python-Markdown with
+ Python 3.0, it is suggested you manually use Python 3.1's 2to3 tool to do a
+ conversion.
* Python-Markdown previously accepted positional arguments on its class and
-wrapper methods. It now expects keyword arguments. Currently, the positional
-arguments should continue to work, but the solution feels hacky and may be
-removed in a future version. All users are encouraged to use keyword arguments
-as documented in the [Library Reference](reference.html).
+ wrapper methods. It now expects keyword arguments. Currently, the positional
+ arguments should continue to work, but the solution feels hacky and may be
+ removed in a future version. All users are encouraged to use keyword arguments
+ as documented in the [Library Reference](../reference.md).
* Past versions of Python-Markdown provided module level Global variables which
-controlled the behavior of a few different aspects of the parser. Those global
-variables have been replaced with attributes on the Markdown class.
-Additionally, those attributes are settable as keyword arguments when
-initializing a class instance. Therefore, if you were editing the global
-variables (either by editing the source or by overriding them in your code),
-you should now set them on the class. See the
-[Library Reference](reference.html) for the options available.
-
-* If you have been using the [HeaderId](extensions/header_id.html) extension
-to define custom ids on headers, you will want to switch to using the new
-[Attribute List](extensions/attr_list.html) extension. The HeaderId extension
-now only auto-generates ids on headers which have not already had ids defined.
-Note that the [Extra](extensions/extra.html) extension has been switched to use
-Attribute Lists instead of HeaderId as it did previously.
-
-* Some code was moved into the `markdown.util` namespace which was previously
-in the `markdown` namespace. Extension authors may need to adjust a few
-import statements in their extensions to work with the changes.
+ controlled the behavior of a few different aspects of the parser. Those global
+ variables have been replaced with attributes on the Markdown class.
+ Additionally, those attributes are settable as keyword arguments when
+ initializing a class instance. Therefore, if you were editing the global
+ variables (either by editing the source or by overriding them in your code),
+ you should now set them on the class. See the [Library
+ Reference](../reference.md) for the options available.
+
+* If you have been using the [HeaderId](../extensions/header_id.md) extension to
+ define custom ids on headers, you will want to switch to using the new
+ [Attribute List](../extensions/attr_list.md) extension. The HeaderId extension
+ now only auto-generates ids on headers which have not already had ids defined.
+ Note that the [Extra](../extensions/extra.md) extension has been switched to
+ use Attribute Lists instead of HeaderId as it did previously.
+
+* Some code was moved into the `markdown.util` namespace which was previously in
+ the `markdown` namespace. Extension authors may need to adjust a few import
+ statements in their extensions to work with the changes.
* The command line script name was changed to `markdown_py`. The previous name
-(`markdown`) was conflicting with people (and Linux package systems) who also
-had markdown.pl installed on there system as markdown.pl's command line script
-was also named `markdown`. Be aware that installing Python-Markdown 2.1
-will not remove the old versions of the script with different names. You
-may want to remove them yourself as they are unlikely to work properly.
+ (`markdown`) was conflicting with people (and Linux package systems) who also
+ had markdown.pl installed on there system as markdown.pl's command line script
+ was also named `markdown`. Be aware that installing Python-Markdown 2.1 will
+ not remove the old versions of the script with different names. You may want
+ to remove them yourself as they are unlikely to work properly.
What's New in Python-Markdown 2.1
---------------------------------
-Three new extensions were added. [Attribute Lists](extensions/attr_list.html),
-which was inspired by Maruku's feature of the same name,
-[Newline to Break](extensions/nl2br.html), which was inspired by GitHub
-Flavored Markdown, and [Smart Strong](extensions/smart_strong.html), which
+Three new extensions were added. [Attribute Lists](../extensions/attr_list.md),
+which was inspired by Maruku's feature of the same name,
+[Newline to Break](../extensions/nl2br.md), which was inspired by GitHub
+Flavored Markdown, and [Smart Strong](../extensions/smart_strong.md), which
fills a hole in the Extra extension.
-HTML5 is now supported. All this really means is that new block level elements
+HTML5 is now supported. All this really means is that new block level elements
introduced in the HTML5 spec are now properly recognized as raw HTML. As
valid HTML5 can consist of either HTML4 or XHTML1, there is no need to add a
-new HTML5 serializers. That said, `html5` and `xhtml5` have been added as
+new HTML5 serializers. That said, `html5` and `xhtml5` have been added as
aliases of the `html4` and `xhtml1` serializers respectively.
-An XHTML serializer has been added. Previously, ElementTree's XML serializer
+An XHTML serializer has been added. Previously, ElementTree's XML serializer
was being used for XHTML output. With the new serializer we are able to avoid
-more invalid output like empty elements (i.e., `<p />`) which can choke
+more invalid output like empty elements (i.e., `<p />`) which can choke
browsers.
-Improved support for Python 3.x. Now when running `setupy.py install` in
-Python 3.1 or greater the 2to3 tool is run automatically. Note that Python 3.0
+Improved support for Python 3.x. Now when running `setupy.py install` in
+Python 3.1 or greater the 2to3 tool is run automatically. Note that Python 3.0
is not supported due to a bug in its 2to3 tool. If you must use Python-Markdown
with Python 3.0, it is suggested you manually use Python 3.1's 2to3 tool to
do a conversion.
@@ -93,30 +90,30 @@ do a conversion.
Methods on instances of the Markdown class that do not return results can now
be changed allowing one to do `md.reset().convert(moretext)`.
-The Markdown class was refactored so that a subclass could define it's own
+The Markdown class was refactored so that a subclass could define it's own
`build_parser` method which would build a completely different parser. In
-other words, one could use the basic machinery in the markdown library to
+other words, one could use the basic machinery in the markdown library to
build a parser of a different markup language without the overhead of building
the markdown parser and throwing it away.
-Import statements within markdown have been improved so that third party
+Import statements within markdown have been improved so that third party
libraries can embed the markdown library if they desire (licensing permitting).
-Added support for Python's `-m` command line option. You can run the markdown
-package as a command line script. Do `python -m markdown [options] [args]`.
-Note that this is only fully supported in Python 2.7+. Python 2.5 & 2.6
+Added support for Python's `-m` command line option. You can run the markdown
+package as a command line script. Do `python -m markdown [options] [args]`.
+Note that this is only fully supported in Python 2.7+. Python 2.5 & 2.6
require you to call the module directly (`markdown.__main__`) rather than
the package (`markdown`). This does not work in Python 2.4.
-The command line script has been renamed to `markdown_py` which avoids all the
-various problems we had with previous names. Also improved the command line
+The command line script has been renamed to `markdown_py` which avoids all the
+various problems we had with previous names. Also improved the command line
script to accept input on `stdin`.
-The testing framework has been completely rebuilt using the Nose testing
+The testing framework has been completely rebuilt using the Nose testing
framework. This provides a number of benefits including the ability to better
-test the built-in extensions and other options available to change the parsing
-behavior. See the [Test Suite](test_suite.html) documentation for details.
+test the built-in extensions and other options available to change the parsing
+behavior. See the [Test Suite](../test_suite.md) documentation for details.
-Various bug fixes have been made, which are too numerous to list here. See the
-[commit log](https://github.com/Python-Markdown/markdown/commits/master) for a
+Various bug fixes have been made, which are too numerous to list here. See the
+[commit log](https://github.com/Python-Markdown/markdown/commits/master) for a
complete history of the changes.
diff --git a/docs/release-2.2.0.txt b/docs/change_log/release-2.2.md
index 8b94563..379a43e 100644
--- a/docs/release-2.2.0.txt
+++ b/docs/change_log/release-2.2.md
@@ -1,68 +1,64 @@
-title: Release Notes for v2.2.0
-prev_title: Release Notes for v2.2.1
-prev_url: release-2.2.1.html
-next_title: Release Notes for v2.1.1
-next_url: release-2.1.1.html
-
-Python-Markdown 2.2.0 Release Notes
-===================================
-
-We are pleased to release Python-Markdown 2.2 which makes improvements on 2.1.
-While 2.2 is primarily a bug fix release, some internal improvements were made
-to the parser, and a few security issues were resolved.
-
-Python-Markdown supports Python versions 2.5, 2.6, 2.7, 3.1, and 3.2 out
-of the box.
-
-Backwards-incompatible Changes
-------------------------------
-
-While Python-Markdown has received only minor internal changes since the last
-release, there are a few backward-incompatible changes to note:
-
-* Support had been dropped for Python 2.4. No guarantees are made that the
-library will work in any version of Python lower than 2.5. Additionally, while
-the library had been tested with Python 2.5, consider Python 2.5 support to be
-depreciated. It is not likely that any future versions will continue to support
-any version of Python less than 2.6.
-
-* For many years Python-Markdown has identified `<ins>` and `<del>` tags in
-raw HTML input as block level tags. As they are actually inline level tags,
-this behavior has been changed. This may result in slightly different output.
-While in most cases, the new output is more correct, there may be a few edge
-cases where a document author has relied on the previous incorrect behavior.
-It is likely that a few adjustments may need to be made to those documents.
-
-* The behavior of the `enable_attributes` keyword has been slightly altered.
-If authors have been using attributes in documents with `safe_mode` on, those
-attributes will no longer be parsed unless `enable_attributes` is explicitly
-set to `True`. This change was made to prevent untrusted authors from injecting
-potentially harmful JavaScript in documents. This change had no effect when
-not in `safe_mode`.
-
-What's New in Python-Markdown 2.1
----------------------------------
-
-The docs were refactored and can now be found at
-<http://packages.python.org/Markdown/>. The docs are now maintained in the
-Repository and are generated by the `setup.py build_docs` command.
-
-The [Sane_Lists](http://packages.python.org/Markdown/extensions/sane_lists.html)
-extension was added. The Sane Lists Extension alters the behavior of the
-Markdown List syntax to be less surprising by not allowing the mixing of list
-types. In other words, an ordered list will not continue when an unordered list
-item is encountered and vice versa.
-
-Markdown now excepts a full path to an extension module. In other words, your
-extensions no longer need to be in the primary namespace (and start with `mdx_`)
-for Markdown to find them. Just do `Markdown(extension=['path.to.some.module'])`.
-As long as the provided module contains a compatible extension, the extension
-will be loaded.
-
-The BlockParser API was slightly altered to allow `blockprocessor.run` to return
-`True` or `False` which provides more control to the block processor loop from
-within any Blockprocessor instance.
-
-Various bug fixes have been made. See the
-[commit log](https://github.com/Python-Markdown/markdown/commits/master)
-for a complete history of the changes.
+title: Release Notes for v2.2
+
+Python-Markdown 2.2 Release Notes
+=================================
+
+We are pleased to release Python-Markdown 2.2 which makes improvements on 2.1.
+While 2.2 is primarily a bug fix release, some internal improvements were made
+to the parser, and a few security issues were resolved.
+
+Python-Markdown supports Python versions 2.5, 2.6, 2.7, 3.1, and 3.2 out
+of the box.
+
+Backwards-incompatible Changes
+------------------------------
+
+While Python-Markdown has received only minor internal changes since the last
+release, there are a few backward-incompatible changes to note:
+
+* Support had been dropped for Python 2.4. No guarantees are made that the
+ library will work in any version of Python lower than 2.5. Additionally, while
+ the library had been tested with Python 2.5, consider Python 2.5 support to be
+ depreciated. It is not likely that any future versions will continue to
+ support any version of Python less than 2.6.
+
+* For many years Python-Markdown has identified `<ins>` and `<del>` tags in raw
+ HTML input as block level tags. As they are actually inline level tags, this
+ behavior has been changed. This may result in slightly different output. While
+ in most cases, the new output is more correct, there may be a few edge cases
+ where a document author has relied on the previous incorrect behavior. It is
+ likely that a few adjustments may need to be made to those documents.
+
+* The behavior of the `enable_attributes` keyword has been slightly altered. If
+ authors have been using attributes in documents with `safe_mode` on, those
+ attributes will no longer be parsed unless `enable_attributes` is explicitly
+ set to `True`. This change was made to prevent untrusted authors from
+ injecting potentially harmful JavaScript in documents. This change had no
+ effect when not in `safe_mode`.
+
+What's New in Python-Markdown 2.2
+---------------------------------
+
+The docs were refactored and can now be found at
+<http://packages.python.org/Markdown/>. The docs are now maintained in the
+Repository and are generated by the `setup.py build_docs` command.
+
+The [Sane_Lists](../extensions/sane_lists.md)
+extension was added. The Sane Lists Extension alters the behavior of the
+Markdown List syntax to be less surprising by not allowing the mixing of list
+types. In other words, an ordered list will not continue when an unordered list
+item is encountered and vice versa.
+
+Markdown now excepts a full path to an extension module. In other words, your
+extensions no longer need to be in the primary namespace (and start with `mdx_`)
+for Markdown to find them. Just do `Markdown(extension=['path.to.some.module'])`.
+As long as the provided module contains a compatible extension, the extension
+will be loaded.
+
+The BlockParser API was slightly altered to allow `blockprocessor.run` to return
+`True` or `False` which provides more control to the block processor loop from
+within any Blockprocessor instance.
+
+Various bug fixes have been made. See the
+[commit log](https://github.com/Python-Markdown/markdown/commits/master)
+for a complete history of the changes.
diff --git a/docs/change_log/release-2.3.md b/docs/change_log/release-2.3.md
new file mode 100644
index 0000000..fc1809e
--- /dev/null
+++ b/docs/change_log/release-2.3.md
@@ -0,0 +1,85 @@
+title: Release Notes for v2.3
+
+Python-Markdown 2.3 Release Notes
+=================================
+
+We are pleased to release Python-Markdown 2.3 which adds one new extension,
+removes a few old (obsolete) extensions, and now runs on both Python 2 and
+Python 3 without running the 2to3 conversion tool. See the list of changes
+below for details.
+
+Python-Markdown supports Python versions 2.6, 2.7, 3.1, 3.2, and 3.3.
+
+Backwards-incompatible Changes
+------------------------------
+
+* Support has been dropped for Python 2.5. No guarantees are made that the
+ library will work in any version of Python lower than 2.6. As all supported
+ Python versions include the ElementTree library, Python-Markdown will no
+ longer try to import a third-party installation of ElementTree.
+
+* All classes are now "new-style" classes. In other words, all classes subclass
+ from 'object'. While this is not likely to affect most users, extension
+ authors may need to make a few minor adjustments to their code.
+
+* "safe_mode" has been further restricted. Markdown formatted links must be of a
+ known white-listed scheme when in "safe_mode" or the URL is discarded. The
+ white-listed schemes are: 'HTTP', 'HTTPS', 'FTP', 'FTPS', 'MAILTO', and
+ 'news'. Schemeless URLs are also permitted, but are checked in other ways - as
+ they have been for some time.
+
+* The ids assigned to footnotes now contain a dash (`-`) rather than a colon
+ (`:`) when `output_format` it set to `"html5"` or `"xhtml5"`. If you are
+ making reference to those ids in your JavaScript or CSS and using the HTML5
+ output, you will need to update your code accordingly. No changes are
+ necessary if you are outputting XHTML (the default) or HTML4.
+
+* The `force_linenos` configuration setting of the CodeHilite extension has been
+ marked as **Pending Deprecation** and a new setting `linenums` has been added
+ to replace it. See documentation for the [CodeHilite Extension] for an
+ explanation of the new `linenums` setting. The new setting will honor the old
+ `force_linenos` if it is set, but it will raise a `PendingDeprecationWarning`
+ and will likely be removed in a future version of Python-Markdown.
+
+[CodeHilite Extension]: ../extensions/code_hilite.md
+
+* The "RSS" extension has been removed and no longer ships with Python-Markdown.
+ If you would like to continue using the extension (not recommended), it is
+ archived on [GitHub](https://gist.github.com/waylan/4773365).
+
+* The "HTML Tidy" Extension has been removed and no longer ships with
+ Python-Markdown. If you would like to continue using the extension (not
+ recommended), it is archived on
+ [GitHub](https://gist.github.com/waylan/5152650). Note that the underlying
+ library, uTidylib, is not Python 3 compatible. Instead, it is recommended that
+ the newer [PyTidyLib] (version 0.2.2+ for Python 3 comparability - install
+ from GitHub not PyPI) be used. As the API for that library is rather simple,
+ it is recommended that the output of Markdown be wrapped in a call to
+ PyTidyLib rather than using an extension (for example:
+ `tidylib.tidy_fragment(markdown.markdown(source), options={...})`).
+
+[PyTidyLib]: http://countergram.com/open-source/pytidylib
+
+What's New in Python-Markdown 2.3
+---------------------------------
+
+* The entire code base now universally runs in Python 2 and Python 3 without any
+ need for running the 2to3 conversion tool. This not only simplifies testing,
+ but by using Unicode_literals, results in more consistent behavior across
+ Python versions. Additionally, the relative imports (made possible in Python 2
+ via absolute_import) allows the entire library to more easily be embedded in a
+ sub-directory of another project. The various files within the library will
+ still import each other properly even though 'markdown' may not be in Python's
+ root namespace.
+
+* The [Admonition Extension] has been added, which implements [rST-style][rST]
+ admonitions in the Markdown syntax. However, be warned that this extension is
+ experimental and the syntax and behavior is still subject to change. Please
+ try it out and report bugs and/or improvements.
+
+[Admonition Extension]: ../extensions/admonition.md
+[rST]: http://docutils.sourceforge.net/docs/ref/rst/directives.html#specific-admonitions
+
+* Various bug fixes have been made. See the [commit
+ log](https://github.com/Python-Markdown/markdown/commits/master) for a
+ complete history of the changes.
diff --git a/docs/change_log/release-2.4.md b/docs/change_log/release-2.4.md
new file mode 100644
index 0000000..19130f1
--- /dev/null
+++ b/docs/change_log/release-2.4.md
@@ -0,0 +1,73 @@
+title: Release Notes for v2.4
+
+Python-Markdown 2.4 Release Notes
+=================================
+
+We are pleased to release Python-Markdown 2.4 which adds one new extension
+and fixes various bugs. See the list of changes below for details.
+
+Python-Markdown supports Python versions 2.6, 2.7, 3.1, 3.2, and 3.3.
+
+Backwards-incompatible Changes
+------------------------------
+
+* The `force_linenos` configuration setting of the CodeHilite extension has been
+ marked as **Deprecated**. It had previously been marked as "Pending
+ Deprecation" in version 2.3 when a new setting `linenums` was added to replace
+ it. See documentation for the [CodeHilite Extension] for an explanation of the
+ new `linenums` setting. The new setting will honor the old `force_linenos` if
+ it is set, but `force_linenos` will raise a `DeprecationWarning` and will
+ likely be removed in a future version of Python-Markdown.
+
+[CodeHilite Extension]: ../extensions/code_hilite.md
+
+* URLs are no longer percent-encoded. This improves compatibility with the
+ original (written in Perl) Markdown implementation. Please percent-encode your
+ URLs manually when needed.
+
+What's New in Python-Markdown 2.4
+---------------------------------
+
+* Thanks to the hard work of [Dmitry Shachnev] the [Smarty Extension] has been
+ added, which implements [SmartyPants] using Python-Markdown's Extension API.
+ This offers a few benefits over a third party script. The HTML does not need
+ to be "tokenized" twice, no hacks are required to combine SmartyPants and code
+ highlighting, and we get markdown's escaping feature for free. Please try it
+ out and report bugs and/or improvements.
+
+[Dmitry Shachnev]: https://github.com/mitya57
+[Smarty Extension]: ../extensions/smarty.md
+[SmartyPants]: http://daringfireball.net/projects/smartypants/
+
+* The [Table of Contents Extension] now supports new `permalink` option for
+ creating [Sphinx]-style anchor links.
+
+[Table of Contents Extension]: ../extensions/toc.md
+[Sphinx]: http://sphinx-doc.org/
+
+* It is now possible to enable Markdown formatting inside HTML blocks by
+ appending `markdown=1` to opening tag attributes. See [Markdown Inside HTML
+ Blocks] section for details. Thanks to [ryneeverett] for implementing this
+ feature.
+
+[Markdown Inside HTML Blocks]: ../extensions/extra.md#nested-markdown-inside-html-blocks
+[ryneeverett]: https://github.com/ryneeverett
+
+* The code blocks now support emphasizing some of the code lines. To use this
+ feature, specify `hl_lines` option after language name, for example (using the
+ [Fenced Code Extension]):
+
+ ```.python hl_lines="1 3"
+ # This line will be emphasized.
+ # This one won't.
+ # This one will be also emphasized.
+ ```
+
+ Thanks to [A. Jesse Jiryu Davis] for implementing this feature.
+
+[Fenced Code Extension]: ../extensions/fenced_code_blocks.md
+[A. Jesse Jiryu Davis]: https://github.com/ajdavis
+
+* Various bug fixes have been made. See the [commit
+ log](https://github.com/Python-Markdown/markdown/commits/master) for a
+ complete history of the changes.
diff --git a/docs/change_log/release-2.5.md b/docs/change_log/release-2.5.md
new file mode 100644
index 0000000..f6a4e36
--- /dev/null
+++ b/docs/change_log/release-2.5.md
@@ -0,0 +1,189 @@
+title: Release Notes for v2.5
+
+Python-Markdown 2.5 Release Notes
+=================================
+
+We are pleased to release Python-Markdown 2.5 which adds a few new features
+and fixes various bugs. See the list of changes below for details.
+
+Python-Markdown version 2.5 supports Python versions 2.7, 3.2, 3.3, and 3.4.
+
+Backwards-incompatible Changes
+------------------------------
+
+* Python-Markdown no longer supports Python version 2.6. You must be using Python
+ versions 2.7, 3.2, 3.3, or 3.4.
+
+[importlib]: https://pypi.python.org/pypi/importlib
+
+* The `force_linenos` configuration key on the [CodeHilite Extension] has been **deprecated**
+ and will raise a `KeyError` if provided. In the previous release (2.4), it was
+ issuing a `DeprecationWarning`. The [`linenums`][linenums] keyword should be used
+ instead, which provides more control of the output.
+
+[CodeHilite Extension]: ../extensions/code_hilite.md
+[linenums]: ../extensions/code_hilite.md#usage
+
+* Both `safe_mode` and the associated `html_replacement_text` keywords will be
+ deprecated in version 2.6 and will raise a **`PendingDeprecationWarning`** in
+ 2.5. The so-called "safe mode" was never actually "safe" which has resulted in
+ many people having a false sense of security when using it. As an alternative,
+ the developers of Python-Markdown recommend that any untrusted content be
+ passed through an HTML sanitizer (like [Bleach]) after being converted to HTML
+ by markdown.
+
+ If your code previously looked like this:
+
+ html = markdown.markdown(text, same_mode=True)
+
+ Then it is recommended that you change your code to read something like this:
+
+ import bleach
+ html = bleach.clean(markdown.markdown(text))
+
+ If you are not interested in sanitizing untrusted text, but simply desire to
+ escape raw HTML, then that can be accomplished through an extension which
+ removes HTML parsing:
+
+ from markdown.extensions import Extension
+
+ class EscapeHtml(Extension):
+ def extendMarkdown(self, md, md_globals):
+ del md.preprocessors['html_block']
+ del md.inlinePatterns['html']
+
+ html = markdown.markdown(text, extensions=[EscapeHtml()])
+
+ As the HTML would not be parsed with the above Extension, then the
+ serializer will escape the raw HTML, which is exactly what happens now when
+ `safe_mode="escape"`.
+
+[Bleach]: https://bleach.readthedocs.io/
+
+* Positional arguments on the `markdown.Markdown()` are pending deprecation as are
+ all except the `text` argument on the `markdown.markdown()` wrapper function.
+ Only keyword arguments should be used. For example, if your code previously
+ looked like this:
+
+ html = markdown.markdown(text, ['extra'])
+
+ Then it is recommended that you change it to read something like this:
+
+ html = markdown.markdown(text, extensions=['extra'])
+
+ !!! Note
+ This change is being made as a result of deprecating `"safe_mode"` as the
+ `safe_mode` argument was one of the positional arguments. When that argument
+ is removed, the two arguments following it will no longer be at the correct
+ position. It is recommended that you always use keywords when they are supported
+ for this reason.
+
+* In previous versions of Python-Markdown, the built-in extensions received
+ special status and did not require the full path to be provided. Additionally,
+ third party extensions whose name started with `"mdx_"` received the same
+ special treatment. This behavior will be deprecated in version 2.6 and will
+ raise a **`PendingDeprecationWarning`** in 2.5. Ensure that you always use the
+ full path to your extensions. For example, if you previously did the
+ following:
+
+ markdown.markdown(text, extensions=['extra'])
+
+ You should change your code to the following:
+
+ markdown.markdown(text, extensions=['markdown.extensions.extra'])
+
+ The same applies to the command line:
+
+ $ python -m markdown -x markdown.extensions.extra input.txt
+
+ See the [documentation](../reference.md#extensions) for a full explanation
+ of the current behavior.
+
+* The previously documented method of appending the extension configuration as
+ a string to the extension name will be deprecated in Python-Markdown
+ version 2.6 and will raise a **`PendingDeprecationWarning`** in 2.5. The
+ [`extension_configs`](../reference.md#extension_configs) keyword should
+ be used instead. See the [documentation](../reference.md#extension-configs)
+ for a full explanation of the current behavior.
+
+What's New in Python-Markdown 2.5
+---------------------------------
+
+* The [Smarty Extension] has had a number of additional configuration settings
+ added, which allows one to define their own substitutions to better support
+ languages other than English. Thanks to [Martin Altmayer] for implementing this
+ feature.
+
+[Smarty Extension]: ../extensions/smarty.md
+[Martin Altmayer]:https://github.com/MartinAltmayer
+
+* Named Extensions (strings passed to the [`extensions`][ex] keyword of
+ `markdown.Markdown`) can now point to any module and/or Class on your
+ PYTHONPATH. While dot notation was previously supported, a module could not
+ be at the root of your PYTHONPATH. The name had to contain at least one dot
+ (requiring it to be a sub-module). This restriction no longer exists.
+
+ Additionally, a Class may be specified in the name. The class must be at the
+ end of the name (which uses dot notation from PYTHONPATH) and be separated
+ by a colon from the module.
+
+ Therefore, if you were to import the class like this:
+
+ from path.to.module import SomeExtensionClass
+
+ Then the named extension would comprise this string:
+
+ "path.to.module:SomeExtensionClass"
+
+ This allows multiple extensions to be implemented within the same module and
+ still accessible when the user is not able to import the extension directly
+ (perhaps from a template filter or the command line).
+
+ This also means that extension modules are no longer required to include the
+ `makeExtension` function which returns an instance of the extension class.
+ However, if the user does not specify the class name (she only provides
+ `"path.to.module"`) the extension will fail to load without the
+ `makeExtension` function included in the module. Extension authors will want
+ to document carefully what is required to load their extensions.
+
+[ex]: ../reference.md#extensions
+
+* The Extension Configuration code has been refactored to make it a little
+ easier for extension authors to work with configuration settings. As a
+ result, the [`extension_configs`][ec] keyword now accepts a dictionary
+ rather than requiring a list of tuples. A list of tuples is still supported
+ so no one needs to change their existing code. This should also simplify the
+ learning curve for new users.
+
+ Extension authors are encouraged to review the new methods available on the
+ `markdown.extnesions.Extension` class for handling configuration and adjust
+ their code going forward. The included extensions provide a model for best
+ practices. See the [API] documentation for a full explanation.
+
+[ec]: ../reference.md#extension_configs
+[API]: ../extensions/api.md#configsettings
+
+* The [Command Line Interface][cli] now accepts a `--extensions_config` (or
+ `-c`) option which accepts a file name and passes the parsed content of a
+ [YAML] or [JSON] file to the [`extension_configs`][ec] keyword of the
+ `markdown.Markdown` class. The contents of the YAML or JSON must map to a
+ Python Dictionary which matches the format required by the
+ `extension_configs` keyword. Note that [PyYAML] is required to parse YAML
+ files.
+
+[cli]: ../cli.md#using-extensions
+[YAML]: http://yaml.org/
+[JSON]: http://json.org/
+[PyYAML]: http://pyyaml.org/
+
+* The [Admonition Extension][ae] is no longer considered "experimental."
+
+[ae]: ../extensions/admonition.md
+
+* There have been various refactors of the testing framework. While those
+ changes will not directly effect end users, the code is being better tested
+ which will benefit everyone.
+
+* Various bug fixes have been made. See the [commit
+ log](https://github.com/Python-Markdown/markdown/commits/master) for a
+ complete history of the changes.
diff --git a/docs/change_log/release-2.6.md b/docs/change_log/release-2.6.md
new file mode 100644
index 0000000..1495072
--- /dev/null
+++ b/docs/change_log/release-2.6.md
@@ -0,0 +1,306 @@
+title: Release Notes for v2.6
+
+# Python-Markdown 2.6 Release Notes
+
+We are pleased to release Python-Markdown 2.6 which adds a few new features
+and fixes various bugs. See the list of changes below for details.
+
+Python-Markdown version 2.6 supports Python versions 2.7, 3.2, 3.3, and 3.4 as
+well as PyPy.
+
+## Backwards-incompatible Changes
+
+### `safe_mode` Deprecated
+
+Both `safe_mode` and the associated `html_replacement_text` keywords are
+deprecated in version 2.6 and will raise a **`DeprecationWarning`**. The
+`safe_mode` and `html_replacement_text` keywords will be ignored in the next
+release. The so-called "safe mode" was never actually "safe" which has resulted
+in many people having a false sense of security when using it. As an
+alternative, the developers of Python-Markdown recommend that any untrusted
+content be passed through an HTML sanitizer (like [Bleach]) after being
+converted to HTML by markdown. In fact, [Bleach Whitelist] provides a curated
+list of tags, attributes, and styles suitable for filtering user-provided HTML
+using bleach.
+
+If your code previously looked like this:
+
+```python
+html = markdown.markdown(text, safe_mode=True)
+```
+
+Then it is recommended that you change your code to read something like this:
+
+```python
+import bleach
+from bleach_whitelist import markdown_tags, markdown_attrs
+html = bleach.clean(markdown.markdown(text), markdown_tags, markdown_attrs)
+```
+
+If you are not interested in sanitizing untrusted text, but simply desire to
+escape raw HTML, then that can be accomplished through an extension which
+removes HTML parsing:
+
+```python
+from markdown.extensions import Extension
+
+class EscapeHtml(Extension):
+ def extendMarkdown(self, md, md_globals):
+ del md.preprocessors['html_block']
+ del md.inlinePatterns['html']
+
+html = markdown.markdown(text, extensions=[EscapeHtml()])
+```
+
+As the HTML would not be parsed with the above Extension, then the serializer
+will escape the raw HTML, which is exactly what happens now when
+`safe_mode="escape"`.
+
+[Bleach]: https://bleach.readthedocs.io/
+[Bleach Whitelist]: https://github.com/yourcelf/bleach-whitelist
+
+### Positional Arguments Deprecated
+
+Positional arguments on the `markdown.Markdown()` class are deprecated as are
+all except the `text` argument on the `markdown.markdown()` wrapper function.
+Using positional arguments will raise a **`DeprecationWarning`** in 2.6 and an
+error in the next release. Only keyword arguments should be used. For example,
+if your code previously looked like this:
+
+```python
+html = markdown.markdown(text, [SomeExtension()])
+```
+
+Then it is recommended that you change it to read something like this:
+
+```python
+html = markdown.markdown(text, extensions=[SomeExtension()])
+```
+
+!!! Note
+ This change is being made as a result of deprecating `"safe_mode"` as the
+ `safe_mode` argument was one of the positional arguments. When that argument
+ is removed, the two arguments following it will no longer be at the correct
+ position. It is recommended that you always use keywords when they are
+ supported for this reason.
+
+### "Shortened" Extension Names Deprecated
+
+In previous versions of Python-Markdown, the built-in extensions received
+special status and did not require the full path to be provided. Additionally,
+third party extensions whose name started with `"mdx_"` received the same
+special treatment. This behavior is deprecated and will raise a
+**`DeprecationWarning`** in version 2.6 and an error in the next release. Ensure
+that you always use the full path to your extensions. For example, if you
+previously did the following:
+
+```python
+markdown.markdown(text, extensions=['extra'])
+```
+
+You should change your code to the following:
+
+```python
+markdown.markdown(text, extensions=['markdown.extensions.extra'])
+```
+
+The same applies to the command line:
+
+```python
+python -m markdown -x markdown.extensions.extra input.txt
+```
+
+Similarly, if you have used a third party extension (for example `mdx_math`),
+previously you might have called it like this:
+
+```python
+markdown.markdown(text, extensions=['math'])
+```
+
+As the `"mdx"` prefix will no longer be appended, you will need to change your
+code as follows (assuming the file `mdx_math.py` is installed at the root of
+your PYTHONPATH):
+
+```python
+markdown.markdown(text, extensions=['mdx_math'])
+```
+
+Extension authors will want to update their documentation to reflect the new
+behavior.
+
+See the [documentation](../reference.md#extensions) for a full explanation
+of the current behavior.
+
+### Extension Configuration as Part of Extension Name Deprecated
+
+The previously documented method of appending the extension configuration
+options as a string to the extension name is deprecated and will raise a
+**`DeprecationWarning`** in version 2.6 and an error in 2.7. The
+[`extension_configs`](../reference.md#extension_configs) keyword should be used
+instead. See the [documentation](../reference.md#extension-configs) for a full
+explanation of the current behavior.
+
+### HeaderId Extension Pending Deprecation
+
+The [HeaderId][hid] Extension is pending deprecation and will raise a
+**`PendingDeprecationWarning`** in version 2.6. The extension will be deprecated
+in the next release and raise an error in the release after that. Use the [Table
+of Contents][TOC] Extension instead, which offers most of the features of the
+HeaderId Extension and more (support for meta data is missing).
+
+Extension authors who have been using the `slugify` and `unique` functions
+defined in the HeaderId Extension should note that those functions are now
+defined in the Table of Contents extension and should adjust their import
+statements accordingly (`from markdown.extensions.toc import slugify, unique`).
+
+[hid]: ../extensions/header_id.md
+
+### The `configs` Keyword is Deprecated
+
+Positional arguments and the `configs` keyword on the
+`markdown.extension.Extension` class (and its subclasses) are deprecated. Each
+individual configuration option should be passed to the class as a keyword/value
+pair. For example. one might have previously initiated an extension subclass
+like this:
+
+```python
+ext = SomeExtension(configs={'somekey': 'somevalue'})
+```
+
+That code should be updated to pass in the options directly:
+
+```python
+ext = SomeExtension(somekey='somevalue')
+```
+
+Extension authors will want to note that this affects the `makeExtension`
+function as well. Previously it was common for the function to be defined as
+follows:
+
+```python
+def makeExtension(configs=None):
+ return SomeExtension(configs=configs)
+```
+
+Extension authors will want to update their code to the following instead:
+
+```python
+def makeExtension(**kwargs):
+ return SomeExtension(**kwargs)
+```
+
+Failing to do so will result in a **`DeprecationWarning`** and will raise an
+error in the next release. See the [Extension API][mext] documentation for more
+information.
+
+In the event that an `markdown.extension.Extension` subclass overrides the
+`__init__` method and implements its own configuration handling, then the above
+may not apply. However, it is recommended that the subclass still calls the
+parent `__init__` method to handle configuration options like so:
+
+```python
+class SomeExtension(markdown.extension.Extension):
+ def __init__(**kwargs):
+ # Do pre-config stuff here
+ # Set config defaults
+ self.config = {
+ 'option1' : ['value1', 'description1'],
+ 'option2' : ['value2', 'description2']
+ }
+ # Set user defined configs
+ super(MyExtension, self).__init__(**kwargs)
+ # Do post-config stuff here
+```
+
+Note the call to `super` to get the benefits of configuration handling from the
+parent class. See the [documentation][config] for more information.
+
+[config]: ../extensions/api.md#configsettings
+[mext]: ../extensions/api.md#makeextension
+
+## What's New in Python-Markdown 2.6
+
+### Official Support for PyPy
+
+Official support for [PyPy] has been added. While Python-Markdown has most
+likely worked on PyPy for some time, it is now officially supported and tested
+on PyPy.
+
+[PyPy]: http://pypy.org/
+
+### YAML Style Meta-Data
+
+<del>The [Meta-Data] Extension now includes optional support for [YAML] style
+meta-data.</del> By default, the YAML deliminators are recognized, however, the
+actual data is parsed as previously. This follows the syntax of [MultiMarkdown],
+which inspired this extension.
+
+<del>Alternatively, if the `yaml` option is set, then the data is parsed as
+YAML.</del> <ins>As the `yaml` option was buggy, it was removed in 2.6.1. It is
+suggested that a preprocessor (like [docdata]) or a third party extension be
+used if you want true YAML support. See [Issue #390][#390] for a full
+explanation.</ins>
+
+[MultiMarkdown]: http://fletcherpenney.net/MultiMarkdown_Syntax_Guide#metadata
+[Meta-Data]: ../extensions/meta_data.md
+[YAML]: http://yaml.org/
+[#390]: https://github.com/Python-Markdown/markdown/issues/390
+[docdata]: https://github.com/waylan/docdata
+
+### Table of Contents Extension Refactored
+
+The [Table of Contents][TOC] Extension has been refactored and some new features
+have been added. See the documentation for a full explanation of each feature
+listed below:
+
+* The extension now assigns the Table of Contents to the `toc` attribute of
+ the Markdown class regardless of whether a "marker" was found in the
+ document. Third party frameworks no longer need to insert a "marker," run
+ the document through Markdown, then extract the Table of Contents from the
+ document.
+
+* The Table of Contents Extension is now a "registered extension." Therefore,
+ when the `reset` method of the Markdown class is called, the `toc` attribute
+ on the Markdown class is cleared (set to an empty string).
+
+* When the `marker` configuration option is set to an empty string, the parser
+ completely skips the process of searching the document for markers. This
+ should save parsing time when the Table of Contents Extension is being used
+ only to assign ids to headers.
+
+* A `separator` configuration option has been added allowing users to override
+ the separator character used by the slugify function.
+
+* A `baselevel` configuration option has been added allowing users to set the
+ base level of headers in their documents (h1-h6). This allows the header
+ levels to be automatically adjusted to fit within the hierarchy of an HTML
+ template.
+
+[TOC]: ../extensions/toc.md
+
+### Pygments can now be disabled
+
+The [CodeHilite][ch] Extension has gained a new configuration option:
+`use_pygments`. The option is `True` by default, however, it allows one to turn
+off Pygments code highlighting (set to `False`) while preserving the language
+detection features of the extension. Note that Pygments language guessing is not
+used as that would 'use Pygments'. If a language is defined for a code block, it
+will be assigned to the `<code>` tag as a class in the manner suggested by the
+[HTML5 spec][spec] (alternate output will not be entertained) and could
+potentially be used by a JavaScript library in the browser to highlight the code
+block.
+
+[ch]: ../extensions/code_hilite.md
+[spec]: http://www.w3.org/TR/html5/text-level-semantics.html#the-code-element
+
+### Miscellaneous
+
+Test coverage has been improved including running [flake8]. While those changes
+will not directly effect end users, the code is being better tested which will
+benefit everyone.
+
+[flake8]: https://flake8.readthedocs.io/en/latest/
+
+Various bug fixes have been made. See the
+[commit log](https://github.com/Python-Markdown/markdown/commits/master)
+for a complete history of the changes.
diff --git a/docs/cli.txt b/docs/cli.md
index c2b37e4..dbac2c4 100644
--- a/docs/cli.txt
+++ b/docs/cli.md
@@ -1,44 +1,47 @@
title: Command Line
-prev_title: Library Reference
-prev_url: reference.html
-next_title: Extensions
-next_url: extensions/index.html
-
Using Python-Markdown on the Command Line
=========================================
-While Python-Markdown is primarily a python library, a command line script is
-included as well. While there are many other command line implementations
-of Markdown, you may not have them installed, or you may prefer to use
+While Python-Markdown is primarily a python library, a command line script is
+included as well. While there are many other command line implementations
+of Markdown, you may not have them installed, or you may prefer to use
Python-Markdown's various extensions.
Generally, you will want to have the Markdown library fully installed on your
-system to run the command line script. See the
-[Installation instructions](install.html) for details.
+system to run the command line script. See the
+[Installation instructions](install.md) for details.
Python-Markdown's command line script takes advantage of Python's `-m` flag.
-Therefore, assuming the python executable is on your system path, use the
+Therefore, assuming the python executable is on your system path, use the
following format:
- $ python -m markdown [options] [args]
+```bash
+python -m markdown [options] [args]
+```
-That will run the module as a script with the options and arguments provided.
+That will run the module as a script with the options and arguments provided.
At its most basic usage, one would simply pass in a file name as the only argument:
- $ python -m markdown input_file.txt
+```bash
+python -m markdown input_file.txt
+```
-Piping input and output (on `STDIN` and `STDOUT`) is fully supported as well.
+Piping input and output (on `STDIN` and `STDOUT`) is fully supported as well.
For example:
- $ echo "Some **Markdown** text." | python -m markdown > output.html
+```bash
+echo "Some **Markdown** text." | python -m markdown > output.html
+```
Use the `--help` option for a list all available options and arguments:
- $ python -m markdown --help
+```bash
+python -m markdown --help
+```
-If you don't want to call the python executable directly (using the `-m` flag),
+If you don't want to call the python executable directly (using the `-m` flag),
follow the instructions below to use a wrapper script:
Setup
@@ -46,27 +49,27 @@ Setup
Upon installation, the `markdown_py` script will have been copied to
your Python "Scripts" directory. Different systems require different methods to
-ensure that any files in the Python "Scripts" directory are on your system
+ensure that any files in the Python "Scripts" directory are on your system
path.
* **Windows**:
- Assuming a default install of Python on Windows, your "Scripts" directory
+ Assuming a default install of Python on Windows, your "Scripts" directory
is most likely something like `C:\\Python26\Scripts`. Verify the location
of your "Scripts" directory and add it to you system path.
- Calling `markdown_py` from the command line will call the wrapper batch
+ Calling `markdown_py` from the command line will call the wrapper batch
file `markdown_py.bat` in the `"Scripts"` directory created during install.
* __*nix__ (Linux, OSX, BSD, Unix, etc.):
- As each *nix distribution is different and we can't possibly document all
+ As each \*nix distribution is different and we can't possibly document all
of them here, we'll provide a few helpful pointers:
- * Some systems will automatically install the script on your path. Try it
+ * Some systems will automatically install the script on your path. Try it
and see if it works. Just run `markdown_py` from the command line.
- * Other systems may maintain a separate "Scripts" ("bin") directory which
+ * Other systems may maintain a separate "Scripts" ("bin") directory which
you need to add to your path. Find it (check with your distribution) and
either add it to your path or make a symbolic link to it from your path.
@@ -75,79 +78,94 @@ path.
As an alternative, you could just `cd` into the directory which contains
the source distribution, and run it from there. However, remember that your
- markdown text files will not likely be in that directory, so it is much
+ markdown text files will not likely be in that directory, so it is much
more convenient to have `markdown_py` on your path.
-!!!Note
- Python-Markdown uses `"markdown_py"` as a script name because
- the Perl implementation has already taken the more obvious name "markdown".
- Additionally, the default Python configuration on some systems would cause a
- script named `"markdown.py"` to fail by importing itself rather than the markdown
- library. Therefore, the script has been named `"markdown_py"` as a compromise. If
- you prefer a different name for the script on your system, it is suggested that
- you create a symbolic link to `markdown_py` with your preferred name.
+!!!Note
+ Python-Markdown uses `"markdown_py"` as a script name because the Perl
+ implementation has already taken the more obvious name "markdown".
+ Additionally, the default Python configuration on some systems would cause a
+ script named `"markdown.py"` to fail by importing itself rather than the
+ markdown library. Therefore, the script has been named `"markdown_py"` as a
+ compromise. If you prefer a different name for the script on your system, it
+ is suggested that you create a symbolic link to `markdown_py` with your
+ preferred name.
Usage
-----
-To use `markdown_py` from the command line, run it as
+To use `markdown_py` from the command line, run it as
- $ markdown_py input_file.txt
+```bash
+markdown_py input_file.txt
+```
-or
+or
- $ markdown_py input_file.txt > output_file.html
+```bash
+markdown_py input_file.txt > output_file.html
+```
For a complete list of options, run
- $ markdown_py --help
+```bash
+markdown_py --help
+```
Using Extensions
----------------
-To load a Python-Markdown extension from the command line use the `-x`
-(or `--extension`) option. The extension module must be on your `PYTHONPATH`
-(see the [Extension API](extensions/api.html) for details). The extension can
+To load a Python-Markdown extension from the command line use the `-x`
+(or `--extension`) option. The extension module must be on your `PYTHONPATH`
+(see the [Extension API](extensions/api.md) for details). The extension can
then be invoked by the name of that module using Python's dot syntax:
- $ python -m markdown -x path.to.module input.txt
+```bash
+python -m markdown -x path.to.module input.txt
+```
To load multiple extensions, specify an `-x` option for each extension:
- $ python -m markdown -x markdown.extensions.footnotes -x markdown.extensions.codehilite input.txt
+```bash
+python -m markdown -x markdown.extensions.footnotes -x markdown.extensions.codehilite input.txt
+```
-If the extension supports configuration options (see the documentation for the
-extension you are using to determine what settings it supports, if any), you
+If the extension supports configuration options (see the documentation for the
+extension you are using to determine what settings it supports, if any), you
can pass them in as well:
- $ python -m markdown -x markdown.extensions.footnotes -c config.yml input.txt
+```bash
+python -m markdown -x markdown.extensions.footnotes -c config.yml input.txt
+```
-The `-c` (or `--extension_configs`) option accepts a file name. The file must be in
-either the [YAML] or [JSON] format and contain YAML or JSON data that would map to
-a Python Dictionary in the format required by the [`extension_configs`][ec] keyword
-of the `markdown.Markdown` class. Therefore, the file `config.yaml` referenced in the
-above example might look like this:
+The `-c` (or `--extension_configs`) option accepts a file name. The file must be
+in either the [YAML] or [JSON] format and contain YAML or JSON data that would
+map to a Python Dictionary in the format required by the
+[`extension_configs`][ec] keyword of the `markdown.Markdown` class. Therefore,
+the file `config.yaml` referenced in the above example might look like this:
- markdown.extensions.footnotes:
- PLACE_MARKER: ~~~~~~~~
- UNIQUE_IDS: True
+```yaml
+markdown.extensions.footnotes:
+ PLACE_MARKER: ~~~~~~~~
+ UNIQUE_IDS: True
+```
-Note that while the `--extension_configs` option does specify the "markdown.extensions.footnotes"
-extension, you still need to load the extension with the `-x` option, or the configuration for that
-extension will be ignored.
+Note that while the `--extension_configs` option does specify the
+"markdown.extensions.footnotes" extension, you still need to load the extension
+with the `-x` option, or the configuration for that extension will be ignored.
-The `--extension_configs` option will only support YAML configuration files if [PyYAML] is
-installed on your system. JSON should work with no additional dependencies. The format
-of your configuration file is automatically detected.
+The `--extension_configs` option will only support YAML configuration files if
+[PyYAML] is installed on your system. JSON should work with no additional
+dependencies. The format of your configuration file is automatically detected.
!!!warning
- The previously documented method of appending the extension configuration options as a string to the
- extension name will be deprecated in Python-Markdown version 2.6. The `--extension_configs`
- option should be used instead. See the [2.5 release notes] for more information.
+ The previously documented method of appending the extension configuration
+ options as a string to the extension name will be deprecated in
+ Python-Markdown version 2.6. The `--extension_configs` option should be used
+ instead. See the [2.5 release notes] for more information.
[ec]: reference.html#extension_configs
[YAML]: http://yaml.org/
[JSON]: http://json.org/
[PyYAML]: http://pyyaml.org/
-[2.5 release notes]: release-2.5.txt
-
+[2.5 release notes]: change_log/release-2.5.md
diff --git a/docs/default.css b/docs/default.css
deleted file mode 100644
index 7833719..0000000
--- a/docs/default.css
+++ /dev/null
@@ -1,261 +0,0 @@
-/*
- * default.css_t
- * ~~~~~~~~~~~~~
- *
- * Sphinx stylesheet -- default theme.
- *
- * :copyright: Copyright 2007-2011 by the Sphinx team, see AUTHORS.
- * :license: BSD, see LICENSE for details.
- *
- */
-
-@import url("basic.css");
-
-/* -- page layout ----------------------------------------------------------- */
-
-body {
- font-family: sans-serif;
- font-size: 100%;
- background-color: #11303d;
- color: #000;
- margin: 0;
- padding: 0;
-}
-
-div.document {
- background-color: #1c4e63;
-}
-
-div.documentwrapper {
- float: left;
- width: 100%;
-}
-
-div.bodywrapper {
- margin: 0 0 0 230px;
-}
-
-div.body {
- background-color: #ffffff;
- color: #000000;
- padding: 0 20px 30px 20px;
-}
-
-div.footer {
- color: #ffffff;
- width: 100%;
- padding: 9px 0 9px 0;
- text-align: center;
- font-size: 75%;
-}
-
-div.footer a {
- color: #ffffff;
- text-decoration: underline;
-}
-
-div.related {
- background-color: #133f52;
- line-height: 30px;
- color: #ffffff;
-}
-
-div.related a {
- color: #ffffff;
-}
-
-div.sphinxsidebar {
-}
-
-div.sphinxsidebar h3 {
- font-family: 'Trebuchet MS', sans-serif;
- color: #ffffff;
- font-size: 1.4em;
- font-weight: normal;
- margin: 0;
- padding: 0;
-}
-
-div.sphinxsidebar h3 a {
- color: #ffffff;
-}
-
-div.sphinxsidebar h4 {
- font-family: 'Trebuchet MS', sans-serif;
- color: #ffffff;
- font-size: 1.3em;
- font-weight: normal;
- margin: 5px 0 0 0;
- padding: 0;
-}
-
-div.sphinxsidebar p {
- color: #ffffff;
-}
-
-div.sphinxsidebar p.topless {
- margin: 5px 10px 10px 10px;
-}
-
-div.sphinxsidebar ul {
- margin: 10px;
- padding: 0;
- color: #ffffff;
-}
-
-div.sphinxsidebar a {
- color: #98dbcc;
-}
-
-div.sphinxsidebar input {
- border: 1px solid #98dbcc;
- font-family: sans-serif;
- font-size: 1em;
-}
-
-
-/* for collapsible sidebar */
-div#sidebarbutton {
- background-color: #3c6e83;
-}
-
-
-/* -- hyperlink styles ------------------------------------------------------ */
-
-a {
- color: #355f7c;
- text-decoration: none;
-}
-
-a:visited {
- color: #355f7c;
- text-decoration: none;
-}
-
-a:hover {
- text-decoration: underline;
-}
-
-
-
-/* -- body styles ----------------------------------------------------------- */
-
-div.body h1,
-div.body h2,
-div.body h3,
-div.body h4,
-div.body h5,
-div.body h6 {
- font-family: 'Trebuchet MS', sans-serif;
- background-color: #f2f2f2;
- font-weight: normal;
- color: #20435c;
- border-bottom: 1px solid #ccc;
- margin: 20px -20px 10px -20px;
- padding: 3px 0 3px 10px;
-}
-
-div.body h1 { margin-top: 0; font-size: 200%; }
-div.body h2 { font-size: 160%; }
-div.body h3 { font-size: 140%; }
-div.body h4 { font-size: 120%; }
-div.body h5 { font-size: 110%; }
-div.body h6 { font-size: 100%; }
-
-a.headerlink {
- color: #c60f0f;
- font-size: 0.8em;
- padding: 0 4px 0 4px;
- text-decoration: none;
-}
-
-a.headerlink:hover {
- background-color: #c60f0f;
- color: white;
-}
-
-div.body p, div.body dd, div.body li {
- text-align: justify;
- line-height: 130%;
-}
-
-div.admonition p.admonition-title + p {
- display: inline;
-}
-
-div.admonition p {
- margin-bottom: 5px;
-}
-
-div.admonition pre {
- margin-bottom: 5px;
-}
-
-div.admonition ul, div.admonition ol {
- margin-bottom: 5px;
-}
-
-div.note {
- background-color: #eee;
- border: 1px solid #ccc;
-}
-
-div.seealso {
- background-color: #ffc;
- border: 1px solid #ff6;
-}
-
-div.topic {
- background-color: #eee;
-}
-
-div.warning {
- background-color: #ffe4e4;
- border: 1px solid #f66;
-}
-
-p.admonition-title {
- display: inline;
-}
-
-p.admonition-title:after {
- content: ":";
-}
-
-pre {
- padding: 5px;
- background-color: #eeffcc;
- color: #333333;
- line-height: 120%;
- border: 1px solid #ac9;
- border-left: none;
- border-right: none;
-}
-
-tt {
- background-color: #ecf0f3;
- padding: 0 1px 0 1px;
- font-size: 0.95em;
-}
-
-th {
- background-color: #ede;
-}
-
-.warning tt {
- background: #efc2c2;
-}
-
-.note tt {
- background: #d6d6d6;
-}
-
-.viewcode-back {
- font-family: sans-serif;
-}
-
-div.viewcode-block:target {
- background-color: #f4debf;
- border-top: 1px solid #ac9;
- border-bottom: 1px solid #ac9;
-} \ No newline at end of file
diff --git a/docs/extensions/abbreviations.md b/docs/extensions/abbreviations.md
new file mode 100644
index 0000000..d580d56
--- /dev/null
+++ b/docs/extensions/abbreviations.md
@@ -0,0 +1,45 @@
+title: Abbreviations Extension
+
+Abbreviations
+=============
+
+Summary
+-------
+
+The Abbreviations extension adds the ability to define abbreviations.
+Specifically, any defined abbreviation is wrapped in an `<abbr>` tag.
+
+The Abbreviations extension is included in the standard Markdown library.
+
+Syntax
+------
+
+Abbreviations are defined using the syntax established in
+[PHP Markdown Extra][php].
+
+[php]: http://www.michelf.com/projects/php-markdown/extra/#abbr
+
+Thus, the following text (taken from the above referenced PHP documentation):
+
+```md
+The HTML specification
+is maintained by the W3C.
+
+*[HTML]: Hyper Text Markup Language
+*[W3C]: World Wide Web Consortium
+```
+
+will be rendered as:
+
+```html
+<p>The <abbr title="Hyper Text Markup Language">HTML</abbr> specification
+is maintained by the <abbr title="World Wide Web Consortium">W3C</abbr>.</p>
+```
+
+Usage
+-----
+
+See [Extensions](index.md) for general extension usage, specify `markdown.extensions.abbr`
+as the name of the extension.
+
+This extension does not accept any special configuration options.
diff --git a/docs/extensions/abbreviations.txt b/docs/extensions/abbreviations.txt
deleted file mode 100644
index 9ac7c95..0000000
--- a/docs/extensions/abbreviations.txt
+++ /dev/null
@@ -1,45 +0,0 @@
-title: Abbreviations Extension
-prev_title: Extra Extension
-prev_url: extra.html
-next_title: Attribute Lists Extension
-next_url: attr_list.html
-
-Abbreviations
-=============
-
-Summary
--------
-
-The Abbreviations extension adds the ability to define abbreviations.
-Specifically, any defined abbreviation is wrapped in an `<abbr>` tag.
-
-The Abbreviations extension is included in the standard Markdown library.
-
-Syntax
-------
-
-Abbreviations are defined using the syntax established in
-[PHP Markdown Extra][php].
-
-[php]: http://www.michelf.com/projects/php-markdown/extra/#abbr
-
-Thus, the following text (taken from the above referenced PHP documentation):
-
- The HTML specification
- is maintained by the W3C.
-
- *[HTML]: Hyper Text Markup Language
- *[W3C]: World Wide Web Consortium
-
-will be rendered as:
-
- <p>The <abbr title="Hyper Text Markup Language">HTML</abbr> specification
- is maintained by the <abbr title="World Wide Web Consortium">W3C</abbr>.</p>
-
-Usage
------
-
-See [Extensions](index.html) for general extension usage, specify `markdown.extensions.abbr`
-as the name of the extension.
-
-This extension does not accept any special configuration options.
diff --git a/docs/extensions/admonition.txt b/docs/extensions/admonition.md
index d68bd5d..26e6299 100644
--- a/docs/extensions/admonition.txt
+++ b/docs/extensions/admonition.md
@@ -1,8 +1,4 @@
-title: Admonition Extension
-prev_title: Smart Strong Extension
-prev_url: smart_strong.html
-next_title: CodeHilite Extension
-next_url: code_hilite.html
+title: Admonition Extension
Admonition
==========
@@ -21,47 +17,60 @@ Syntax
Admonitions are created using the following syntax:
- !!! type "optional explicit title within double quotes"
- Any number of other indented markdown elements.
+```md
+!!! type "optional explicit title within double quotes"
+ Any number of other indented markdown elements.
- This is the second paragraph.
+ This is the second paragraph.
+```
`type` will be used as the CSS class name and as default title. It must be a
single word. So, for instance:
- !!! note
- You should note that the title will be automatically capitalized.
+```md
+!!! note
+ You should note that the title will be automatically capitalized.
+```
will render:
- <div class="admonition note">
- <p class="admonition-title">Note</p>
- <p>You should note that the title will be automatically capitalized.</p>
- </div>
+```html
+<div class="admonition note">
+<p class="admonition-title">Note</p>
+<p>You should note that the title will be automatically capitalized.</p>
+</div>
+```
Optionally, you can use custom titles. For instance:
- !!! danger "Don't try this at home"
- ...
+```md
+!!! danger "Don't try this at home"
+ ...
+```
will render:
- <div class="admonition danger">
- <p class="admonition-title">Don't try this at home</p>
- <p>...</p>
- </div>
+```html
+<div class="admonition danger">
+<p class="admonition-title">Don't try this at home</p>
+<p>...</p>
+</div>
+```
If you don't want a title, use a blank string `""`:
- !!! important ""
- This is a admonition box without a title.
+```md
+!!! important ""
+ This is a admonition box without a title.
+```
results in:
- <div class="admonition important">
- <p>This is a admonition box without a title.</p>
- </div>
-
+```html
+<div class="admonition important">
+<p>This is a admonition box without a title.</p>
+</div>
+```
rST suggests the following `types`, but you're free to use whatever you want:
attention, caution, danger, error, hint, important, note, tip, warning.
diff --git a/docs/extensions/api.txt b/docs/extensions/api.md
index 246bb27..3d8cfff 100644
--- a/docs/extensions/api.txt
+++ b/docs/extensions/api.md
@@ -1,117 +1,116 @@
title: Extensions API
-prev_title: WikiLinks Extension
-prev_url: wikilinks.html
-next_title: Test Suite
-next_url: ../test_suite.html
-Writing Extensions for Python-Markdown
-======================================
+# Writing Extensions for Python-Markdown
-Python-Markdown includes an API for extension writers to plug their own
+Python-Markdown includes an API for extension writers to plug their own
custom functionality and/or syntax into the parser. There are Preprocessors
-which allow you to alter the source before it is passed to the parser,
+which allow you to alter the source before it is passed to the parser,
inline patterns which allow you to add, remove or override the syntax of
any inline elements, and Postprocessors which allow munging of the
-output of the parser before it is returned. If you really want to dive in,
+output of the parser before it is returned. If you really want to dive in,
there are also Blockprocessors which are part of the core BlockParser.
-As the parser builds an [ElementTree][ElementTree] object which is later rendered
-as Unicode text, there are also some helpers provided to ease manipulation of
-the tree. Each part of the API is discussed in its respective section below.
-Additionally, reading the source of some [Available Extensions][] may be
-helpful. For example, the [Footnotes][] extension uses most of the features
+As the parser builds an [ElementTree][ElementTree] object which is later rendered
+as Unicode text, there are also some helpers provided to ease manipulation of
+the tree. Each part of the API is discussed in its respective section below.
+Additionally, reading the source of some [Available Extensions][] may be
+helpful. For example, the [Footnotes][] extension uses most of the features
documented here.
-Preprocessors {: #preprocessors }
----------------------------------
+## Preprocessors {: #preprocessors }
-Preprocessors munge the source text before it is passed into the Markdown
-core. This is an excellent place to clean up bad syntax, extract things the
+Preprocessors munge the source text before it is passed into the Markdown
+core. This is an excellent place to clean up bad syntax, extract things the
parser may otherwise choke on and perhaps even store it for later retrieval.
-Preprocessors should inherit from `markdown.preprocessors.Preprocessor` and
-implement a `run` method with one argument `lines`. The `run` method of
-each Preprocessor will be passed the entire source text as a list of Unicode
-strings. Each string will contain one line of text. The `run` method should
+Preprocessors should inherit from `markdown.preprocessors.Preprocessor` and
+implement a `run` method with one argument `lines`. The `run` method of
+each Preprocessor will be passed the entire source text as a list of Unicode
+strings. Each string will contain one line of text. The `run` method should
return either that list, or an altered list of Unicode strings.
A pseudo example:
- from markdown.preprocessors import Preprocessor
-
- class MyPreprocessor(Preprocessor):
- def run(self, lines):
- new_lines = []
- for line in lines:
- m = MYREGEX.match(line)
- if m:
- # do stuff
- else:
- new_lines.append(line)
- return new_lines
-
-Inline Patterns {: #inlinepatterns }
-------------------------------------
-
-Inline Patterns implement the inline HTML element syntax for Markdown such as
-`*emphasis*` or `[links](http://example.com)`. Pattern objects should be
-instances of classes that inherit from `markdown.inlinepatterns.Pattern` or
-one of its children. Each pattern object uses a single regular expression and
+```python
+from markdown.preprocessors import Preprocessor
+
+class MyPreprocessor(Preprocessor):
+ def run(self, lines):
+ new_lines = []
+ for line in lines:
+ m = MYREGEX.match(line)
+ if m:
+ # do stuff
+ else:
+ new_lines.append(line)
+ return new_lines
+```
+
+## Inline Patterns {: #inlinepatterns }
+
+Inline Patterns implement the inline HTML element syntax for Markdown such as
+`*emphasis*` or `[links](http://example.com)`. Pattern objects should be
+instances of classes that inherit from `markdown.inlinepatterns.Pattern` or
+one of its children. Each pattern object uses a single regular expression and
must have the following methods:
-* **`getCompiledRegExp()`**:
+* **`getCompiledRegExp()`**:
Returns a compiled regular expression.
-* **`handleMatch(m)`**:
+* **`handleMatch(m)`**:
- Accepts a match object and returns an ElementTree element of a plain
+ Accepts a match object and returns an ElementTree element of a plain
Unicode string.
-Also, Inline Patterns can define the property `ANCESTOR_EXCLUDES` with either
-a list or tuple of undesirable ancestors. The pattern should not match if it
+Also, Inline Patterns can define the property `ANCESTOR_EXCLUDES` with either
+a list or tuple of undesirable ancestors. The pattern should not match if it
would cause the content to be a descendant of one of the defined tag names.
Note that any regular expression returned by `getCompiledRegExp` must capture
the whole block. Therefore, they should all start with `r'^(.*?)'` and end
-with `r'(.*?)!'`. When using the default `getCompiledRegExp()` method
-provided in the `Pattern` you can pass in a regular expression without that
-and `getCompiledRegExp` will wrap your expression for you and set the
-`re.DOTALL` and `re.UNICODE` flags. This means that the first group of your
+with `r'(.*?)!'`. When using the default `getCompiledRegExp()` method
+provided in the `Pattern` you can pass in a regular expression without that
+and `getCompiledRegExp` will wrap your expression for you and set the
+`re.DOTALL` and `re.UNICODE` flags. This means that the first group of your
match will be `m.group(2)` as `m.group(1)` will match everything before the
pattern.
For an example, consider this simplified emphasis pattern:
- from markdown.inlinepatterns import Pattern
- from markdown.util import etree
+```python
+from markdown.inlinepatterns import Pattern
+from markdown.util import etree
- class EmphasisPattern(Pattern):
- def handleMatch(self, m):
- el = etree.Element('em')
- el.text = m.group(3)
- return el
+class EmphasisPattern(Pattern):
+ def handleMatch(self, m):
+ el = etree.Element('em')
+ el.text = m.group(3)
+ return el
+```
As discussed in [Integrating Your Code Into Markdown][], an instance of this
class will need to be provided to Markdown. That instance would be created
like so:
- # an oversimplified regex
- MYPATTERN = r'\*([^*]+)\*'
- # pass in pattern and create instance
- emphasis = EmphasisPattern(MYPATTERN)
+```python
+# an oversimplified regex
+MYPATTERN = r'\*([^*]+)\*'
+# pass in pattern and create instance
+emphasis = EmphasisPattern(MYPATTERN)
+```
Actually it would not be necessary to create that pattern (and not just because
a more sophisticated emphasis pattern already exists in Markdown). The fact is,
that example pattern is not very DRY. A pattern for `**strong**` text would
be almost identical, with the exception that it would create a 'strong' element.
-Therefore, Markdown provides a number of generic pattern classes that can
+Therefore, Markdown provides a number of generic pattern classes that can
provide some common functionality. For example, both emphasis and strong are
implemented with separate instances of the `SimpleTagPattern` listed below.
Feel free to use or extend any of the Pattern classes found at
`markdown.inlinepatterns`.
-**Generic Pattern Classes**
+### Generic Pattern Classes
* **`SimpleTextPattern(pattern)`**:
@@ -127,12 +126,11 @@ Feel free to use or extend any of the Pattern classes found at
Returns an element of type "`tag`" with no children or text (i.e.: `br`).
There may be other Pattern classes in the Markdown source that you could extend
-or use as well. Read through the source and see if there is anything you can
+or use as well. Read through the source and see if there is anything you can
use. You might even get a few ideas for different approaches to your specific
situation.
-Treeprocessors {: #treeprocessors }
------------------------------------
+## Treeprocessors {: #treeprocessors }
Treeprocessors manipulate an ElementTree object after it has passed through the
core BlockParser. This is where additional manipulation of the tree takes
@@ -140,22 +138,24 @@ place. Additionally, the InlineProcessor is a Treeprocessor which steps through
the tree and runs the Inline Patterns on the text of each Element in the tree.
A Treeprocessor should inherit from `markdown.treeprocessors.Treeprocessor`,
-over-ride the `run` method which takes one argument `root` (an ElementTree
-object) and either modifies that root element and returns `None` or returns a
+over-ride the `run` method which takes one argument `root` (an ElementTree
+object) and either modifies that root element and returns `None` or returns a
new ElementTree object.
A pseudo example:
- from markdown.treeprocessors import Treeprocessor
+```python
+from markdown.treeprocessors import Treeprocessor
- class MyTreeprocessor(Treeprocessor):
- def run(self, root):
- root.text = 'modified content'
+class MyTreeprocessor(Treeprocessor):
+ def run(self, root):
+ root.text = 'modified content'
+```
-Note that Python class methods return `None` by default when no `return`
+Note that Python class methods return `None` by default when no `return`
statement is defined. Additionally all Python variables refer to objects by
reference. Therefore, the above `run` method modifies the `root` element
-in place and returns `None`. The changes made to the `root` element and its
+in place and returns `None`. The changes made to the `root` element and its
children are retained.
Some may be inclined to return the modified `root` element. While that would
@@ -163,32 +163,32 @@ work, it would cause a copy of the entire ElementTree to be generated each
time the Treeprocessor is run. Therefore, it is generally expected that
the `run` method would only return `None` or a new ElementTree object.
-For specifics on manipulating the ElementTree, see
+For specifics on manipulating the ElementTree, see
[Working with the ElementTree][workingwithetree] below.
-Postprocessors {: #postprocessors }
------------------------------------
+## Postprocessors {: #postprocessors }
-Postprocessors manipulate the document after the ElementTree has been
+Postprocessors manipulate the document after the ElementTree has been
serialized into a string. Postprocessors should be used to work with the
text just before output.
-A Postprocessor should inherit from `markdown.postprocessors.Postprocessor`
-and over-ride the `run` method which takes one argument `text` and returns
+A Postprocessor should inherit from `markdown.postprocessors.Postprocessor`
+and over-ride the `run` method which takes one argument `text` and returns
a Unicode string.
-Postprocessors are run after the ElementTree has been serialized back into
-Unicode text. For example, this may be an appropriate place to add a table of
+Postprocessors are run after the ElementTree has been serialized back into
+Unicode text. For example, this may be an appropriate place to add a table of
contents to a document:
- from markdown.postprocessors import Postprocessor
+```python
+from markdown.postprocessors import Postprocessor
- class TocPostprocessor(Postprocessor):
- def run(self, text):
- return MYMARKERRE.sub(MyToc, text)
+class TocPostprocessor(Postprocessor):
+ def run(self, text):
+ return MYMARKERRE.sub(MyToc, text)
+```
-BlockParser {: #blockparser }
------------------------------
+## BlockParser {: #blockparser }
Sometimes, Preprocessors, Treeprocessors, Postprocessors, and Inline Patterns
are not going to do what you need. Perhaps you want a new type of block type
@@ -207,7 +207,7 @@ and implement both the `test` and `run` methods.
The `test` method is used by BlockParser to identify the type of block.
Therefore the `test` method must return a Boolean value. If the test returns
`True`, then the BlockParser will call that Blockprocessor's `run` method.
-If it returns `False`, the BlockParser will move on to the next
+If it returns `False`, the BlockParser will move on to the next
Blockprocessor.
The **`test`** method takes two arguments:
@@ -216,49 +216,49 @@ The **`test`** method takes two arguments:
as the block may need to be treated differently if it is inside a list, for
example.
-* **`block`**: A string of the current block of text. The test may be a
- simple string method (such as `block.startswith(some_text)`) or a complex
+* **`block`**: A string of the current block of text. The test may be a
+ simple string method (such as `block.startswith(some_text)`) or a complex
regular expression.
The **`run`** method takes two arguments:
-* **`parent`**: A pointer to the parent ElementTree Element of the block. The run
+* **`parent`**: A pointer to the parent ElementTree Element of the block. The run
method will most likely attach additional nodes to this parent. Note that
nothing is returned by the method. The ElementTree object is altered in place.
-* **`blocks`**: A list of all remaining blocks of the document. Your run
+* **`blocks`**: A list of all remaining blocks of the document. Your run
method must remove (pop) the first block from the list (which it altered in
place - not returned) and parse that block. You may find that a block of text
- legitimately contains multiple block types. Therefore, after processing the
+ legitimately contains multiple block types. Therefore, after processing the
first type, your processor can insert the remaining text into the beginning
of the `blocks` list for future parsing.
Please be aware that a single block can span multiple text blocks. For example,
The official Markdown syntax rules state that a blank line does not end a
Code Block. If the next block of text is also indented, then it is part of
-the previous block. Therefore, the BlockParser was specifically designed to
+the previous block. Therefore, the BlockParser was specifically designed to
address these types of situations. If you notice the `CodeBlockProcessor`,
in the core, you will note that it checks the last child of the `parent`.
If the last child is a code block (`<pre><code>...</code></pre>`), then it
-appends that block to the previous code block rather than creating a new
+appends that block to the previous code block rather than creating a new
code block.
Each Blockprocessor has the following utility methods available:
-* **`lastChild(parent)`**:
+* **`lastChild(parent)`**:
Returns the last child of the given ElementTree Element or `None` if it
had no children.
-* **`detab(text)`**:
+* **`detab(text)`**:
Removes one level of indent (four spaces by default) from the front of each
line of the given text string.
-* **`looseDetab(text, level)`**:
+* **`looseDetab(text, level)`**:
- Removes "level" levels of indent (defaults to 1) from the front of each line
- of the given text string. However, this methods allows secondary lines to
+ Removes "level" levels of indent (defaults to 1) from the front of each line
+ of the given text string. However, this methods allows secondary lines to
not be indented as does some parts of the Markdown syntax.
Each Blockprocessor also has a pointer to the containing BlockParser instance at
@@ -268,19 +268,19 @@ stack is an instance of the `State` class.
**`State`** is a subclass of `list` and has the additional methods:
-* **`set(state)`**:
+* **`set(state)`**:
- Set a new state to string `state`. The new state is appended to the end
+ Set a new state to string `state`. The new state is appended to the end
of the stack.
-* **`reset()`**:
+* **`reset()`**:
- Step back one step in the stack. The last state at the end is removed from
+ Step back one step in the stack. The last state at the end is removed from
the stack.
-* **`isstate(state)`**:
+* **`isstate(state)`**:
- Test that the top (current) level of the stack is of the given string
+ Test that the top (current) level of the stack is of the given string
`state`.
Note that to ensure that the state stack does not become corrupted, each time a
@@ -290,24 +290,24 @@ parsing that block.
An instance of the **`BlockParser`** is found at `Markdown.parser`.
`BlockParser` has the following methods:
-* **`parseDocument(lines)`**:
+* **`parseDocument(lines)`**:
- Given a list of lines, an ElementTree object is returned. This should be
- passed an entire document and is the only method the `Markdown` class
+ Given a list of lines, an ElementTree object is returned. This should be
+ passed an entire document and is the only method the `Markdown` class
calls directly.
-* **`parseChunk(parent, text)`**:
+* **`parseChunk(parent, text)`**:
- Parses a chunk of markdown text composed of multiple blocks and attaches
- those blocks to the `parent` Element. The `parent` is altered in place
- and nothing is returned. Extensions would most likely use this method for
+ Parses a chunk of markdown text composed of multiple blocks and attaches
+ those blocks to the `parent` Element. The `parent` is altered in place
+ and nothing is returned. Extensions would most likely use this method for
block parsing.
-* **`parseBlocks(parent, blocks)`**:
+* **`parseBlocks(parent, blocks)`**:
Parses a list of blocks of text and attaches those blocks to the `parent`
- Element. The `parent` is altered in place and nothing is returned. This
- method will generally only be used internally to recursively parse nested
+ Element. The `parent` is altered in place and nothing is returned. This
+ method will generally only be used internally to recursively parse nested
blocks of text.
While is is not recommended, an extension could subclass or completely replace
@@ -315,91 +315,97 @@ the `BlockParser`. The new class would have to provide the same public API.
However, be aware that other extensions may expect the core parser provided
and will not work with such a drastically different parser.
-Working with the ElementTree {: #working_with_et }
---------------------------------------------------
+## Working with the ElementTree {: #working_with_et }
-As mentioned, the Markdown parser converts a source document to an
-[ElementTree][ElementTree] object before serializing that back to Unicode text.
-Markdown has provided some helpers to ease that manipulation within the context
+As mentioned, the Markdown parser converts a source document to an
+[ElementTree][ElementTree] object before serializing that back to Unicode text.
+Markdown has provided some helpers to ease that manipulation within the context
of the Markdown module.
-First, to get access to the ElementTree module import ElementTree from
-`markdown` rather than importing it directly. This will ensure you are using
-the same version of ElementTree as markdown. The module is found at
+First, to get access to the ElementTree module import ElementTree from
+`markdown` rather than importing it directly. This will ensure you are using
+the same version of ElementTree as markdown. The module is found at
`markdown.util.etree` within Markdown.
- from markdown.util import etree
-
-`markdown.util.etree` tries to import ElementTree from any known location,
-first as a standard library module (from `xml.etree` in Python 2.5), then as
-a third party package (ElementTree). In each instance, `cElementTree` is
-tried first, then ElementTree if the faster C implementation is not
+```python
+from markdown.util import etree
+```
+
+`markdown.util.etree` tries to import ElementTree from any known location,
+first as a standard library module (from `xml.etree` in Python 2.5), then as
+a third party package (ElementTree). In each instance, `cElementTree` is
+tried first, then ElementTree if the faster C implementation is not
available on your system.
-Sometimes you may want text inserted into an element to be parsed by
+Sometimes you may want text inserted into an element to be parsed by
[Inline Patterns][]. In such a situation, simply insert the text as you normally
-would and the text will be automatically run through the Inline Patterns.
+would and the text will be automatically run through the Inline Patterns.
However, if you do *not* want some text to be parsed by Inline Patterns,
then insert the text as an `AtomicString`.
- from markdown.util import AtomicString
- some_element.text = AtomicString(some_text)
+```python
+from markdown.util import AtomicString
+some_element.text = AtomicString(some_text)
+```
-Here's a basic example which creates an HTML table (note that the contents of
+Here's a basic example which creates an HTML table (note that the contents of
the second cell (`td2`) will be run through Inline Patterns latter):
- table = etree.Element("table")
- table.set("cellpadding", "2") # Set cellpadding to 2
- tr = etree.SubElement(table, "tr") # Add child tr to table
- td1 = etree.SubElement(tr, "td") # Add child td1 to tr
- td1.text = markdown.util.AtomicString("Cell content") # Add plain text content
- td2 = etree.SubElement(tr, "td") # Add second td to tr
- td2.text = "*text* with **inline** formatting." # Add markup text
- table.tail = "Text after table" # Add text after table
-
-You can also manipulate an existing tree. Consider the following example which
+```python
+table = etree.Element("table")
+table.set("cellpadding", "2") # Set cellpadding to 2
+tr = etree.SubElement(table, "tr") # Add child tr to table
+td1 = etree.SubElement(tr, "td") # Add child td1 to tr
+td1.text = markdown.util.AtomicString("Cell content") # Add plain text content
+td2 = etree.SubElement(tr, "td") # Add second td to tr
+td2.text = "*text* with **inline** formatting." # Add markup text
+table.tail = "Text after table" # Add text after table
+```
+
+You can also manipulate an existing tree. Consider the following example which
adds a `class` attribute to `<a>` elements:
- def set_link_class(self, element):
- for child in element:
- if child.tag == "a":
- child.set("class", "myclass") #set the class attribute
- set_link_class(child) # run recursively on children
+```python
+def set_link_class(self, element):
+ for child in element:
+ if child.tag == "a":
+ child.set("class", "myclass") #set the class attribute
+ set_link_class(child) # run recursively on children
+```
For more information about working with ElementTree see the ElementTree
-[Documentation](http://effbot.org/zone/element-index.htm)
+[Documentation](http://effbot.org/zone/element-index.htm)
([Python Docs](http://docs.python.org/lib/module-xml.etree.ElementTree.html)).
-Integrating Your Code Into Markdown {: #integrating_into_markdown }
--------------------------------------------------------------------
+## Integrating Your Code Into Markdown {: #integrating_into_markdown }
-Once you have the various pieces of your extension built, you need to tell
-Markdown about them and ensure that they are run in the proper sequence.
+Once you have the various pieces of your extension built, you need to tell
+Markdown about them and ensure that they are run in the proper sequence.
Markdown accepts an `Extension` instance for each extension. Therefore, you
-will need to define a class that extends `markdown.extensions.Extension` and
-over-rides the `extendMarkdown` method. Within this class you will manage
-configuration options for your extension and attach the various processors and
-patterns to the Markdown instance.
-
-It is important to note that the order of the various processors and patterns
-matters. For example, if we replace `http://...` links with `<a>` elements,
-and *then* try to deal with inline HTML, we will end up with a mess.
-Therefore, the various types of processors and patterns are stored within an
-instance of the Markdown class in [OrderedDict][]s. Your `Extension` class
-will need to manipulate those OrderedDicts appropriately. You may insert
-instances of your processors and patterns into the appropriate location in an
-OrderedDict, remove a built-in instance, or replace a built-in instance with
+will need to define a class that extends `markdown.extensions.Extension` and
+over-rides the `extendMarkdown` method. Within this class you will manage
+configuration options for your extension and attach the various processors and
+patterns to the Markdown instance.
+
+It is important to note that the order of the various processors and patterns
+matters. For example, if we replace `http://...` links with `<a>` elements,
+and *then* try to deal with inline HTML, we will end up with a mess.
+Therefore, the various types of processors and patterns are stored within an
+instance of the Markdown class in [OrderedDict][]s. Your `Extension` class
+will need to manipulate those OrderedDicts appropriately. You may insert
+instances of your processors and patterns into the appropriate location in an
+OrderedDict, remove a built-in instance, or replace a built-in instance with
your own.
### `extendMarkdown` {: #extendmarkdown }
-The `extendMarkdown` method of a `markdown.extensions.Extension` class
+The `extendMarkdown` method of a `markdown.extensions.Extension` class
accepts two arguments:
* **`md`**:
- A pointer to the instance of the Markdown class. You should use this to
- access the [OrderedDict][]s of processors and patterns. They are found
+ A pointer to the instance of the Markdown class. You should use this to
+ access the [OrderedDict][]s of processors and patterns. They are found
under the following attributes:
* `md.preprocessors`
@@ -426,23 +432,25 @@ accepts two arguments:
Contains all the various global variables within the markdown module.
!!! Warning
- With access to the above items, theoretically you have the option to
- change anything through various [monkey_patching][] techniques. However,
- you should be aware that the various undocumented parts of markdown may
+ With access to the above items, theoretically you have the option to
+ change anything through various [monkey_patching][] techniques. However,
+ you should be aware that the various undocumented parts of markdown may
change without notice and your monkey_patches may break with a new release.
- Therefore, what you really should be doing is inserting processors and
+ Therefore, what you really should be doing is inserting processors and
patterns into the markdown pipeline. Consider yourself warned!
[monkey_patching]: http://en.wikipedia.org/wiki/Monkey_patch
A simple example:
- from markdown.extensions import Extension
+```python
+from markdown.extensions import Extension
- class MyExtension(Extension):
- def extendMarkdown(self, md, md_globals):
- # Insert instance of 'mypattern' before 'references' pattern
- md.inlinePatterns.add('mypattern', MyPattern(md), '<references')
+class MyExtension(Extension):
+ def extendMarkdown(self, md, md_globals):
+ # Insert instance of 'mypattern' before 'references' pattern
+ md.inlinePatterns.add('mypattern', MyPattern(md), '<references')
+```
### OrderedDict {: #ordereddict }
@@ -451,15 +459,15 @@ items. The items are ordered in the order in which they were appended to
the OrderedDict. However, an item can also be inserted into the OrderedDict
in a specific location in relation to the existing items.
-Think of OrderedDict as a combination of a list and a dictionary as it has
-methods common to both. For example, you can get and set items using the
-`od[key] = value` syntax and the methods `keys()`, `values()`, and
-`items()` work as expected with the keys, values and items returned in the
-proper order. At the same time, you can use `insert()`, `append()`, and
+Think of OrderedDict as a combination of a list and a dictionary as it has
+methods common to both. For example, you can get and set items using the
+`od[key] = value` syntax and the methods `keys()`, `values()`, and
+`items()` work as expected with the keys, values and items returned in the
+proper order. At the same time, you can use `insert()`, `append()`, and
`index()` as you would with a list.
-Generally speaking, within Markdown extensions you will be using the special
-helper method `add()` to add additional items to an existing OrderedDict.
+Generally speaking, within Markdown extensions you will be using the special
+helper method `add()` to add additional items to an existing OrderedDict.
The `add()` method accepts three arguments:
@@ -467,47 +475,53 @@ The `add()` method accepts three arguments:
* **`value`**: The object instance stored in this item.
-* **`location`**: The items location in relation to other items.
+* **`location`**: The items location in relation to other items.
Note that the location can consist of a few different values:
- * The special strings `"_begin"` and `"_end"` insert that item at the
- beginning or end of the OrderedDict respectively.
-
- * A less-than sign (`<`) followed by an existing key (i.e.:
+ * The special strings `"_begin"` and `"_end"` insert that item at the
+ beginning or end of the OrderedDict respectively.
+
+ * A less-than sign (`<`) followed by an existing key (i.e.:
`"<somekey"`) inserts that item before the existing key.
-
- * A greater-than sign (`>`) followed by an existing key (i.e.:
- `">somekey"`) inserts that item after the existing key.
+
+ * A greater-than sign (`>`) followed by an existing key (i.e.:
+ `">somekey"`) inserts that item after the existing key.
Consider the following example:
- >>> from markdown.odict import OrderedDict
- >>> od = OrderedDict()
- >>> od['one'] = 1 # The same as: od.add('one', 1, '_begin')
- >>> od['three'] = 3 # The same as: od.add('three', 3, '>one')
- >>> od['four'] = 4 # The same as: od.add('four', 4, '_end')
- >>> od.items()
- [("one", 1), ("three", 3), ("four", 4)]
+```pycon
+>>> from markdown.odict import OrderedDict
+>>> od = OrderedDict()
+>>> od['one'] = 1 # The same as: od.add('one', 1, '_begin')
+>>> od['three'] = 3 # The same as: od.add('three', 3, '>one')
+>>> od['four'] = 4 # The same as: od.add('four', 4, '_end')
+>>> od.items()
+[("one", 1), ("three", 3), ("four", 4)]
+```
Note that when building an OrderedDict in order, the extra features of the
-`add` method offer no real value and are not necessary. However, when
-manipulating an existing OrderedDict, `add` can be very helpful. So let's
+`add` method offer no real value and are not necessary. However, when
+manipulating an existing OrderedDict, `add` can be very helpful. So let's
insert another item into the OrderedDict.
- >>> od.add('two', 2, '>one') # Insert after 'one'
- >>> od.values()
- [1, 2, 3, 4]
+```pycon
+>>> od.add('two', 2, '>one') # Insert after 'one'
+>>> od.values()
+[1, 2, 3, 4]
+```
Now let's insert another item.
- >>> od.add('two-point-five', 2.5, '<three') # Insert before 'three'
- >>> od.keys()
- ["one", "two", "two-point-five", "three", "four"]
+```pycon
+>>> od.add('two-point-five', 2.5, '<three') # Insert before 'three'
+>>> od.keys()
+["one", "two", "two-point-five", "three", "four"]
+```
Note that we also could have set the location of "two-point-five" to be 'after two'
-(i.e.: `'>two'`). However, it's unlikely that you will have control over the
-order in which extensions will be loaded, and this could affect the final
+(i.e.: `'>two'`). However, it's unlikely that you will have control over the
+order in which extensions will be loaded, and this could affect the final
sorted order of an OrderedDict. For example, suppose an extension adding
"two-point-five" in the above examples was loaded before a separate extension
which adds 'two'. You may need to take this into consideration when adding your
@@ -515,30 +529,40 @@ extension components to the various markdown OrderedDicts.
Once an OrderedDict is created, the items are available via key:
- MyNode = od['somekey']
+```python
+MyNode = od['somekey']
+```
Therefore, to delete an existing item:
- del od['somekey']
+```python
+del od['somekey']
+```
To change the value of an existing item (leaving location unchanged):
- od['somekey'] = MyNewObject()
+```python
+od['somekey'] = MyNewObject()
+```
To change the location of an existing item:
- t.link('somekey', '<otherkey')
+```python
+t.link('somekey', '<otherkey')
+```
### registerExtension {: #registerextension }
Some extensions may need to have their state reset between multiple runs of the
-Markdown class. For example, consider the following use of the [Footnotes][]
+Markdown class. For example, consider the following use of the [Footnotes][]
extension:
- md = markdown.Markdown(extensions=['footnotes'])
- html1 = md.convert(text_with_footnote)
- md.reset()
- html2 = md.convert(text_without_footnote)
+```python
+md = markdown.Markdown(extensions=['footnotes'])
+html1 = md.convert(text_with_footnote)
+md.reset()
+html2 = md.convert(text_without_footnote)
+```
Without calling `reset`, the footnote definitions from the first document will
be inserted into the second document as they are still stored within the class
@@ -547,15 +571,16 @@ that will reset the state of the extension (i.e.: `self.footnotes = {}`).
However, as many extensions do not have a need for `reset`, `reset` is only
called on extensions that are registered.
-To register an extension, call `md.registerExtension` from within your
+To register an extension, call `md.registerExtension` from within your
`extendMarkdown` method:
+```python
+def extendMarkdown(self, md, md_globals):
+ md.registerExtension(self)
+ # insert processors and patterns here
+```
- def extendMarkdown(self, md, md_globals):
- md.registerExtension(self)
- # insert processors and patterns here
-
-Then, each time `reset` is called on the Markdown instance, the `reset`
+Then, each time `reset` is called on the Markdown instance, the `reset`
method of each registered extension will be called as well. You should also
note that `reset` will be called on each registered extension after it is
initialized the first time. Keep that in mind when over-riding the extension's
@@ -564,104 +589,117 @@ initialized the first time. Keep that in mind when over-riding the extension's
### Configuration Settings {: #configsettings }
If an extension uses any parameters that the user may want to change,
-those parameters should be stored in `self.config` of your
+those parameters should be stored in `self.config` of your
`markdown.extensions.Extension` class in the following format:
- class MyExtension(markdown.extensions.Extension):
- def __init__(self, **kwargs):
- self.config = {'option1' : ['value1', 'description1'],
- 'option2' : ['value2', 'description2'] }
- super(MyExtension, self).__init__(**kwargs)
+```python
+class MyExtension(markdown.extensions.Extension):
+ def __init__(self, **kwargs):
+ self.config = {'option1' : ['value1', 'description1'],
+ 'option2' : ['value2', 'description2'] }
+ super(MyExtension, self).__init__(**kwargs)
+```
-When implemented this way the configuration parameters can be over-ridden at
+When implemented this way the configuration parameters can be over-ridden at
run time (thus the call to `super`). For example:
- markdown.Markdown(extensions=[MyExtension(option1='other value'])
+```python
+markdown.Markdown(extensions=[MyExtension(option1='other value'])
+```
-Note that if a keyword is passed in that is not already defined in
+Note that if a keyword is passed in that is not already defined in
`self.config`, then a `KeyError` is raised.
The `markdown.extensions.Extension` class and its subclasses have the
following methods available to assist in working with configuration settings:
-* **`getConfig(key [, default])`**:
+* **`getConfig(key [, default])`**:
- Returns the stored value for the given `key` or `default` if the `key`
- does not exist. If not set, `default` returns an empty string.
+ Returns the stored value for the given `key` or `default` if the `key`
+ does not exist. If not set, `default` returns an empty string.
* **`getConfigs()`**:
- Returns a dict of all key/value pairs.
+ Returns a dict of all key/value pairs.
* **`getConfigInfo()`**:
- Returns all configuration descriptions as a list of tuples.
+ Returns all configuration descriptions as a list of tuples.
* **`setConfig(key, value)`**:
-
- Sets a configuration setting for `key` with the given `value`. If `key` is
- unknown, a `KeyError` is raised. If the previous value of `key` was
- a Boolean value, then `value` is converted to a Boolean value. If
- the previous value of `key` is `None`, then `value` is converted to
- a Boolean value except when it is `None`. No conversion takes place
- when the previous value of `key` is a string.
+
+ Sets a configuration setting for `key` with the given `value`. If `key` is
+ unknown, a `KeyError` is raised. If the previous value of `key` was
+ a Boolean value, then `value` is converted to a Boolean value. If
+ the previous value of `key` is `None`, then `value` is converted to
+ a Boolean value except when it is `None`. No conversion takes place
+ when the previous value of `key` is a string.
* **`setConfigs(items)`**:
- Sets multiple configuration settings given a dict of key/value pairs.
+ Sets multiple configuration settings given a dict of key/value pairs.
### `makeExtension` {: #makeextension }
As noted in the [library reference] an instance of an extension can be passed
-directly to Markdown. In fact, this is the preferred way to use third-party
+directly to Markdown. In fact, this is the preferred way to use third-party
extensions.
For example:
- import markdown
- import myextension
- myext = myextension.MyExtension(option='value')
- md = markdown.Markdown(extensions=[myext])
+```python
+import markdown
+import myextension
+myext = myextension.MyExtension(option='value')
+md = markdown.Markdown(extensions=[myext])
+```
-Markdown also accepts "named" third party extensions for those occasions
-when it is impractical to import an extension directly (from the command line or from
-within templates).
+Markdown also accepts "named" third party extensions for those occasions when it
+is impractical to import an extension directly (from the command line or from
+within templates).
The "name" of your extension must be a string consisting of the importable path to
your module using Python's dot notation. Therefore, if you are providing a library
-to your users and would like to include a custom markdown extension within your
+to your users and would like to include a custom markdown extension within your
library, that extension would be named `"mylib.mdext.myext"` where `mylib/mdext/myext.py`
contains the extension and the `mylib` directory is on the PYTHONPATH.
The string can also include the name of the class separated by a colon.
Therefore, if you were to import the class like this:
-
- from path.to.module import SomeExtensionClass
+
+```python
+from path.to.module import SomeExtensionClass
+```
Then the named extension would comprise this string:
- "path.to.module:SomeExtensionClass"
+```python
+"path.to.module:SomeExtensionClass"
+```
You do not need to do anything special to support this feature. As long as your
extension class is able to be imported, a user can include it with the above syntax.
-The above two methods are especially useful if you need to implement a large number of
-extensions with more than one residing in a module. However, if you do not want to require
-that your users include the class name in their string, you must define only one extension
-per module and that module must contain a module-level function called `makeExtension`
-that accepts `**kwargs` and returns an extension instance.
+The above two methods are especially useful if you need to implement a large
+number of extensions with more than one residing in a module. However, if you do
+not want to require that your users include the class name in their string, you
+must define only one extension per module and that module must contain a
+module-level function called `makeExtension` that accepts `**kwargs` and returns
+an extension instance.
For example:
- class MyExtension(markdown.extensions.Extension)
- # Define extension here...
-
- def makeExtension(**kwargs):
- return MyExtension(**kwargs)
+```python
+class MyExtension(markdown.extensions.Extension)
+ # Define extension here...
-When Markdown is passed the "name" of your extension as a dot notation string, it will import
-the module and call the `makeExtension` function to initiate your extension.
+def makeExtension(**kwargs):
+ return MyExtension(**kwargs)
+```
+When Markdown is passed the "name" of your extension as a dot notation string,
+it will import the module and call the `makeExtension` function to initiate your
+extension.
[Preprocessors]: #preprocessors
[Inline Patterns]: #inlinepatterns
@@ -676,7 +714,7 @@ the module and call the `makeExtension` function to initiate your extension.
[Config Settings]: #configsettings
[makeExtension]: #makeextension
[ElementTree]: http://effbot.org/zone/element-index.htm
-[Available Extensions]: index.html
-[Footnotes]: footnotes.html
-[Definition Lists]: definition_lists.html
-[library reference]: ../reference.html
+[Available Extensions]: index.md
+[Footnotes]: https://github.com/Python-Markdown/mdx_footnotes
+[Definition Lists]: https://github.com/Python-Markdown/mdx_definition_lists
+[library reference]: ../reference.md
diff --git a/docs/extensions/attr_list.txt b/docs/extensions/attr_list.md
index 1951347..7b2e19f 100644
--- a/docs/extensions/attr_list.txt
+++ b/docs/extensions/attr_list.md
@@ -1,36 +1,31 @@
-title: Attribute Lists Extension
-prev_title: Abbreviations Extension
-prev_url: abbreviations.html
-next_title: Definition Lists Extension
-next_url: definition_lists.html
+title: Attribute Lists Extension
-Attribute Lists
-===============
+# Attribute Lists
-Summary
--------
+## Summary
The Attribute Lists extension adds a syntax to define attributes on the various
HTML elements in markdown's output.
This extension is included in the standard Markdown library.
-Syntax
-------
+## Syntax
The basic syntax was inspired by [Maruku][]'s Attribute Lists feature.
[Maruku]: http://maruku.rubyforge.org/proposal.html#attribute_lists
-### The List ###
+### The List
An example attribute list might look like this:
- {: #someid .someclass somekey='some value' }
+```text
+{: #someid .someclass somekey='some value' }
+```
A word which starts with a hash (`#`) will set the id of an element.
-A word which starts with a dot (`.`) will be added to the list of classes
+A word which starts with a dot (`.`) will be added to the list of classes
assigned to an element.
A key/value pair (`somekey='some value'`) will assign that pair to the element.
@@ -38,51 +33,66 @@ A key/value pair (`somekey='some value'`) will assign that pair to the element.
Be aware that while the dot syntax will add to a class, using key/value pairs
will always override the previously defined attribute. Consider the following:
- {: #id1 .class1 id=id2 class="class2 class3" .class4 }
+```text
+{: #id1 .class1 id=id2 class="class2 class3" .class4 }
+```
The above example would result in the following attributes being defined:
- id="id2" class="class2 class3 class4"
+```text
+id="id2" class="class2 class3 class4"
+```
-### Block Level ###
+### Block Level
To define attributes for a block level element, the attribute list should
be defined on the last line of the block by itself.
- This is a paragraph.
- {: #an_id .a_class }
+```text
+This is a paragraph.
+{: #an_id .a_class }
+```
The above results in the following output:
- <p id="an_id" class="a_class">This is a paragraph.</p>
+```html
+<p id="an_id" class="a_class">This is a paragraph.</p>
+```
The one exception is headers, as they are only ever allowed on one line.
- A setext style header {: #setext}
- =================================
+```text
+A setext style header {: #setext}
+=================================
- ### A hash style header ### {: #hash }
+### A hash style header ### {: #hash }
+```
The above results in the following output:
- <h1 id="setext">A setext style header</h1>
- <h3 id="hash">A hash style header</h3>
+```html
+<h1 id="setext">A setext style header</h1>
+<h3 id="hash">A hash style header</h3>
+```
-### Inline ###
+### Inline
-To define attributes on inline elements, the attribute list should be defined
+To define attributes on inline elements, the attribute list should be defined
immediately after the inline element with no white space.
- [link](http://example.com){: class="foo bar" title="Some title!" }
+```text
+[link](http://example.com){: class="foo bar" title="Some title!" }
+```
The above results in the following output:
- <p><a href="http://example.com" class="foo bar" title="Some title!">link</a></p>
+```html
+<p><a href="http://example.com" class="foo bar" title="Some title!">link</a></p>
+```
-Usage
------
+## Usage
-See [Extensions](index.html) for general extension usage, specify `markdown.extensions.attr_list`
-as the name of the extension.
+See [Extensions](index.md) for general extension usage, specify
+`markdown.extensions.attr_list` as the name of the extension.
This extension does not accept any special configuration options.
diff --git a/docs/extensions/code_hilite.txt b/docs/extensions/code_hilite.md
index c2980f2..6490dcc 100644
--- a/docs/extensions/code_hilite.txt
+++ b/docs/extensions/code_hilite.md
@@ -1,14 +1,8 @@
-title: CodeHilite Extension
-prev_title: Admonition Extension
-prev_url: admonition.html
-next_title: HeaderId Extension
-next_url: header_id.html
+title: CodeHilite Extension
-CodeHilite
-==========
+# CodeHilite
-Summary
--------
+## Summary
The CodeHilite extension adds code/syntax highlighting to standard
Python-Markdown code blocks using [Pygments][].
@@ -17,10 +11,9 @@ Python-Markdown code blocks using [Pygments][].
This extension is included in the standard Markdown library.
-Setup
------
+## Setup
-### Step 1: Download and Install Pygments ###
+### Step 1: Download and Install Pygments
You will also need to [download][dl] and install the Pygments package on your
`PYTHONPATH`. The CodeHilite extension will produce HTML output without
@@ -29,14 +22,16 @@ Pygments, but it won't highlight anything (same behavior as setting
[dl]: http://pygments.org/download/
-### Step 2: Add CSS Classes ###
+### Step 2: Add CSS Classes
You will need to define the appropriate CSS classes with appropriate rules.
The CSS rules either need to be defined in or linked from the header of your
HTML templates. Pygments can generate CSS rules for you. Just run the following
command from the command line:
- pygmentize -S default -f html -a .codehilite > styles.css
+```bash
+pygmentize -S default -f html -a .codehilite > styles.css
+```
If you are using a different `css_class` (default: `.codehilite`), then
set the value of the `-a` option to that class name. The CSS rules will be
@@ -47,7 +42,9 @@ If you would like to use a different theme, swap out `default` for the desired
theme. For a list of themes installed on your system (additional themes can be
installed via Pygments plugins), run the following command:
- pygmentize -L style
+```bash
+pygmentize -L style
+```
See Pygments' excellent [documentation] for more details. If no language is
defined, Pygments will attempt to guess the language. When that fails, the code
@@ -68,9 +65,7 @@ block will not be highlighted.
[preview]: http://richleland.github.io/pygments-css/
[documentation]: http://pygments.org/docs/
-
-Syntax
-------
+## Syntax
The CodeHilite extension follows the same [syntax][] as regular Markdown code
blocks, with one exception. The highlighter needs to know what language to use for
@@ -86,43 +81,51 @@ code block contains and each one has a different result.
[syntax]: http://daringfireball.net/projects/markdown/syntax#precode
-### Shebang (with path) ###
+### Shebang (with path)
If the first line of the code block contains a shebang, the language is derived
from that and line numbers are used.
- #!/usr/bin/python
- # Code goes here ...
+```md
+ #!/usr/bin/python
+ # Code goes here ...
+```
Will result in:
#!/usr/bin/python
# Code goes here ...
-### Shebang (no path) ###
+### Shebang (no path)
If the first line contains a shebang, but the shebang line does not contain a
path (a single `/` or even a space), then that line is removed from the code
block before processing. Line numbers are used.
- #!python
- # Code goes here ...
+```md
+ #!python
+ # Code goes here ...
+```
Will result in:
+ #!python
# Code goes here ...
-### Colons ###
+### Colons
If the first line begins with three or more colons, the text following the
colons identifies the language. The first line is removed from the code block
before processing and line numbers are not used.
- :::python
- # Code goes here ...
+```md
+ :::python
+ # Code goes here ...
+```
Will result in:
+ :::python
# Code goes here ...
Certain lines can be selected for emphasis with the colon syntax. When
@@ -137,13 +140,15 @@ This is useful to direct the reader's attention to specific lines.
!!! Note
`hl_lines` is named for Pygments' option meaning "highlighted lines".
-### When No Language is Defined ###
+### When No Language is Defined
CodeHilite is completely backwards compatible so that if a code block is
encountered that does not define a language, the block is simply wrapped in
`<pre>` tags and output.
- # Code goes here ...
+```md
+ # Code goes here ...
+```
Will result in:
@@ -151,21 +156,22 @@ Will result in:
Lets see the source for that:
- <div class="codehilite"><pre><code># Code goes here ...
- </code></pre></div>
+```html
+<div class="codehilite"><pre><code># Code goes here ...
+</code></pre></div>
+```
!!! Note
When no language is defined, the Pygments highlighting engine will try to guess
the language (unless `guess_lang` is set to `False`). Upon failure, the same
behavior will happen as described above.
-Usage
------
+## Usage
-See [Extensions](index.html) for general extension usage, specify
+See [Extensions](index.md) for general extension usage, specify
`markdown.extensions.codehilite` as the name of the extension.
-See the [Library Reference](../reference.html#extensions) for information about
+See the [Library Reference](../reference.md#extensions) for information about
configuring extensions.
The following options are provided to configure the output:
diff --git a/docs/extensions/definition_lists.md b/docs/extensions/definition_lists.md
new file mode 100644
index 0000000..e9f8984
--- /dev/null
+++ b/docs/extensions/definition_lists.md
@@ -0,0 +1,52 @@
+title: Definition Lists Extension
+
+Definition Lists
+================
+
+Summary
+-------
+
+The Definition Lists extension adds the ability to create definition lists in
+Markdown documents.
+
+This extension is included in the standard Markdown library.
+
+Syntax
+------
+
+Definition lists are defined using the syntax established in
+[PHP Markdown Extra][php].
+
+[php]: http://www.michelf.com/projects/php-markdown/extra/#def-list
+
+Thus, the following text (taken from the above referenced PHP documentation):
+
+```md
+Apple
+: Pomaceous fruit of plants of the genus Malus in
+ the family Rosaceae.
+
+Orange
+: The fruit of an evergreen tree of the genus Citrus.
+```
+
+will be rendered as:
+
+```html
+<dl>
+<dt>Apple</dt>
+<dd>Pomaceous fruit of plants of the genus Malus in
+the family Rosaceae.</dd>
+
+<dt>Orange</dt>
+<dd>The fruit of an evergreen tree of the genus Citrus.</dd>
+</dl>
+```
+
+Usage
+-----
+
+See [Extensions](index.md) for general extension usage, specify
+`markdown.extensions.def_list` as the name of the extension.
+
+This extension does not accept any special configuration options.
diff --git a/docs/extensions/definition_lists.txt b/docs/extensions/definition_lists.txt
deleted file mode 100644
index d7003e2..0000000
--- a/docs/extensions/definition_lists.txt
+++ /dev/null
@@ -1,53 +0,0 @@
-title: Definition Lists Extension
-prev_title: Attribute Lists Extension
-prev_url: attr_list.html
-next_title: Fenced Code Blocks Extension
-next_url: fenced_code_blocks.html
-
-Definition Lists
-================
-
-Summary
--------
-
-The Definition Lists extension adds the ability to create definition lists in
-Markdown documents.
-
-This extension is included in the standard Markdown library.
-
-Syntax
-------
-
-Definition lists are defined using the syntax established in
-[PHP Markdown Extra][php].
-
-[php]: http://www.michelf.com/projects/php-markdown/extra/#def-list
-
-Thus, the following text (taken from the above referenced PHP documentation):
-
- Apple
- : Pomaceous fruit of plants of the genus Malus in
- the family Rosaceae.
-
- Orange
- : The fruit of an evergreen tree of the genus Citrus.
-
-will be rendered as:
-
- <dl>
- <dt>Apple</dt>
- <dd>Pomaceous fruit of plants of the genus Malus in
- the family Rosaceae.</dd>
-
- <dt>Orange</dt>
- <dd>The fruit of an evergreen tree of the genus Citrus.</dd>
- </dl>
-
-
-Usage
------
-
-See [Extensions](index.html) for general extension usage, specify `markdown.extensions.def_list`
-as the name of the extension.
-
-This extension does not accept any special configuration options.
diff --git a/docs/extensions/extra.txt b/docs/extensions/extra.md
index 5347d81..0639d3d 100644
--- a/docs/extensions/extra.txt
+++ b/docs/extensions/extra.md
@@ -1,49 +1,43 @@
-title: Extra Extension
-prev_title: Extensions
-prev_url: index.html
-next_title: Abbreviations Extension
-next_url: abbreviations.html
+title: Extra Extension
-Python-Markdown Extra
-=====================
+# Python-Markdown Extra
-Summary
--------
+## Summary
A compilation of various Python-Markdown extensions that (mostly) imitates
[PHP Markdown Extra](http://michelf.com/projects/php-markdown/extra/).
The supported extensions include:
-* [Abbreviations](abbreviations.html)
-* [Attribute Lists](attr_list.html)
-* [Definition Lists](definition_lists.html)
-* [Fenced Code Blocks](fenced_code_blocks.html)
-* [Footnotes](footnotes.html)
-* [Tables](tables.html)
-* [Smart Strong](smart_strong.html)
+* [Abbreviations](abbreviations.md)
+* [Attribute Lists](attr_list.md)
+* [Definition Lists](definition_lists.md)
+* [Fenced Code Blocks](fenced_code_blocks.md)
+* [Footnotes](footnotes.md)
+* [Tables](tables.md)
+* [Smart Strong](smart_strong.md)
-See each individual extension for syntax documentation. Extra and all its
+See each individual extension for syntax documentation. Extra and all its
supported extensions are included in the standard Markdown library.
-Usage
------
+## Usage
From the Python interpreter:
- >>> import markdown
- >>> html = markdown.markdown(text, ['markdown.extensions.extra'])
+```pycon
+>>> import markdown
+>>> html = markdown.markdown(text, ['markdown.extensions.extra'])
+```
-There may be [additional extensions](index.html) that are distributed with
-Python-Markdown that are not included here in Extra. The features
-of those extensions are not part of PHP Markdown Extra, and
-therefore, not part of Python-Markdown Extra. If you really would
-like Extra to include additional extensions, we suggest creating
-your own clone of Extra under a different name
-(see the [Extension API](api.html)).
+There may be [additional extensions](index.md) that are distributed with
+Python-Markdown that are not included here in Extra. The features
+of those extensions are not part of PHP Markdown Extra, and
+therefore, not part of Python-Markdown Extra. If you really would
+like Extra to include additional extensions, we suggest creating
+your own clone of Extra under a different name
+(see the [Extension API](api.md)).
-Markdown Inside HTML Blocks
----------------------------
+### Markdown Inside HTML Blocks
Unlike the other Extra features, this feature is built into the markdown core and
is turned on when `markdown.extensions.extra` is enabled.
@@ -60,15 +54,18 @@ regardless of tag. If the default is overridden by a value of `block`,
*block parsing will occur* regardless of tag.
#### Simple Example:
-```
+
+```md
This is *true* markdown text.
<div markdown="1">
This is *true* markdown text.
</div>
```
+
#### Result:
-```
+
+```html
<p>This is <em>true</em> markdown text.</p>
<div>
<p>This is <em>true</em> markdown text.</p>
@@ -76,6 +73,7 @@ This is *true* markdown text.
```
### Nested Markdown Inside HTML Blocks
+
Nested elements are more sensitive and must be used cautiously. To avoid
unexpected results:
@@ -84,7 +82,8 @@ unexpected results:
* Only have one level of nesting.
#### Complex Example:
-```
+
+```md
<div markdown="1" name="Example">
The text of the `Example` element.
@@ -120,8 +119,10 @@ Raw HTML blocks may also be nested.
This text is after the markdown in HTML.
```
-#### Result:
-```
+
+#### Complex Result:
+
+```html
<div name="Example">
<p>The text of the <code>Example</code> element.</p>
<div name="DefaultBlockMode">
diff --git a/docs/extensions/fenced_code_blocks.txt b/docs/extensions/fenced_code_blocks.md
index 982f5d4..b7a657e 100644
--- a/docs/extensions/fenced_code_blocks.txt
+++ b/docs/extensions/fenced_code_blocks.md
@@ -1,37 +1,32 @@
-title: Fenced Code Blocks Extension
-prev_title: Definition Lists Extension
-prev_url: definition_lists.html
-next_title: Footnotes Extension
-next_url: footnotes.html
+title: Fenced Code Blocks Extension
-Fenced Code Blocks
-==================
+# Fenced Code Blocks
-Summary
--------
+## Summary
The Fenced Code Blocks extension adds a secondary way to define code blocks,
which overcomes a few limitations of the indented code blocks.
This extension is included in the standard Markdown library.
-Syntax
-------
+## Syntax
-Fenced Code Blocks are defined using the syntax established in
+Fenced Code Blocks are defined using the syntax established in
[PHP Markdown Extra][php].
[php]: http://www.michelf.com/projects/php-markdown/extra/#fenced-code-blocks
Thus, the following text (taken from the above referenced PHP documentation):
- This is a paragraph introducing:
+```md
+This is a paragraph introducing:
+~~~~~~~~~~~~~~~~~~~~
+a one-line code block
~~~~~~~~~~~~~~~~~~~~
- a one-line code block
- ~~~~~~~~~~~~~~~~~~~~
+```
-Fenced code blocks can have a blank line as the first and/or last line of a
+Fenced code blocks can have a blank line as the first and/or last line of a
code block and they can also come immediately after a list item without becoming
part of the list.
@@ -40,42 +35,48 @@ part of the list.
Fenced Code Blocks are only supported at the document root level.
Therefore, they cannot be nested inside lists or blockquotes.
-### Language ###
+### Language
-In addition to PHP Extra's syntax, you can define the language of the code
-block for use by syntax highlighters etc. The language will be assigned as a
-class attribute of the ``<code>`` element in the output. Therefore, you should
-define the language as you would a CSS class - ``.language``. For consistency
-with other markdown syntax, the language can *optionally* be wrapped in curly
+In addition to PHP Extra's syntax, you can define the language of the code
+block for use by syntax highlighters etc. The language will be assigned as a
+class attribute of the ``<code>`` element in the output. Therefore, you should
+define the language as you would a CSS class - ``.language``. For consistency
+with other markdown syntax, the language can *optionally* be wrapped in curly
brackets:
- ~~~~{.python}
- # python code
- ~~~~
+```md
+~~~~{.python}
+# python code
+~~~~
- ~~~~.html
- <p>HTML Document</p>
- ~~~~
+~~~~.html
+<p>HTML Document</p>
+~~~~
+```
The above will output:
- <pre><code class="python"># python code
- </code></pre>
-
- <pre><code class="html">&lt;p&gt;HTML Document&lt;/p&gt;
- </code></pre>
+```html
+<pre><code class="python"># python code
+</code></pre>
+
+<pre><code class="html">&lt;p&gt;HTML Document&lt;/p&gt;
+</code></pre>
+```
[GitHub][]'s backtick (`\``) syntax is also supported:
- ```python
- # more python code
- ```
+````md
+```python
+# more python code
+```
+````
[GitHub]: http://github.github.com/github-flavored-markdown/
-### Emphasized Lines ###
+### Emphasized Lines
-If you would like to have your fenced code blocks highlighted with the
+If you would like to have your fenced code blocks highlighted with the
[CodeHilite][] extension, simply enable that extension (remember that
[Pygments][] is its dependency) and the language of your fenced code blocks
will be passed in and highlighted appropriately.
@@ -85,28 +86,31 @@ can also have emphasized certain lines of code.
The lines can be specified with PHP Extra's syntax:
- ~~~~{.python hl_lines="1 3"}
- # This line is emphasized
- # This line isn't
- # This line is emphasized
- ~~~~
+```md
+~~~~{.python hl_lines="1 3"}
+# This line is emphasized
+# This line isn't
+# This line is emphasized
+~~~~
+```
... or with GitHub's:
- ```python hl_lines="1 3"
- # This line is emphasized
- # This line isn't
- # This line is emphasized
- ```
+````md
+```python hl_lines="1 3"
+# This line is emphasized
+# This line isn't
+# This line is emphasized
+```
+````
[CodeHilite]: code_hilite.html
[Pygments]: http://pygments.org/
[colon]: code_hilite.html#colons
-Usage
------
+## Usage
-See [Extensions](index.html) for general extension usage, specify `markdown.extensions.fenced_code`
-as the name of the extension.
+See [Extensions](index.md) for general extension usage, specify
+`markdown.extensions.fenced_code` as the name of the extension.
This extension does not accept any special configuration options.
diff --git a/docs/extensions/footnotes.txt b/docs/extensions/footnotes.md
index e9b0451..c94c2c4 100644
--- a/docs/extensions/footnotes.txt
+++ b/docs/extensions/footnotes.md
@@ -1,8 +1,4 @@
-title: Footnotes Extension
-prev_title: Fenced Code Blocks Extension
-prev_url: fenced_code_blocks.html
-next_title: Tables Extension
-next_url: tables.html
+title: Footnotes Extension
Footnotes
=========
@@ -18,56 +14,59 @@ This extension is included in the standard Markdown library.
Syntax
------
-Python-Markdown's Footnote syntax follows the generally accepted syntax of the
+Python-Markdown's Footnote syntax follows the generally accepted syntax of the
Markdown community at large and almost exactly matches [PHP Markdown Extra][]'s
-implementation of footnotes. The only differences involve a few subtleties in
+implementation of footnotes. The only differences involve a few subtleties in
the output.
[PHP Markdown Extra]: http://michelf.com/projects/php-markdown/extra/#footnotes
Example:
- Footnotes[^1] have a label[^@#$%] and the footnote's content.
+```md
+Footnotes[^1] have a label[^@#$%] and the footnote's content.
- [^1]: This is a footnote content.
- [^@#$%]: A footnote on the label: "@#$%".
+[^1]: This is a footnote content.
+[^@#$%]: A footnote on the label: "@#$%".
+```
-A footnote label must start with a caret `^` and may contain any inline text
+A footnote label must start with a caret `^` and may contain any inline text
(including spaces) between a set of square brackets `[]`. Only the first
caret has any special meaning.
-A footnote content must start with the label followed by a colon and at least
+A footnote content must start with the label followed by a colon and at least
one space. The label used to define the content must exactly match the label used
-in the body (including capitalization and white space). The content would then
-follow the label either on the same line or on the next line. The content may
-contain multiple lines, paragraphs, code blocks, blockquotes and most any other
-markdown syntax. The additional lines must be indented one level (four spaces or
-one tab).
-
-When working with multiple blocks, it may be helpful to start the content on a
-separate line from the label which defines the content. This way the entire block
+in the body (including capitalization and white space). The content would then
+follow the label either on the same line or on the next line. The content may
+contain multiple lines, paragraphs, code blocks, blockquotes and most any other
+markdown syntax. The additional lines must be indented one level (four spaces or
+one tab).
+
+When working with multiple blocks, it may be helpful to start the content on a
+separate line from the label which defines the content. This way the entire block
is indented consistently and any errors are more easily discernible by the author.
- [^1]:
- The first paragraph of the definition.
+```md
+[^1]:
+ The first paragraph of the definition.
- Paragraph two of the definition.
+ Paragraph two of the definition.
- > A blockquote with
- > multiple lines.
+ > A blockquote with
+ > multiple lines.
- a code block
-
- A final paragraph.
+ a code block
+ A final paragraph.
+```
Usage
-----
-See [Extensions](index.html) for general extension usage, specify `markdown.extensions.footnotes`
-as the name of the extension.
+See [Extensions](index.md) for general extension usage, specify
+`markdown.extensions.footnotes` as the name of the extension.
-See the [Library Reference](../reference.html#extensions) for information about
+See the [Library Reference](../reference.md#extensions) for information about
configuring extensions.
The following options are provided to configure the output:
@@ -82,7 +81,7 @@ The following options are provided to configure the output:
* **`UNIQUE_IDS`**:
Whether to avoid collisions across multiple calls to `reset()`. Defaults to
`False`.
-
+
* **`BACKLINK_TEXT`**:
The text string that links from the footnote definition back to the position
in the document. Defaults to `&#8617;`.
diff --git a/docs/extensions/header_id.txt b/docs/extensions/header_id.md
index 5557b1b..82e8e2c 100644
--- a/docs/extensions/header_id.txt
+++ b/docs/extensions/header_id.md
@@ -1,8 +1,4 @@
-title: HeaderId Extension
-prev_title: CodeHilite Extension
-prev_url: code_hilite.html
-next_title: Meta-Data Extension
-next_url: meta_data.html
+title: HeaderId Extension
HeaderId
========
@@ -19,33 +15,37 @@ This extension is included in the standard Markdown library.
This extension is **Pending Deprecation**. The [Table of Contents][toc]
Extension should be used instead, which offers most the features of this
extension and more.
-
-[toc]: toc.html
+
+[toc]: toc.md
Syntax
------
-By default, all headers will automatically have unique `id` attributes
-generated based upon the text of the header (see below to turn this off).
+By default, all headers will automatically have unique `id` attributes
+generated based upon the text of the header (see below to turn this off).
Note this example, in which all three headers would have the same `id`:
- #Header
- #Header
- #Header
+```md
+#Header
+#Header
+#Header
+```
Results in:
- <h1 id="header">Header</h1>
- <h1 id="header_1">Header</h1>
- <h1 id="header_2">Header</h1>
+```html
+<h1 id="header">Header</h1>
+<h1 id="header_1">Header</h1>
+<h1 id="header_2">Header</h1>
+```
Usage
-----
-See [Extensions](index.html) for general extension usage, specify `markdown.extensions.headerid`
-as the name of the extension.
+See [Extensions](index.md) for general extension usage, specify
+`markdown.extensions.headerid` as the name of the extension.
-See the [Library Reference](../reference.html#extensions) for information about
+See the [Library Reference](../reference.md#extensions) for information about
configuring extensions.
The following options are provided to configure the output:
@@ -55,10 +55,11 @@ The following options are provided to configure the output:
Default: `1`
The `level` setting allows you to automatically adjust the header levels to
- fit within the hierarchy of your HTML templates. For example, suppose the
+ fit within the hierarchy of your HTML templates. For example, suppose the
markdown text for a page should not contain any headers higher than level 3
(`<h3>`). The following will accomplish that:
+ :::pycon
>>> text = '''
... #Some Header
... ## Next Level'''
@@ -72,10 +73,11 @@ The following options are provided to configure the output:
Default: `True`
- The `forceid` setting turns on or off the automatically generated ids for
+ The `forceid` setting turns on or off the automatically generated ids for
headers that do not have one explicitly defined (using the
- [Attribute List](attr_list.html) extension).
+ [Attribute List](attr_list.md) extension).
+ :::pycon
>>> text = '''
... # Some Header
... # Header with ID # { #foo }'''
@@ -103,24 +105,27 @@ The following options are provided to configure the output:
Using with Meta-Data
--------------------
-The HeaderId extension also supports the [Meta-Data](meta_data.html) extension.
-Please see the documentation for that extension for specifics. The supported
+The HeaderId extension also supports the [Meta-Data](meta_data.md) extension.
+Please see the documentation for that extension for specifics. The supported
meta-data keywords are:
* `header_level`
* `header_forceid`
-When used, the meta-data will override the settings provided through the
-`extension_configs` interface.
+When used, the meta-data will override the settings provided through the
+`extension_configs` interface.
This document:
- header_level: 2
- header_forceid: Off
-
- # A Header
+```md
+header_level: 2
+header_forceid: Off
+# A Header
+```
Will result in the following output:
- <h2>A Header</h2>
+```html
+<h2>A Header</h2>
+```
diff --git a/docs/extensions/index.txt b/docs/extensions/index.md
index ba95274..34f8084 100644
--- a/docs/extensions/index.txt
+++ b/docs/extensions/index.md
@@ -1,9 +1,4 @@
-title: Extensions
-prev_title: Command Line
-prev_url: ../cli.html
-next_title: Extra Extension
-next_url: extra.html
-
+title: Extensions
Available Extensions
====================
@@ -14,19 +9,23 @@ actual source files.
To use an extension, pass it to markdown with the `extensions` keyword.
- markdown.markdown(some_text, extensions=[MyExtension(), 'path.to.my.ext', 'markdown.extensions.footnotes'])
+```python
+markdown.markdown(some_text, extensions=[MyExtension(), 'path.to.my.ext', 'markdown.extensions.footnotes'])
+```
-See the [Library Reference](../reference.html#extensions) for more details.
+See the [Library Reference](../reference.md#extensions) for more details.
-From the command line, specify an extension with the `-x` option.
+From the command line, specify an extension with the `-x` option.
- $ python -m markdown -x markdown.extensions.footnotes -x markdown.extensions.tables input.txt > output.html
+```bash
+python -m markdown -x markdown.extensions.footnotes -x markdown.extensions.tables input.txt > output.html
+```
-See the [Command Line docs](../cli.html) or use the `--help` option for more details.
+See the [Command Line docs](../cli.md) or use the `--help` option for more details.
!!! seealso "See Also"
If you would like to write your own extensions, see the
- [Extension API](api.html) for details.
+ [Extension API](api.md) for details.
Officially Supported Extensions
-------------------------------
@@ -57,23 +56,23 @@ Extension | "Name"
[Table of Contents] | `markdown.extensions.toc`
[WikiLinks] | `markdown.extensions.wikilinks`
-[Extra]: extra.html
-[Abbreviations]: abbreviations.html
-[Attribute Lists]: attr_list.html
-[Definition Lists]: definition_lists.html
-[Fenced Code Blocks]: fenced_code_blocks.html
-[Footnotes]: footnotes.html
-[Tables]: tables.html
-[Smart Strong]: smart_strong.html
-[Admonition]: admonition.html
-[CodeHilite]: code_hilite.html
-[HeaderId]: header_id.html
-[Meta-Data]: meta_data.html
-[New Line to Break]: nl2br.html
-[Sane Lists]: sane_lists.html
-[SmartyPants]: smarty.html
-[Table of Contents]: toc.html
-[WikiLinks]: wikilinks.html
+[Extra]: extra.md
+[Abbreviations]: abbreviations.md
+[Attribute Lists]: attr_list.md
+[Definition Lists]: definition_lists.md
+[Fenced Code Blocks]: fenced_code_blocks.md
+[Footnotes]: footnotes.md
+[Tables]: tables.md
+[Smart Strong]: smart_strong.md
+[Admonition]: admonition.md
+[CodeHilite]: code_hilite.md
+[HeaderId]: header_id.md
+[Meta-Data]: meta_data.md
+[New Line to Break]: nl2br.md
+[Sane Lists]: sane_lists.md
+[SmartyPants]: smarty.md
+[Table of Contents]: toc.md
+[WikiLinks]: wikilinks.md
Third Party Extensions
----------------------
diff --git a/docs/extensions/meta_data.txt b/docs/extensions/meta_data.md
index 4a4fe62..36d5e7a 100644
--- a/docs/extensions/meta_data.txt
+++ b/docs/extensions/meta_data.md
@@ -1,8 +1,4 @@
-title: Meta-Data Extension
-prev_title: HeaderId Extension
-prev_url: header_id.html
-next_title: New Line to Break Extension
-next_url: nl2br.html
+title: Meta-Data Extension
Meta-Data
=========
@@ -23,26 +19,28 @@ This extension is included in the standard Markdown library.
Syntax
------
-Meta-data consists of a series of keywords and values defined at the beginning
+Meta-data consists of a series of keywords and values defined at the beginning
of a markdown document like this:
- Title: My Document
- Summary: A brief description of my document.
- Authors: Waylan Limberg
- John Doe
- Date: October 2, 2007
- blank-value:
- base_url: http://example.com
+```md
+Title: My Document
+Summary: A brief description of my document.
+Authors: Waylan Limberg
+ John Doe
+Date: October 2, 2007
+blank-value:
+base_url: http://example.com
- This is the first paragraph of the document.
+This is the first paragraph of the document.
+```
-The keywords are case-insensitive and may consist of letters, numbers,
-underscores and dashes and must end with a colon. The values consist of
+The keywords are case-insensitive and may consist of letters, numbers,
+underscores and dashes and must end with a colon. The values consist of
anything following the colon on the line and may even be blank.
If a line is indented by 4 or more spaces, that line is assumed to be an
additional line of the value for the previous keyword. A keyword may have as
-many lines as desired.
+many lines as desired.
The first blank line ends all meta-data for the document. Therefore, the first
line of a document must not be blank.
@@ -59,36 +57,38 @@ by Markdown.
Usage
-----
-See [Extensions](index.html) for general extension usage, specify `markdown.extensions.meta`
-as the name of the extension.
+See [Extensions](index.md) for general extension usage, specify
+`markdown.extensions.meta` as the name of the extension.
Accessing the Meta-Data
-----------------------
-The meta-data is made available as a python Dict in the `Meta` attribute of an
+The meta-data is made available as a python Dict in the `Meta` attribute of an
instance of the Markdown class. For example, using the above document:
- >>> md = markdown.Markdown(extensions = ['markdown.extensions.meta'])
- >>> html = md.convert(text)
- >>> # Meta-data has been stripped from output
- >>> print html
- <p>This is the first paragraph of the document.</p>
-
- >>> # View meta-data
- >>> print md.Meta
- {
- 'title' : ['My Document'],
- 'summary' : ['A brief description of my document.'],
- 'authors' : ['Waylan Limberg', 'John Doe'],
- 'date' : ['October 2, 2007'],
- 'blank-value' : [''],
- 'base_url' : ['http://example.com']
- }
-
-Note that the keys are all lowercase and the values consist of a list of
-strings where each item is one line for that key. This way, one could preserve
-line breaks if desired. Or the items could be joined where appropriate. No
-assumptions are made regarding the data. It is simply passed as found to the
+```pycon
+>>> md = markdown.Markdown(extensions = ['markdown.extensions.meta'])
+>>> html = md.convert(text)
+>>> # Meta-data has been stripped from output
+>>> print html
+<p>This is the first paragraph of the document.</p>
+
+>>> # View meta-data
+>>> print md.Meta
+{
+'title' : ['My Document'],
+'summary' : ['A brief description of my document.'],
+'authors' : ['Waylan Limberg', 'John Doe'],
+'date' : ['October 2, 2007'],
+'blank-value' : [''],
+'base_url' : ['http://example.com']
+}
+```
+
+Note that the keys are all lowercase and the values consist of a list of
+strings where each item is one line for that key. This way, one could preserve
+line breaks if desired. Or the items could be joined where appropriate. No
+assumptions are made regarding the data. It is simply passed as found to the
`Meta` attribute.
Perhaps the meta-data could be passed into a template system, or used by
@@ -98,14 +98,13 @@ the developer.
Compatible Extensions
---------------------
-The following extensions are currently known to work with the Meta-Data
+The following extensions are currently known to work with the Meta-Data
extension. The keywords they are known to support are also listed.
-* [HeaderId](header_id.html)
+* [HeaderId](header_id.md)
* `header_level`
* `header_forceid`
-* [WikiLinks](wikilinks.html)
+* [WikiLinks](wikilinks.md)
* `wiki_base_url`
* `wiki_end_url`
* `wiki_html_class`
-
diff --git a/docs/extensions/nl2br.md b/docs/extensions/nl2br.md
new file mode 100644
index 0000000..4f5e611
--- /dev/null
+++ b/docs/extensions/nl2br.md
@@ -0,0 +1,35 @@
+title: New Line to Break Extension
+
+New-Line-to-Break Extension
+===========================
+
+Summary
+-------
+
+The New-Line-to-Break (`nl2b`) Extension will cause newlines to be treated as
+hard breaks; like StackOverflow and [GitHub][] flavored Markdown do.
+
+[Github]: http://github.github.com/github-flavored-markdown/
+
+Example
+-------
+
+```pycon
+>>> import markdown
+>>> text = """
+... Line 1
+... Line 2
+... """
+>>> html = markdown.markdown(text, extensions=['markdown.extensions.nl2br'])
+>>> print html
+<p>Line 1<br />
+Line 2</p>
+```
+
+Usage
+-----
+
+See [Extensions](index.md) for general extension usage, specify
+`markdown.extensions.nl2br` as the name of the extension.
+
+This extension does not accept any special configuration options.
diff --git a/docs/extensions/nl2br.txt b/docs/extensions/nl2br.txt
deleted file mode 100644
index 8ba27c8..0000000
--- a/docs/extensions/nl2br.txt
+++ /dev/null
@@ -1,37 +0,0 @@
-title: New Line to Break Extension
-prev_title: Meta-Data Extension
-prev_url: meta_data.html
-next_title: Sane Lists Extension
-next_url: sane_lists.html
-
-New-Line-to-Break Extension
-===========================
-
-Summary
--------
-
-The New-Line-to-Break (`nl2b`) Extension will cause newlines to be treated as hard breaks; like
-StackOverflow and [GitHub][] flavored Markdown do.
-
-[Github]: http://github.github.com/github-flavored-markdown/
-
-Example
--------
-
- >>> import markdown
- >>> text = """
- ... Line 1
- ... Line 2
- ... """
- >>> html = markdown.markdown(text, extensions=['markdown.extensions.nl2br'])
- >>> print html
- <p>Line 1<br />
- Line 2</p>
-
-Usage
------
-
-See [Extensions](index.html) for general extension usage, specify `markdown.extensions.nl2br`
-as the name of the extension.
-
-This extension does not accept any special configuration options.
diff --git a/docs/extensions/sane_lists.txt b/docs/extensions/sane_lists.md
index 8f713d0..49a7a85 100644
--- a/docs/extensions/sane_lists.txt
+++ b/docs/extensions/sane_lists.md
@@ -1,8 +1,4 @@
-title: Sane Lists Extension
-prev_title: New Line to Break Extension
-prev_url: nl2br.html
-next_title: SmartyPants Extension
-next_url: smarty.html
+title: Sane Lists Extension
Sane Lists
==========
@@ -22,52 +18,60 @@ Sane Lists do not allow the mixing of list types. In other words, an ordered
list will not continue when an unordered list item is encountered and
vice versa. For example:
- 1. Ordered item 1
- 2. Ordered item 2
+```md
+1. Ordered item 1
+2. Ordered item 2
- * Unordered item 1
- * Unordered item 2
+* Unordered item 1
+* Unordered item 2
+```
will result in the following output:
- <ol>
- <li>Ordered item 1</li>
- <li>Ordered item 2</li>
- </ol>
+```html
+<ol>
+ <li>Ordered item 1</li>
+ <li>Ordered item 2</li>
+</ol>
- <ul>
- <li>Unordered item 1</li>
- <li>Unordered item 2</li>
- </ul>
+<ul>
+ <li>Unordered item 1</li>
+ <li>Unordered item 2</li>
+</ul>
+```
Whereas the default Markdown behavior would be to generate an unordered list.
Note that, unlike the default Markdown behavior, if a blank line is not
-included between list items, the different list type is ignored completely.
+included between list items, the different list type is ignored completely.
This corresponds to the behavior of paragraphs. For example:
- A Paragraph.
- * Not a list item.
+```md
+A Paragraph.
+* Not a list item.
- 1. Ordered list item.
- * Not a separate list item.
+1. Ordered list item.
+* Not a separate list item.
+```
With this extension the above will result in the following output:
- <p>A Paragraph.
- * Not a list item.</p>
+```html
+<p>A Paragraph.
+* Not a list item.</p>
- <ol>
- <li>Ordered list item.
- * Not a separate list item.</li>
- </ol>
+<ol>
+ <li>Ordered list item.
+ * Not a separate list item.</li>
+</ol>
+```
In all other ways, Sane Lists should behave as normal Markdown lists.
Usage
-----
-See [Extensions](index.html) for general extension usage, specify `markdown.extensions.sane_lists`
-as the name of the extension.
+See [Extensions](index.md) for general extension usage, specify
+`markdown.extensions.sane_lists` as the name of the extension.
This extension does not accept any special configuration options.
diff --git a/docs/extensions/smart_strong.md b/docs/extensions/smart_strong.md
new file mode 100644
index 0000000..1fb3c68
--- /dev/null
+++ b/docs/extensions/smart_strong.md
@@ -0,0 +1,39 @@
+title: Smart Strong Extension
+
+Smart_Strong
+============
+
+Summary
+-------
+
+The Smart_Strong extension adds smarter handling of double underscores within
+words. This does for double underscores what [smart_emphasis][] does for single
+underscores.
+
+The Smart_Strong extension is included in the standard Markdown library.
+
+[smart_emphasis]: ../reference.md#smart_emphasis
+
+Example
+-------
+
+```pycon
+>>> import markdown
+>>> markdown.markdown('Text with double__underscore__words.', \
+ extensions=['markdown.extensions.smart_strong'])
+u'<p>Text with double__underscore__words.</p>'
+>>> markdown.markdown('__Strong__ still works.', \
+ extensions=['markdown.extensions.smart_strong'])
+u'<p><strong>Strong</strong> still works.</p>'
+>>> markdown.markdown('__this__works__too__.', \
+ extensions=['markdown.extensions.smart_strong'])
+u'<p><strong>this__works__too</strong>.</p>'
+```
+
+Usage
+-----
+
+See [Extensions](index.md) for general extension usage, specify
+`markdown.extensions.smart_strong` as the name of the extension.
+
+This extension does not accept any special configuration options.
diff --git a/docs/extensions/smart_strong.txt b/docs/extensions/smart_strong.txt
deleted file mode 100644
index e2e5458..0000000
--- a/docs/extensions/smart_strong.txt
+++ /dev/null
@@ -1,41 +0,0 @@
-title: Smart Strong Extension
-prev_title: Tables Extension
-prev_url: tables.html
-next_title: Admonition Extension
-next_url: admonition.html
-
-Smart_Strong
-============
-
-Summary
--------
-
-The Smart_Strong extension adds smarter handling of double underscores within
-words. This does for double underscores what [smart_emphasis][] does for single
-underscores.
-
-The Smart_Strong extension is included in the standard Markdown library.
-
-[smart_emphasis]: ../reference.html#smart_emphasis
-
-Example
--------
-
- >>> import markdown
- >>> markdown.markdown('Text with double__underscore__words.', \
- extensions=['markdown.extensions.smart_strong'])
- u'<p>Text with double__underscore__words.</p>'
- >>> markdown.markdown('__Strong__ still works.', \
- extensions=['markdown.extensions.smart_strong'])
- u'<p><strong>Strong</strong> still works.</p>'
- >>> markdown.markdown('__this__works__too__.', \
- extensions=['markdown.extensions.smart_strong'])
- u'<p><strong>this__works__too</strong>.</p>'
-
-Usage
------
-
-See [Extensions](index.html) for general extension usage, specify `markdown.extensions.smart_strong`
-as the name of the extension.
-
-This extension does not accept any special configuration options.
diff --git a/docs/extensions/smarty.txt b/docs/extensions/smarty.md
index 247658a..8c0d8cc 100644
--- a/docs/extensions/smarty.txt
+++ b/docs/extensions/smarty.md
@@ -1,8 +1,4 @@
title: SmartyPants Extension
-prev_title: Sane Lists Extension
-prev_url: sane_lists.html
-next_title: Table of Contents Extension
-next_url: toc.html
SmartyPants
===========
@@ -23,42 +19,44 @@ ASCII symbol | Replacements | HTML Entities | Substitution Keys
`---` | &mdash; | `&mdash;` | `'mdash'`
Using the configuration option 'substitutions' you can overwrite the
-default substitutions. Just pass a dict mapping (a subset of) the
+default substitutions. Just pass a dict mapping (a subset of) the
keys to the substitution strings.
-
-For example, one might use the following configuration to get correct quotes for
+
+For example, one might use the following configuration to get correct quotes for
the German language:
- extension_configs = {
- 'markdown.extensions.smarty': {
- 'substitutions': {
- 'left-single-quote': '&sbquo;', # sb is not a typo!
- 'right-single-quote': '&lsquo;',
- 'left-double-quote': '&bdquo;',
- 'right-double-quote': '&ldquo;'
- }
+```python
+extension_configs = {
+ 'markdown.extensions.smarty': {
+ 'substitutions': {
+ 'left-single-quote': '&sbquo;', # sb is not a typo!
+ 'right-single-quote': '&lsquo;',
+ 'left-double-quote': '&bdquo;',
+ 'right-double-quote': '&ldquo;'
}
}
+}
+```
!!! note
- This extension re-implements the Python [SmartyPants]
+ This extension re-implements the Python [SmartyPants]
library by integrating it into the markdown parser.
While this does not provide any additional features,
- it does offer a few advantages. Notably, it will not
- try to work on highlighted code blocks (using the
- [CodeHilite] Extension) like the third party library
+ it does offer a few advantages. Notably, it will not
+ try to work on highlighted code blocks (using the
+ [CodeHilite] Extension) like the third party library
has been known to do.
-
+
[SmartyPants]: http://pythonhosted.org/smartypants/
[CodeHilite]: code_hilite.html
Usage
-----
-See [Extensions](index.html) for general extension usage, specify
+See [Extensions](index.md) for general extension usage, specify
`markdown.extensions.smarty` as the name of the extension.
-See the [Library Reference](../reference.html#extensions) for information about
+See the [Library Reference](../reference.md#extensions) for information about
configuring extensions.
The following options are provided to configure the output:
diff --git a/docs/extensions/tables.md b/docs/extensions/tables.md
new file mode 100644
index 0000000..2bea470
--- /dev/null
+++ b/docs/extensions/tables.md
@@ -0,0 +1,58 @@
+title: Tables Extension
+
+Tables
+======
+
+Summary
+-------
+
+The Tables extension adds the ability to create tables in Markdown documents.
+
+This extension is included in the standard Markdown library.
+
+Syntax
+------
+
+Tables are defined using the syntax established in [PHP Markdown Extra][php].
+
+[php]: http://www.michelf.com/projects/php-markdown/extra/#table
+
+Thus, the following text (taken from the above referenced PHP documentation):
+
+```md
+First Header | Second Header
+------------- | -------------
+Content Cell | Content Cell
+Content Cell | Content Cell
+```
+
+will be rendered as:
+
+```html
+<table>
+ <thead>
+ <tr>
+ <th>First Header</th>
+ <th>Second Header</th>
+ </tr>
+ </thead>
+ <tbody>
+ <tr>
+ <td>Content Cell</td>
+ <td>Content Cell</td>
+ </tr>
+ <tr>
+ <td>Content Cell</td>
+ <td>Content Cell</td>
+ </tr>
+ </tbody>
+</table>
+```
+
+Usage
+-----
+
+See [Extensions](index.md) for general extension usage, specify
+`markdown.extensions.tables` as the name of the extension.
+
+This extension does not accept any special configuration options.
diff --git a/docs/extensions/tables.txt b/docs/extensions/tables.txt
deleted file mode 100644
index 759772a..0000000
--- a/docs/extensions/tables.txt
+++ /dev/null
@@ -1,58 +0,0 @@
-title: Tables Extension
-prev_title: Footnotes Extension
-prev_url: footnotes.html
-next_title: Smart Strong Extension
-next_url: smart_strong.html
-
-Tables
-======
-
-Summary
--------
-
-The Tables extension adds the ability to create tables in Markdown documents.
-
-This extension is included in the standard Markdown library.
-
-Syntax
-------
-
-Tables are defined using the syntax established in [PHP Markdown Extra][php].
-
-[php]: http://www.michelf.com/projects/php-markdown/extra/#table
-
-Thus, the following text (taken from the above referenced PHP documentation):
-
- First Header | Second Header
- ------------- | -------------
- Content Cell | Content Cell
- Content Cell | Content Cell
-
-will be rendered as:
-
- <table>
- <thead>
- <tr>
- <th>First Header</th>
- <th>Second Header</th>
- </tr>
- </thead>
- <tbody>
- <tr>
- <td>Content Cell</td>
- <td>Content Cell</td>
- </tr>
- <tr>
- <td>Content Cell</td>
- <td>Content Cell</td>
- </tr>
- </tbody>
- </table>
-
-Usage
------
-
-See [Extensions](index.html) for general extension usage, specify `markdown.extensions.tables`
-as the name of the extension.
-
-This extension does not accept any special configuration options.
diff --git a/docs/extensions/toc.txt b/docs/extensions/toc.md
index 2cd1fa1..a1c583f 100644
--- a/docs/extensions/toc.txt
+++ b/docs/extensions/toc.md
@@ -1,8 +1,4 @@
-title: Table of Contents Extension
-prev_title: SmartyPants Extension
-prev_url: smarty.html
-next_title: WikiLinks Extension
-next_url: wikilinks.html
+title: Table of Contents Extension
Table of Contents
=================
@@ -18,67 +14,78 @@ This extension is included in the standard Markdown library.
Syntax
------
-By default, all headers will automatically have unique `id` attributes
+By default, all headers will automatically have unique `id` attributes
generated based upon the text of the header. Note this example, in which all
three headers would have the same `id`:
- #Header
- #Header
- #Header
+```md
+#Header
+#Header
+#Header
+```
Results in:
- <h1 id="header">Header</h1>
- <h1 id="header_1">Header</h1>
- <h1 id="header_2">Header</h1>
+```html
+<h1 id="header">Header</h1>
+<h1 id="header_1">Header</h1>
+<h1 id="header_2">Header</h1>
+```
Place a marker in the document where you would like the Table of Contents to
appear. Then, a nested list of all the headers in the document will replace the
marker. The marker defaults to `[TOC]` so the following document:
- [TOC]
+```md
+[TOC]
- # Header 1
+# Header 1
- ## Header 2
+## Header 2
+```
would generate the following output:
- <div class="toc">
+```html
+<div class="toc">
+ <ul>
+ <li><a href="#header-1">Header 1</a></li>
<ul>
- <li><a href="#header-1">Header 1</a></li>
- <ul>
- <li><a href="#header-2">Header 2</a></li>
- </ul>
+ <li><a href="#header-2">Header 2</a></li>
</ul>
- </div>
- <h1 id="header-1">Header 1</h1>
- <h1 id="header-2">Header 2</h1>
-
-Regardless of whether a `marker` is found in the document (or disabled), the Table of
-Contents is available as an attribute (`toc`) on the Markdown class. This allows
-one to insert the Table of Contents elsewhere in their page template. For example:
-
- >>> md = markdown.Markdown(extensions=['markdown.extensions.toc'])
- >>> html = md.convert(text)
- >>> page = render_some_template(context={'body': html, 'toc': md.toc})
+ </ul>
+</div>
+<h1 id="header-1">Header 1</h1>
+<h1 id="header-2">Header 2</h1>
+```
+
+Regardless of whether a `marker` is found in the document (or disabled), the
+Table of Contents is available as an attribute (`toc`) on the Markdown class.
+This allows one to insert the Table of Contents elsewhere in their page
+template. For example:
+
+```pycon
+>>> md = markdown.Markdown(extensions=['markdown.extensions.toc'])
+>>> html = md.convert(text)
+>>> page = render_some_template(context={'body': html, 'toc': md.toc})
+```
Usage
-----
-See [Extensions](index.html) for general extension usage, specify `markdown.extensions.toc`
+See [Extensions](index.md) for general extension usage, specify `markdown.extensions.toc`
as the name of the extension.
-See the [Library Reference](../reference.html#extensions) for information about
+See the [Library Reference](../reference.md#extensions) for information about
configuring extensions.
The following options are provided to configure the output:
* **`marker`**:
Text to find and replace with the Table of Contents. Defaults to `[TOC]`.
-
- Set to an empty string to disable searching for a marker, which may save some time,
- especially on long documents.
+
+ Set to an empty string to disable searching for a marker, which may save
+ some time, especially on long documents.
* **`title`**:
Title to insert in the Table of Contents' `<div>`. Defaults to `None`.
@@ -89,18 +96,20 @@ The following options are provided to configure the output:
* **`permalink`**:
Set to `True` or a string to generate permanent links at the end of each header.
Useful with Sphinx style sheets.
-
- When set to `True` the paragraph symbol (&para; or "`&para;`") is used as the link
- text. When set to a string, the provided string is used as the link text.
+
+ When set to `True` the paragraph symbol (&para; or "`&para;`") is used as
+ the link text. When set to a string, the provided string is used as the link
+ text.
* **`baselevel`**:
Base level for headers. Defaults to `1`.
- The `baselevel` setting allows the header levels to be automatically adjusted to
- fit within the hierarchy of your HTML templates. For example, suppose the
- Markdown text for a page should not contain any headers higher than level 3
- (`<h3>`). The following will accomplish that:
+ The `baselevel` setting allows the header levels to be automatically
+ adjusted to fit within the hierarchy of your HTML templates. For example,
+ suppose the Markdown text for a page should not contain any headers higher
+ than level 3 (`<h3>`). The following will accomplish that:
+ :::pycon
>>> text = '''
... #Some Header
... ## Next Level'''
@@ -124,4 +133,4 @@ The following options are provided to configure the output:
The callable must return a string appropriate for use in HTML `id` attributes.
* **`separator`**:
- Word separator. Character which replaces white space in id. Defaults to "`-`". \ No newline at end of file
+ Word separator. Character which replaces white space in id. Defaults to "`-`".
diff --git a/docs/extensions/wikilinks.txt b/docs/extensions/wikilinks.md
index 948b957..a46265a 100644
--- a/docs/extensions/wikilinks.txt
+++ b/docs/extensions/wikilinks.md
@@ -1,14 +1,8 @@
-title: WikiLinks Extension
-prev_title: Table of Contents Extension
-prev_url: toc.html
-next_title: Extension API
-next_url: api.html
+title: WikiLinks Extension
-WikiLinks
-=========
+# WikiLinks
-Summary
--------
+## Summary
The WikiLinks extension adds support for [WikiLinks][]. Specifically, any
``[[bracketed]]`` word is converted to a link.
@@ -17,17 +11,20 @@ This extension is included in the standard Markdown library.
[WikiLinks]: http://en.wikipedia.org/wiki/Wikilink
-Syntax
-------
+## Syntax
A ``[[bracketed]]`` word is any combination of upper or lower case letters,
number, dashes, underscores and spaces surrounded by double brackets. Therefore
- [[Bracketed]]
+```md
+[[Bracketed]]
+```
would produce the following HTML:
- <a href="/Bracketed/" class="wikilink">Bracketed</a>
+```html
+<a href="/Bracketed/" class="wikilink">Bracketed</a>
+```
Note that WikiLinks are automatically assigned `class="wikilink"` making it
easy to style WikiLinks differently from other links on a page if one so
@@ -37,19 +34,22 @@ Also note that when a space is used, the space is converted to an underscore in
the link but left as-is in the label. Perhaps an example would illustrate this
best:
- [[Wiki Link]]
+```md
+[[Wiki Link]]
+```
becomes
- <a href="/Wiki_Link/" class="wikilink">Wiki Link</a>
+```html
+<a href="/Wiki_Link/" class="wikilink">Wiki Link</a>
+```
-Usage
------
+## Usage
-See [Extensions](index.html) for general extension usage, specify `markdown.extensions.wikilinks`
-as the name of the extension.
+See [Extensions](index.md) for general extension usage, specify
+`markdown.extensions.wikilinks` as the name of the extension.
-See the [Library Reference](../reference.html#extensions) for information about
+See the [Library Reference](../reference.md#extensions) for information about
configuring extensions.
The default behavior is to point each link to the document root of the current
@@ -72,46 +72,55 @@ The following options are provided to change the default behavior:
* **`build_url`**: Callable which formats the URL from its parts.
-### Examples ###
+### Examples
For an example, let us suppose links should always point to the sub-directory
`/wiki/` and end with `.html`
- >>> from markdown.extensions.wikilinks import WikiLinkExtension
- >>> html = markdown.markdown(text,
- ... extensions=[WikiLinkExtension(base_url='/wiki/', end_url='.html')]
- ... )
+```pycon
+>>> from markdown.extensions.wikilinks import WikiLinkExtension
+>>> html = markdown.markdown(text,
+... extensions=[WikiLinkExtension(base_url='/wiki/', end_url='.html')]
+... )
+```
The above would result in the following link for `[[WikiLink]]`.
- <a href="/wiki/WikiLink.html" class="wikilink">WikiLink</a>
+```html
+<a href="/wiki/WikiLink.html" class="wikilink">WikiLink</a>
+```
If you want to do more that just alter the base and/or end of the URL, you
could also pass in a callable which must accept three arguments (``label``,
``base``, and ``end``). The callable must return the URL in it's entirety.
- >>> def my_url_builder(label, base, end):
- ... # do stuff
- ... return url
- ...
- >>> html = markdown.markdown(text,
- ... extensions=[WikiLinkExtension(build_url=my_url_builder)],
- ... )
+```pycon
+>>> def my_url_builder(label, base, end):
+... # do stuff
+... return url
+...
+>>> html = markdown.markdown(text,
+... extensions=[WikiLinkExtension(build_url=my_url_builder)],
+... )
+```
The option is also provided to change or remove the class attribute.
- >>> html = markdown.markdown(text,
- ... extensions=[WikiLinkExtension(html_class='myclass')]
- ... )
+```pycon
+>>> html = markdown.markdown(text,
+... extensions=[WikiLinkExtension(html_class='myclass')]
+... )
+```
Would cause all WikiLinks to be assigned to the class `myclass`.
- <a href="/WikiLink/" class="myclass">WikiLink</a>
+```html
+<a href="/WikiLink/" class="myclass">WikiLink</a>
+```
-Using with Meta-Data extension
-------------------------------
+## Using with Meta-Data extension
-The WikiLink extension also supports the [Meta-Data](meta_data.html) extension.
+The WikiLink extension also supports the [Meta-Data](meta_data.md) extension.
Please see the documentation for that extension for specifics. The supported
meta-data keywords are:
@@ -124,12 +133,16 @@ When used, the meta-data will override the settings provided through the
This document:
- wiki_base_url: http://example.com/
- wiki_end_url: .html
- wiki_html_class:
+```md
+wiki_base_url: http://example.com/
+wiki_end_url: .html
+wiki_html_class:
- A [[WikiLink]] in the first paragraph.
+A [[WikiLink]] in the first paragraph.
+```
would result in the following output (notice the blank `wiki_html_class`):
- <p>A <a href="http://example.com/WikiLink.html">WikiLink</a> in the first paragraph.</p>
+```html
+<p>A <a href="http://example.com/WikiLink.html">WikiLink</a> in the first paragraph.</p>
+```
diff --git a/docs/favicon.ico b/docs/favicon.ico
new file mode 100644
index 0000000..c9efc58
--- /dev/null
+++ b/docs/favicon.ico
Binary files differ
diff --git a/docs/index.txt b/docs/index.md
index 92ac2d0..d21b5c5 100644
--- a/docs/index.txt
+++ b/docs/index.md
@@ -1,19 +1,16 @@
-next_url: install.html
-next_title: Installation
-prev_title: Table of Contents
-prev_url: siteindex.html
+title: Python-Markdown
Python-Markdown
===============
-This is a Python implementation of John Gruber's
-[Markdown](http://daringfireball.net/projects/markdown/).
+This is a Python implementation of John Gruber's
+[Markdown](http://daringfireball.net/projects/markdown/).
It is almost completely compliant with the reference implementation,
-though there are a few very minor [differences](#differences). See John's
-[Syntax Documentation](http://daringfireball.net/projects/markdown/syntax)
+though there are a few very minor [differences](#differences). See John's
+[Syntax Documentation](http://daringfireball.net/projects/markdown/syntax)
for the syntax rules.
-See the [installation instructions](install.html) to get started.
+See the [installation instructions](install.md) to get started.
Goals
-----
@@ -21,13 +18,13 @@ Goals
The Python-Markdown project is developed with the following goals in mind:
* Maintain a Python 2 *and* Python 3 library (with an optional CLI wrapper)
- suited to use in web server environments (never raise an exception, never
- write to stdout, etc.) as an implementation of the markdown parser that
+ suited to use in web server environments (never raise an exception, never
+ write to stdout, etc.) as an implementation of the markdown parser that
follows the [syntax rules](http://daringfireball.net/projects/markdown/syntax)
- and the behavior of the original (markdown.pl) implementation as reasonably
- as possible (see [differences](#differences) for a few exceptions).
+ and the behavior of the original (markdown.pl) implementation as reasonably as
+ possible (see [differences](#differences) for a few exceptions).
-* Provide an [Extension API](extensions/api.html) which makes it possible
+* Provide an [Extension API](extensions/api.md) which makes it possible
to change and/or extend the behavior of the parser.
Features
@@ -38,78 +35,77 @@ features:
* __International Input__
- Python-Markdown will accept [input](reference.html#text) in any language
- supported by Unicode including bi-directional text. In fact the test suite
+ Python-Markdown will accept [input](reference.md#text) in any language
+ supported by Unicode including bi-directional text. In fact the test suite
includes documents written in Russian and Arabic.
* __Extensions__
- Various [extensions](extensions/index.html) are provided (including
- [extra](extensions/extra.html)) to change and/or extend the base syntax.
- Additionally, a public [Extension API](extensions/api.html) is available
+ Various [extensions](extensions/index.md) are provided (including
+ [extra](extensions/extra.md)) to change and/or extend the base syntax.
+ Additionally, a public [Extension API](extensions/api.md) is available
to write your own extensions.
* __Output Formats__
- Python-Markdown can output documents in HTML4, XHTML and HTML5. See the
- [Library Reference](reference.html#output_format) for details.
+ Python-Markdown can output documents with either HTML or XHTML styel tags.
+ See the [Library Reference](reference.md#output_format) for details.
* __Command Line Interface__
- In addition to being a Python Library, a
- [command line script](cli.html) is available for your convenience.
+ In addition to being a Python Library, a
+ [command line script](cli.md) is available for your convenience.
Differences
-----------
-While Python-Markdown strives to fully implement markdown as described in the
-[syntax rules](http://daringfireball.net/projects/markdown/syntax), the rules
-can be interpreted in different ways and different implementations
-occasionally vary in their behavior (see the
+While Python-Markdown strives to fully implement markdown as described in the
+[syntax rules](http://daringfireball.net/projects/markdown/syntax), the rules
+can be interpreted in different ways and different implementations
+occasionally vary in their behavior (see the
[Babelmark FAQ](http://johnmacfarlane.net/babelmark2/faq.html#what-are-some-examples-of-interesting-divergences-between-implementations)
-for some examples). Known and intentional differences found in Python-Markdown
+for some examples). Known and intentional differences found in Python-Markdown
are summarized below:
* __Middle-Word Emphasis__
Python-Markdown defaults to ignoring middle-word emphasis. In other words,
`some_long_filename.txt` will not become `some<em>long</em>filename.txt`.
- This can be switched off if desired. See the
- [Library Reference](reference.html#smart_emphasis) for details.
+ This can be switched off if desired. See the
+ [Library Reference](reference.md#smart_emphasis) for details.
* __Indentation/Tab Length__
- The [syntax rules](http://daringfireball.net/projects/markdown/syntax#list)
- clearly state that when a list item consists of multiple paragraphs, "each
- subsequent paragraph in a list item **must** be indented by either 4 spaces
- or one tab" (emphasis added). However, many implementations do not enforce
- this rule and allow less than 4 spaces of indentation. The implementers of
- Python-Markdown consider it a bug to not enforce this rule.
+ The [syntax rules](http://daringfireball.net/projects/markdown/syntax#list)
+ clearly state that when a list item consists of multiple paragraphs, "each
+ subsequent paragraph in a list item **must** be indented by either 4 spaces
+ or one tab" (emphasis added). However, many implementations do not enforce
+ this rule and allow less than 4 spaces of indentation. The implementers of
+ Python-Markdown consider it a bug to not enforce this rule.
This applies to any block level elements nested in a list, including
- paragraphs, sub-lists, blockquotes, code blocks, etc. They **must** always
+ paragraphs, sub-lists, blockquotes, code blocks, etc. They **must** always
be indented by at least four spaces (or one tab) for each level of nesting.
In the event that one would prefer different behavior,
- [tab_length](reference.html#tab_length) can be set to whatever length is
- desired. Be warned however, as this will affect indentation for all aspects
+ [tab_length](reference.md#tab_length) can be set to whatever length is
+ desired. Be warned however, as this will affect indentation for all aspects
of the syntax (including root level code blocks).
* __Consecutive Lists__
- While the syntax rules are not clear on this, many implementations (including
+ While the syntax rules are not clear on this, many implementations (including
the original) do not end one list and start a second list when the list marker
- (asterisks, pluses, hyphens, and numbers) changes. For consistency,
- Python-Markdown maintains the same behavior with no plans to change in the
- foreseeable future. That said, the [Sane List Extension](extensions/sane_lists.html)
+ (asterisks, pluses, hyphens, and numbers) changes. For consistency,
+ Python-Markdown maintains the same behavior with no plans to change in the
+ foreseeable future. That said, the [Sane List Extension](extensions/sane_lists.md)
is available to provide a less surprising behavior.
-
Support
-------
-You may ask for help and discuss various other issues on the [mailing list][]
+You may ask for help and discuss various other issues on the [mailing list][]
and report bugs on the [bug tracker][].
[mailing list]: http://lists.sourceforge.net/lists/listinfo/python-markdown-discuss
-[bug tracker]: http://github.com/Python-Markdown/markdown/issues
+[bug tracker]: http://github.com/Python-Markdown/markdown/issues
diff --git a/docs/install.txt b/docs/install.md
index c01c3b4..d799797 100644
--- a/docs/install.txt
+++ b/docs/install.md
@@ -1,8 +1,4 @@
title: Installation
-prev_title: Summary
-prev_url: index.html
-next_title: Library Reference
-next_url: reference.html
Installing Python-Markdown
==========================
@@ -10,21 +6,25 @@ Installing Python-Markdown
The Easy Way
------------
-The easiest way to install Python-Markdown is simply to type one of the
+The easiest way to install Python-Markdown is simply to type one of the
following commands from the command line as an Admin/Root user:
- pip install markdown
+```bash
+pip install markdown
+```
or
- easy_install markdown
+```bash
+easy_install markdown
+```
-That's it! You're ready to [use](reference.html) Python-Markdown. Enjoy!
+That's it! You're ready to [use](reference.md) Python-Markdown. Enjoy!
Installing on Windows {: #windows }
-----------------------------------
-Download the Windows installer (`.exe`) from
+Download the Windows installer (`.exe`) from
[PyPI](http://pypi.python.org/pypi/Markdown)
Double-click the file and follow the instructions.
@@ -33,35 +33,41 @@ If you prefer to manually install Python-Markdown in Windows, download the
Zip file, unzip it, and on the command line in the directory you unzipped to,
run the following command:
- C://path/to/python.exe setup.py install
+```text
+C://path/to/python.exe setup.py install
+```
If you plan to use the provided command line script, you need to make sure your
script directory is on your system path. On a typical Python install of Windows
the Scripts directory is `C:\PythonXX\Scripts\` (were "XX" is the Python version
-number, i.e., "27"). Adjust the path according to your system and add to your
+number, i.e., "27"). Adjust the path according to your system and add to your
system path.
-Installing on *nix Systems {: #linux }
---------------------------------------
+Installing on \*nix Systems {: #linux }
+---------------------------------------
From the command line do the following (where 2.x is the version number):
- wget http://pypi.python.org/packages/source/M/Markdown/Markdown-2.x.tar.gz
- tar xvzf Markdown-2.x.tar.gz
- cd markdown-2.x/
- sudo python setup.py install
+```bash
+wget http://pypi.python.org/packages/source/M/Markdown/Markdown-2.x.tar.gz
+tar xvzf Markdown-2.x.tar.gz
+cd markdown-2.x/
+sudo python setup.py install
+```
See [PyPI](http://pypi.python.org/pypi/Markdown) for all available versions.
Using the Git Repository {: #git }
----------------------------------
-If you're the type that likes to live on the edge, you may want to keep up with
+If you're the type that likes to live on the edge, you may want to keep up with
the latest additions and bug fixes in the repository between releases.
Python-Markdown is maintained in a Git repository on GitHub.com. To
get a copy of Python-Markdown from the repository do the following from the
command line:
- git clone git://github.com/Python-Markdown/markdown.git python-markdown
- cd python-markdown
- python setup.py install
+```bash
+git clone git://github.com/Python-Markdown/markdown.git python-markdown
+cd python-markdown
+python setup.py install
+```
diff --git a/docs/reference.txt b/docs/reference.md
index b65f2dd..7e5a30a 100644
--- a/docs/reference.txt
+++ b/docs/reference.md
@@ -1,133 +1,139 @@
-title: Library Reference
-prev_title: Installation
-prev_url: install.html
-next_title: Command Line
-next_url: cli.html
+title: Library Reference
-
-Using Markdown as a Python Library
-==================================
+# Using Markdown as a Python Library
First and foremost, Python-Markdown is intended to be a python library module
used by various projects to convert Markdown syntax into HTML.
-The Basics
-----------
+## The Basics
To use markdown as a module:
- import markdown
- html = markdown.markdown(your_text_string)
+```python
+import markdown
+html = markdown.markdown(your_text_string)
+```
-The Details
------------
+## The Details
Python-Markdown provides two public functions ([`markdown.markdown`](#markdown)
-and [`markdown.markdownFromFile`](#markdownFromFile)) both of which wrap the
-public class [`markdown.Markdown`](#Markdown). If you're processing one
+and [`markdown.markdownFromFile`](#markdownFromFile)) both of which wrap the
+public class [`markdown.Markdown`](#Markdown). If you're processing one
document at a time, these functions will serve your needs. However, if you need
-to process multiple documents, it may be advantageous to create a single
-instance of the `markdown.Markdown` class and pass multiple documents through
+to process multiple documents, it may be advantageous to create a single
+instance of the `markdown.Markdown` class and pass multiple documents through
it. If you do use a single instance though, make sure to call the `reset`
method appropriately ([see below](#convert)).
-### `markdown.markdown (text [, **kwargs])` {: #markdown }
+### markdown.markdown(text [, **kwargs]) {: #markdown }
The following options are available on the `markdown.markdown` function:
-* __`text`__{: #text } (required): The source Unicode string.
+__text__{: #text }
+
+: The source Unicode string. (required)
!!! note "Important"
Python-Markdown expects **Unicode** as input (although
some simple ASCII strings *may* work) and returns output as Unicode.
- Do not pass encoded strings to it! If your input is encoded, (e.g. as
+ Do not pass encoded strings to it! If your input is encoded, (e.g. as
UTF-8), it is your responsibility to decode it. For example:
+ :::python
input_file = codecs.open("some_file.txt", mode="r", encoding="utf-8")
text = input_file.read()
html = markdown.markdown(text)
If you want to write the output to disk, you *must* encode it yourself:
- output_file = codecs.open("some_file.html", "w",
- encoding="utf-8",
+ :::python
+ output_file = codecs.open("some_file.html", "w",
+ encoding="utf-8",
errors="xmlcharrefreplace"
)
output_file.write(html)
-* __`extensions`__{: #extensions }: A list of extensions.
+__extensions__{: #extensions }
+
+: A list of extensions.
- Python-Markdown provides an [API](extensions/api.html) for third parties to
+ Python-Markdown provides an [API](extensions/api.md) for third parties to
write extensions to the parser adding their own additions or changes to the
- syntax. A few commonly used extensions are shipped with the markdown
- library. See the [extension documentation](extensions/index.html) for a
+ syntax. A few commonly used extensions are shipped with the markdown
+ library. See the [extension documentation](extensions/index.md) for a
list of available extensions.
- The list of extensions may contain instances of extensions and/or strings
- of extension names.
+ The list of extensions may contain instances of extensions and/or strings
+ of extension names.
+ :::python
extensions=[MyExtension(), 'path.to.my.ext']
-
+
!!! note
The preferred method is to pass in an instance of an extension. Strings
- should only be used when it is impossible to import the Extension Class
- directly (from the command line or in a template).
-
+ should only be used when it is impossible to import the Extension Class
+ directly (from the command line or in a template).
+
When passing in extension instances, each class instance must be a subclass
- of `markdown.extensions.Extension` and any configuration options should be
- defined when initiating the class instance rather than using the
+ of `markdown.extensions.Extension` and any configuration options should be
+ defined when initiating the class instance rather than using the
[`extension_configs`](#extension_configs) keyword. For example:
+ :::python
from markdown.extensions import Extension
class MyExtension(Extension):
# define your extension here...
-
+
markdown.markdown(text, extensions=[MyExtension(option='value')])
- If an extension name is provided as a string, the extension must be
- importable as a python module on your PYTHONPATH. Python's dot notation is
- supported. Therefore, to import the 'extra' extension, one could do
- `extensions=['markdown.extensions.extra']`
+ If an extension name is provided as a string, the extension must be
+ importable as a python module on your PYTHONPATH. Python's dot notation is
+ supported. Therefore, to import the 'extra' extension, one could do
+ `extensions=['markdown.extensions.extra']`
+
+ Additionally, a Class may be specified in the name. The class must be at the
+ end of the name and be separated by a colon from the module.
- Additionally, a Class may be specified in the name. The class must be at the end of
- the name and be separated by a colon from the module.
+ Therefore, if you were to import the class like this:
- Therefore, if you were to import the class like this:
-
- from path.to.module import SomeExtensionClass
+ :::python
+ from path.to.module import SomeExtensionClass
- Then the named extension would comprise this string:
+ Then the named extension would comprise this string:
- "path.to.module:SomeExtensionClass"
+ :::python
+ "path.to.module:SomeExtensionClass"
- !!! note
- You should only need to specify the class name if more than one extension
- is defined within the same module. The extensions that come with
- Python-Markdown do *not* need to have the class name specified. However,
- doing so will not effect the behavior of the parser.
+ !!! note
+ You should only need to specify the class name if more than one extension
+ is defined within the same module. The extensions that come with
+ Python-Markdown do *not* need to have the class name specified. However,
+ doing so will not effect the behavior of the parser.
When loading an extension by name (as a string), you may pass in
- configuration settings to the extension using the
+ configuration settings to the extension using the
[`extension_configs`](#extension_configs) keyword.
!!! seealso "See Also"
- See the documentation of the [Extension API](extensions/api.html) for
+ See the documentation of the [Extension API](extensions/api.md) for
assistance in creating extensions.
-* __`extension_configs`__{: #extension_configs }: A dictionary of
- configuration settings for extensions.
+__extension_configs__{: #extension_configs }
+
+: A dictionary of configuration settings for extensions.
+
+ Any configuration settings will only be passed to extensions loaded by name
+ (as a string). When loading extensions as class instances, pass the
+ configuration settings directly to the class when initializing it.
- Any configuration settings will only be passed to extensions loaded by name
- (as a string). When loading extensions as class instances, pass the
- configuration settings directly to the class when initializing it.
-
!!! Note
The preferred method is to pass in an instance of an extension, which
does not require use of the `extension_configs` keyword at all.
See the [extensions](#extensions) keyword for details.
-
+
The dictionary of configuration settings must be in the following format:
+ :::python
extension_configs = {
'extension_name_1': {
'option_1': 'value_1',
@@ -138,10 +144,12 @@ The following options are available on the `markdown.markdown` function:
}
}
- See the documentation specific to the extension you are using for help in
+ See the documentation specific to the extension you are using for help in
specifying configuration settings for that extension.
-* __`output_format`__{: #output_format }: Format of output.
+__output_format__{: #output_format }:
+
+: Format of output.
Supported formats are:
@@ -155,108 +163,132 @@ The following options are available on the `markdown.markdown` function:
The values can be in either lowercase or uppercase.
!!! warning
- It is suggested that the more specific formats (`"xhtml1"`, `"html5"`, &
- `"html4"`) be used as the more general formats (`"xhtml"` or `"html"`) may
- change in the future if it makes sense at that time.
+ It is suggested that the more specific formats (`"xhtml1"`, `"html5"`, &
+ `"html4"`) be used as the more general formats (`"xhtml"` or `"html"`) may
+ change in the future if it makes sense at that time.
-* __`safe_mode`__{: #safe_mode }: Disallow raw HTML.
+__safe_mode__{: #safe_mode }:
+
+: Disallow raw HTML.
!!! warning
"`safe_mode`" is deprecated and should not be used.
- HTML sanitizers (like [Bleach]) provide a better solution for
- dealing with markdown text submitted by untrusted users.
+ HTML sanitizers (like [Bleach]) provide a better solution for
+ dealing with markdown text submitted by untrusted users.
+ :::python
import markdown
import bleach
html = bleach.clean(markdown.markdown(untrusted_text))
See the [release notes] for more info.
-
-[Bleach]: https://github.com/jsocol/bleach
-[release notes]: release-2.6.html
-
+
The following values are accepted:
- * `False` (Default): Raw HTML is passed through unaltered.
+ `False` (Default):
+
+ : Raw HTML is passed through unaltered.
- * `replace`: Replace all HTML blocks with the text assigned to
- `html_replacement_text` To maintain backward compatibility, setting
- `safe_mode=True` will have the same effect as `safe_mode='replace'`.
+ `replace`:
+
+ : Replace all HTML blocks with the text assigned to
+ `html_replacement_text`. To maintain backward compatibility, setting
+ `safe_mode=True` will have the same effect as `safe_mode='replace'`.
To replace raw HTML with something other than the default, do:
- md = markdown.Markdown(safe_mode='replace',
- html_replacement_text='--RAW HTML NOT ALLOWED--')
+ :::python
+ md = markdown.Markdown(
+ safe_mode='replace',
+ html_replacement_text='--RAW HTML NOT ALLOWED--'
+ )
+
+ `remove`:
- * `remove`: All raw HTML will be completely stripped from the text with
+ : All raw HTML will be completely stripped from the text with
no warning to the author.
- * `escape`: All raw HTML will be escaped and included in the document.
+ `escape`:
+
+ : All raw HTML will be escaped and included in the document.
For example, the following source:
+ :::md
Foo <b>bar</b>.
Will result in the following HTML:
+ :::html
<p>Foo &lt;b&gt;bar&lt;/b&gt;.</p>
- !!! Note
- "safe_mode" also alters the default value for the
+ !!! Note
+ "safe_mode" also alters the default value for the
[`enable_attributes`](#enable_attributes) option.
-
-* __`html_replacement_text`__{: #html_replacement_text }: Text used when
- safe_mode is set to `replace`. Defaults to `[HTML_REMOVED]`.
+[Bleach]: https://github.com/jsocol/bleach
+[release notes]: change_log/release-2.6.md
+
+__html_replacement_text__{: #html_replacement_text }:
+
+: Text used when safe_mode is set to `replace`. Defaults to `[HTML_REMOVED]`.
!!! warning
"`html_replacement_text`" is deprecated and should not be used.
See the [release notes] for more info.
-* __`tab_length`__{: #tab_length }: Length of tabs in the source. Default: 4
+__tab_length__{: #tab_length }:
+
+: Length of tabs in the source. Default: 4
-* __`enable_attributes`__{: #enable_attributes}: Enable the conversion of
- attributes. Defaults to `True`, unless [`safe_mode`](#safe_mode) is enabled,
- in which case the default is `False`.
+__enable_attributes__{: #enable_attributes}:
- !!! Note
- `safe_mode` only overrides the default. If `enable_attributes`
+: Enable the conversion of attributes. Defaults to `True`, unless
+ [`safe_mode`](#safe_mode) is enabled, in which case the default is `False`.
+
+ !!! Note
+ `safe_mode` only overrides the default. If `enable_attributes`
is explicitly set, the explicit value is used regardless of `safe_mode`.
However, this could potentially allow an untrusted user to inject
JavaScript into your documents.
-* __`smart_emphasis`__{: #smart_emphasis }: Treat `_connected_words_`
- intelligently Default: True
+__smart_emphasis__{: #smart_emphasis }:
-* __`lazy_ol`__{: #lazy_ol }: Ignore number of first item of ordered lists.
- Default: True
+: Treat `_connected_words_` intelligently Default: True
+
+__lazy_ol__{: #lazy_ol }:
+
+: Ignore number of first item of ordered lists. Default: True
Given the following list:
+ :::md
4. Apples
5. Oranges
6. Pears
- By default markdown will ignore the fact the the first line started
+ By default markdown will ignore the fact the the first line started
with item number "4" and the HTML list will start with a number "1".
If `lazy_ol` is set to `False`, then markdown will output the following
HTML:
+ :::html
<ol start="4">
<li>Apples</li>
<li>Oranges</li>
<li>Pears</li>
</ol>
-
### `markdown.markdownFromFile (**kwargs)` {: #markdownFromFile }
-With a few exceptions, `markdown.markdownFromFile` accepts the same options as
-`markdown.markdown`. It does **not** accept a `text` (or Unicode) string.
+With a few exceptions, `markdown.markdownFromFile` accepts the same options as
+`markdown.markdown`. It does **not** accept a `text` (or Unicode) string.
Instead, it accepts the following required options:
-* __`input`__{: #input } (required): The source text file.
+__input__{: #input } (required)
+
+: The source text file.
`input` may be set to one of three options:
@@ -264,7 +296,9 @@ Instead, it accepts the following required options:
* a readable file-like object,
* or `None` (default) which will read from `stdin`.
-* __`output`__{: #output }: The target which output is written to.
+__output__{: #output }
+
+: The target which output is written to.
`output` may be set to one of three options:
@@ -272,54 +306,62 @@ Instead, it accepts the following required options:
* a writable file-like object,
* or `None` (default) which will write to `stdout`.
-* __`encoding`__{: #encoding }: The encoding of the source text file. Defaults
- to `"utf-8"`. The same encoding will always be used for input and output.
- The `xmlcharrefreplace` error handler is used when encoding the output.
+__encoding__{: #encoding }
- !!! Note
+: The encoding of the source text file.
+
+ Defaults to `"utf-8"`. The same encoding will always be used for input and output.
+ The `xmlcharrefreplace` error handler is used when encoding the output.
+
+ !!! Note
This is the only place that decoding and encoding of Unicode
takes place in Python-Markdown. If this rather naive solution does not
meet your specific needs, it is suggested that you write your own code
to handle your encoding/decoding needs.
-### `markdown.Markdown ([**kwargs])` {: #Markdown }
+### markdown.Markdown([**kwargs]) {: #Markdown }
The same options are available when initializing the `markdown.Markdown` class
as on the [`markdown.markdown`](#markdown) function, except that the class does
**not** accept a source text string on initialization. Rather, the source text
string must be passed to one of two instance methods:
-* `Markdown.convert(source)`{: #convert }
+#### Markdown.convert(source) {: #convert }
+
+The `source` text must meet the same requirements as the [`text`](#text)
+argument of the [`markdown.markdown`](#markdown) function.
- The `source` text must meet the same requirements as the [`text`](#text)
- argument of the [`markdown.markdown`](#markdown) function.
+You should also use this method if you want to process multiple strings
+without creating a new instance of the class for each string.
- You should also use this method if you want to process multiple strings
- without creating a new instance of the class for each string.
+```python
+md = markdown.Markdown()
+html1 = md.convert(text1)
+html2 = md.convert(text2)
+```
- md = markdown.Markdown()
- html1 = md.convert(text1)
- html2 = md.convert(text2)
+Depending on which options and/or extensions are being used, the parser may
+need its state reset between each call to `convert`, otherwise performance
+can degrade drastically:
- Depending on which options and/or extensions are being used, the parser may
- need its state reset between each call to `convert`, otherwise performance
- can degrade drastically:
+```python
+html1 = md.convert(text1)
+md.reset()
+html2 = md.convert(text2)
+```
- html1 = md.convert(text1)
- md.reset()
- html2 = md.convert(text2)
-
- To make this easier, you can also chain calls to `reset` together:
-
- html3 = md.reset().convert(text3)
+To make this easier, you can also chain calls to `reset` together:
+```python
+html3 = md.reset().convert(text3)
+```
-* `Markdown.convertFile(**kwargs)`{: #convertFile }
+#### Markdown.convertFile(**kwargs) {: #convertFile }
- The arguments of this method are identical to the arguments of the same
- name on the `markdown.markdownFromFile` function ([`input`](#input),
- [`output`](#output), and [`encoding`](#encoding)). As with the
- [`convert`](#convert) method, this method should be used to
- process multiple files without creating a new instance of the class for
- each document. State may need to be `reset` between each call to
- `convertFile` as is the case with `convert`.
+The arguments of this method are identical to the arguments of the same
+name on the `markdown.markdownFromFile` function ([`input`](#input),
+[`output`](#output), and [`encoding`](#encoding)). As with the
+[`convert`](#convert) method, this method should be used to
+process multiple files without creating a new instance of the class for
+each document. State may need to be `reset` between each call to
+`convertFile` as is the case with `convert`.
diff --git a/docs/release-2.0.1.txt b/docs/release-2.0.1.txt
deleted file mode 100644
index c0b890a..0000000
--- a/docs/release-2.0.1.txt
+++ /dev/null
@@ -1,22 +0,0 @@
-title: Release Notes for v2.0.1
-prev_title: Release Notes for v2.0.2
-prev_url: release-2.0.2.html
-next_title: Release Notes for v2.0
-next_url: release-2.0.html
-
-Python-Markdown 2.0.1 Release Notes
-===================================
-
-Python-Markdown 2.0.1 is a bug-fix release. No new features have been added.
-Most notably, various issues with the command line script have been fixed.
-There have also been a few fixes for minor parsing bugs in some edge cases.
-For a full list of changes, see the git log.
-
-Backwards-incompatible Changes
-------------------------------
-
-Due to various complications in how Python handles command line scripts in
-difference systems and with different installation tools, we were forced to
-rename the command line script to `markdown` (no `.py`). A matching batch
-script will get installed on Windows. Any shell scripts which call
-`markdown.py` will need to be altered to call `markdown` instead.
diff --git a/docs/release-2.0.2.txt b/docs/release-2.0.2.txt
deleted file mode 100644
index 5315c80..0000000
--- a/docs/release-2.0.2.txt
+++ /dev/null
@@ -1,15 +0,0 @@
-title: Release Notes for v2.0.2
-prev_title: Release Notes for v2.1.0
-prev_url: release-2.1.0.html
-next_title: Release Notes for v2.0.1
-next_url: release-2.0.1.html
-
-Python-Markdown 2.0.2 Release Notes
-===================================
-
-Python-Markdown 2.0.2 is a bug-fix release. No new features have been added.
-Most notably, the setup script has been updated to include a dependency on
-ElementTree on older versions of Python (< 2.5). There have also been a few
-fixes for minor parsing bugs in some edge cases. For a full list of changes,
-see the git log.
-
diff --git a/docs/release-2.1.1.txt b/docs/release-2.1.1.txt
deleted file mode 100644
index 59caf68..0000000
--- a/docs/release-2.1.1.txt
+++ /dev/null
@@ -1,13 +0,0 @@
-title: Release Notes for v2.1.1
-prev_title: Release Notes for v2.2.0
-prev_url: release-2.2.0.html
-next_title: Release Notes for v2.1.0
-next_url: release-2.1.0.html
-
-Python-Markdown 2.1.1 Release Notes
-===================================
-
-Python-Markdown 2.1.1 is a bug-fix release. No new features have been added.
-Most notably, a bug which caused raw HTML paring to run __very__ slowly has
-been fixed along with a few bugs which caused the parser to raise exceptions
-while parsing. For a full list of changes, see the git log.
diff --git a/docs/release-2.2.1.txt b/docs/release-2.2.1.txt
deleted file mode 100644
index fe27c71..0000000
--- a/docs/release-2.2.1.txt
+++ /dev/null
@@ -1,12 +0,0 @@
-title: Release Notes for v2.2.1
-prev_title: Release Notes for v2.3
-prev_url: release-2.3.html
-next_title: Release Notes for v2.2.0
-next_url: release-2.2.0.html
-
-Python-Markdown 2.2.1 Release Notes
-===================================
-
-Python-Markdown 2.2.1 is a bug-fix release. No new features have been added.
-However, at least one bug fix does not work in Python 2.4 so that version of
-Python is no longer supported. For a full list of changes, see the git log.
diff --git a/docs/release-2.3.txt b/docs/release-2.3.txt
deleted file mode 100644
index 81c5d88..0000000
--- a/docs/release-2.3.txt
+++ /dev/null
@@ -1,88 +0,0 @@
-title: Release Notes for v2.3
-prev_title: Release Notes for v2.4
-prev_url: release-2.4.html
-next_title: Release Notes for v2.2.1
-next_url: release-2.2.1.html
-
-Python-Markdown 2.3 Release Notes
-=================================
-
-We are pleased to release Python-Markdown 2.3 which adds one new extension,
-removes a few old (obsolete) extensions, and now runs on both Python 2 and
-Python 3 without running the 2to3 conversion tool. See the list of changes
-below for details.
-
-Python-Markdown supports Python versions 2.6, 2.7, 3.1, 3.2, and 3.3.
-
-Backwards-incompatible Changes
-------------------------------
-
-* Support has been dropped for Python 2.5. No guarantees are made that the
-library will work in any version of Python lower than 2.6. As all supported
-Python versions include the ElementTree library, Python-Markdown will no
-longer try to import a third-party installation of ElementTree.
-
-* All classes are now "new-style" classes. In other words, all classes
-subclass from 'object'. While this is not likely to affect most users,
-extension authors may need to make a few minor adjustments to their code.
-
-* "safe_mode" has been further restricted. Markdown formatted links must be
-of a known white-listed scheme when in "safe_mode" or the URL is discarded.
-The white-listed schemes are: 'HTTP', 'HTTPS', 'FTP', 'FTPS', 'MAILTO', and
-'news'. Schemeless URLs are also permitted, but are checked in other ways -
-as they have been for some time.
-
-* The ids assigned to footnotes now contain a dash (`-`) rather than a colon
-(`:`) when `output_format` it set to `"html5"` or `"xhtml5"`. If you are making
-reference to those ids in your JavaScript or CSS and using the HTML5 output,
-you will need to update your code accordingly. No changes are necessary if
-you are outputting XHTML (the default) or HTML4.
-
-* The `force_linenos` configuration setting of the CodeHilite extension has been
-marked as **Pending Deprecation** and a new setting `linenums` has been added to
-replace it. See documentation for the [CodeHilite Extension] for an explanation
-of the new `linenums` setting. The new setting will honor the old
-`force_linenos` if it is set, but it will raise a `PendingDeprecationWarning`
-and will likely be removed in a future version of Python-Markdown.
-
-[CodeHilite Extension]: extensions/codehilite.html
-
-* The "RSS" extension has been removed and no longer ships with Python-Markdown.
-If you would like to continue using the extension (not recommended), it is
-archived on [GitHub](https://gist.github.com/waylan/4773365).
-
-* The "HTML Tidy" Extension has been removed and no longer ships with Python-Markdown.
-If you would like to continue using the extension (not recommended), it is
-archived on [GitHub](https://gist.github.com/waylan/5152650). Note that the
-underlying library, uTidylib, is not Python 3 compatible. Instead, it is
-recommended that the newer [PyTidyLib] (version 0.2.2+ for Python 3
-comparability - install from GitHub not PyPI) be used. As the API for that
-library is rather simple, it is recommended that the output of Markdown be
-wrapped in a call to PyTidyLib rather than using an extension (for example:
-`tidylib.tidy_fragment(markdown.markdown(source), options={...})`).
-
-[PyTidyLib]: http://countergram.com/open-source/pytidylib
-
-What's New in Python-Markdown 2.3
----------------------------------
-
-* The entire code base now universally runs in Python 2 and Python 3 without
-any need for running the 2to3 conversion tool. This not only simplifies testing,
-but by using Unicode_literals, results in more consistent behavior across
-Python versions. Additionally, the relative imports (made possible in Python 2
-via absolute_import) allows the entire library to more easily be embedded in a
-sub-directory of another project. The various files within the library will
-still import each other properly even though 'markdown' may not be in Python's
-root namespace.
-
-* The [Admonition Extension] has been added, which implements [rST-style][rST]
-admonitions in the Markdown syntax. However, be warned that this extension
-is experimental and the syntax and behavior is still subject to change. Please
-try it out and report bugs and/or improvements.
-
-[Admonition Extension]: extensions/admonition.html
-[rST]: http://docutils.sourceforge.net/docs/ref/rst/directives.html#specific-admonitions
-
-* Various bug fixes have been made. See the
-[commit log](https://github.com/Python-Markdown/markdown/commits/master)
-for a complete history of the changes.
diff --git a/docs/release-2.4.txt b/docs/release-2.4.txt
deleted file mode 100644
index f1d00af..0000000
--- a/docs/release-2.4.txt
+++ /dev/null
@@ -1,77 +0,0 @@
-title: Release Notes for v2.4
-prev_title: Release Notes for v2.5
-prev_url: release-2.5.html
-next_title: Release Notes for v2.3
-next_url: release-2.3.html
-
-Python-Markdown 2.4 Release Notes
-=================================
-
-We are pleased to release Python-Markdown 2.4 which adds one new extension
-and fixes various bugs. See the list of changes below for details.
-
-Python-Markdown supports Python versions 2.6, 2.7, 3.1, 3.2, and 3.3.
-
-Backwards-incompatible Changes
-------------------------------
-
-* The `force_linenos` configuration setting of the CodeHilite extension has been
-marked as **Deprecated**. It had previously been marked as "Pending Deprecation"
-in version 2.3 when a new setting `linenums` was added to replace it. See
-documentation for the [CodeHilite Extension] for an explanation of the new
-`linenums` setting. The new setting will honor the old `force_linenos` if it
-is set, but `force_linenos` will raise a `DeprecationWarning` and will likely
-be removed in a future version of Python-Markdown.
-
-[CodeHilite Extension]: extensions/code_hilite.html
-
-* URLs are no longer percent-encoded. This improves compatibility with the
-original (written in Perl) Markdown implementation. Please percent-encode
-your URLs manually when needed.
-
-What's New in Python-Markdown 2.4
----------------------------------
-
-* Thanks to the hard work of [Dmitry Shachnev] the [Smarty Extension] has been
-added, which implements [SmartyPants] using Python-Markdown's Extension API.
-This offers a few benefits over a third party script. The HTML does not need
-to be "tokenized" twice, no hacks are required to combine SmartyPants and
-code highlighting, and we get markdown's escaping feature for free. Please try
-it out and report bugs and/or improvements.
-
-[Dmitry Shachnev]: https://github.com/mitya57
-[Smarty Extension]: extensions/smarty.html
-[SmartyPants]: http://daringfireball.net/projects/smartypants/
-
-* The [Table of Contents Extension] now supports new `permalink` option
-for creating [Sphinx]-style anchor links.
-
-[Table of Contents Extension]: extensions/toc.html
-[Sphinx]: http://sphinx-doc.org/
-
-* It is now possible to enable Markdown formatting inside HTML blocks by
-appending `markdown=1` to opening tag attributes. See [Markdown Inside HTML
-Blocks] section for details. Thanks to [ryneeverett] for implementing this
-feature.
-
-[Markdown Inside HTML Blocks]: extensions/extra.html#nested-markdown-inside-html-blocks
-[ryneeverett]: https://github.com/ryneeverett
-
-* The code blocks now support emphasizing some of the code lines. To use this
-feature, specify `hl_lines` option after language name, for example (using
-the [Fenced Code Extension]):
-
- ```.python hl_lines="1 3"
- # This line will be emphasized.
- # This one won't.
- # This one will be also emphasized.
- ```
-
- Thanks to [A. Jesse Jiryu Davis] for implementing this feature.
-
-[Fenced Code Extension]: extensions/fenced_code_blocks.html
-[A. Jesse Jiryu Davis]: https://github.com/ajdavis
-
-* Various bug fixes have been made. See the
-[commit log](https://github.com/Python-Markdown/markdown/commits/master)
-for a complete history of the changes.
diff --git a/docs/release-2.5.txt b/docs/release-2.5.txt
deleted file mode 100644
index 7cde02f..0000000
--- a/docs/release-2.5.txt
+++ /dev/null
@@ -1,187 +0,0 @@
-title: Release Notes for v2.5
-prev_title: Release Notes for v2.6
-prev_url: release-2.6.html
-next_title: Release Notes for v2.4
-next_url: release-2.4.html
-
-Python-Markdown 2.5 Release Notes
-=================================
-
-We are pleased to release Python-Markdown 2.5 which adds a few new features
-and fixes various bugs. See the list of changes below for details.
-
-Python-Markdown version 2.5 supports Python versions 2.7, 3.2, 3.3, and 3.4.
-
-Backwards-incompatible Changes
-------------------------------
-
-* Python-Markdown no longer supports Python version 2.6. You must be using Python
- versions 2.7, 3.2, 3.3, or 3.4.
-
-[importlib]: https://pypi.python.org/pypi/importlib
-
-* The `force_linenos` configuration key on the [CodeHilite Extension] has been **deprecated**
- and will raise a `KeyError` if provided. In the previous release (2.4), it was
- issuing a `DeprecationWarning`. The [`linenums`][linenums] keyword should be used
- instead, which provides more control of the output.
-
-[CodeHilite Extension]: extensions/code_hilite.html
-[linenums]: extensions/code_hilite.html#usage
-
-* Both `safe_mode` and the associated `html_replacement_text` keywords will be deprecated
- in version 2.6 and will raise a **`PendingDeprecationWarning`** in 2.5. The so-called
- "safe mode" was never actually "safe" which has resulted in many people having a false
- sense of security when using it. As an alternative, the developers of Python-Markdown
- recommend that any untrusted content be passed through an HTML sanitizer (like [Bleach])
- after being converted to HTML by markdown.
-
- If your code previously looked like this:
-
- html = markdown.markdown(text, same_mode=True)
-
- Then it is recommended that you change your code to read something like this:
-
- import bleach
- html = bleach.clean(markdown.markdown(text))
-
- If you are not interested in sanitizing untrusted text, but simply desire to escape
- raw HTML, then that can be accomplished through an extension which removes HTML parsing:
-
- from markdown.extensions import Extension
-
- class EscapeHtml(Extension):
- def extendMarkdown(self, md, md_globals):
- del md.preprocessors['html_block']
- del md.inlinePatterns['html']
-
- html = markdown.markdown(text, extensions=[EscapeHtml()])
-
- As the HTML would not be parsed with the above Extension, then the serializer will
- escape the raw HTML, which is exactly what happens now when `safe_mode="escape"`.
-
-[Bleach]: https://bleach.readthedocs.io/
-
-* Positional arguments on the `markdown.Markdown()` are pending deprecation as are
- all except the `text` argument on the `markdown.markdown()` wrapper function.
- Only keyword arguments should be used. For example, if your code previously
- looked like this:
-
- html = markdown.markdown(text, ['extra'])
-
- Then it is recommended that you change it to read something like this:
-
- html = markdown.markdown(text, extensions=['extra'])
-
- !!! Note
- This change is being made as a result of deprecating `"safe_mode"` as the
- `safe_mode` argument was one of the positional arguments. When that argument
- is removed, the two arguments following it will no longer be at the correct
- position. It is recommended that you always use keywords when they are supported
- for this reason.
-
-* In previous versions of Python-Markdown, the built-in extensions received
- special status and did not require the full path to be provided. Additionally,
- third party extensions whose name started with `"mdx_"` received the same
- special treatment. This behavior will be deprecated in version 2.6 and will
- raise a **`PendingDeprecationWarning`** in 2.5. Ensure that you always use the full
- path to your extensions. For example, if you previously did the following:
-
- markdown.markdown(text, extensions=['extra'])
-
- You should change your code to the following:
-
- markdown.markdown(text, extensions=['markdown.extensions.extra'])
-
- The same applies to the command line:
-
- $ python -m markdown -x markdown.extensions.extra input.txt
-
- See the [documentation](reference.html#extensions) for a full explanation
- of the current behavior.
-
-* The previously documented method of appending the extension configuration as
- a string to the extension name will be deprecated in Python-Markdown
- version 2.6 and will raise a **`PendingDeprecationWarning`** in 2.5. The
- [`extension_configs`](reference.html#extension_configs) keyword should
- be used instead. See the [documentation](reference.html#extension-configs)
- for a full explanation of the current behavior.
-
-What's New in Python-Markdown 2.5
----------------------------------
-
-* The [Smarty Extension] has had a number of additional configuration settings
- added, which allows one to define their own substitutions to better support
- languages other than English. Thanks to [Martin Altmayer] for implementing this
- feature.
-
-[Smarty Extension]: extensions/smarty.html
-[Martin Altmayer]:https://github.com/MartinAltmayer
-
-* Named Extensions (strings passed to the [`extensions`][ex] keyword of
- `markdown.Markdown`) can now point to any module and/or Class on your PYTHONPATH.
- While dot notation was previously supported, a module could not be at the root of
- your PYTHONPATH. The name had to contain at least one dot (requiring it to be a
- sub-module). This restriction no longer exists.
-
- Additionally, a Class may be specified in the name. The class must be at the end of
- the name (which uses dot notation from PYTHONPATH) and be separated by a colon from
- the module.
-
- Therefore, if you were to import the class like this:
-
- from path.to.module import SomeExtensionClass
-
- Then the named extension would comprise this string:
-
- "path.to.module:SomeExtensionClass"
-
- This allows multiple extensions to be implemented within the same module and still
- accessible when the user is not able to import the extension directly (perhaps from
- a template filter or the command line).
-
- This also means that extension modules are no longer required to include the
- `makeExtension` function which returns an instance of the extension class. However,
- if the user does not specify the class name (she only provides `"path.to.module"`)
- the extension will fail to load without the `makeExtension` function included in
- the module. Extension authors will want to document carefully what is required to
- load their extensions.
-
-[ex]: reference.html#extensions
-
-* The Extension Configuration code has been refactored to make it a little easier
- for extension authors to work with configuration settings. As a result, the
- [`extension_configs`][ec] keyword now accepts a dictionary rather than requiring
- a list of tuples. A list of tuples is still supported so no one needs to change
- their existing code. This should also simplify the learning curve for new users.
-
- Extension authors are encouraged to review the new methods available on the
- `markdown.extnesions.Extension` class for handling configuration and adjust their
- code going forward. The included extensions provide a model for best practices.
- See the [API] documentation for a full explanation.
-
-[ec]: reference.html#extension_configs
-[API]: extensions/api.html#configsettings
-
-* The [Command Line Interface][cli] now accepts a `--extensions_config` (or `-c`)
- option which accepts a file name and passes the parsed content of a [YAML] or
- [JSON] file to the [`extension_configs`][ec] keyword of the `markdown.Markdown`
- class. The contents of the YAML or JSON must map to a Python Dictionary which
- matches the format required by the `extension_configs` keyword. Note that
- [PyYAML] is required to parse YAML files.
-
-[cli]: cli.html#using-extensions
-[YAML]: http://yaml.org/
-[JSON]: http://json.org/
-[PyYAML]: http://pyyaml.org/
-
-* The [admonition extension][ae] is no longer considered "experimental."
-
-[ae]: extensions/admonition.html
-
-* There have been various refactors of the testing framework. While those changes
- will not directly effect end users, the code is being better tested which will
- benefit everyone.
-
-* Various bug fixes have been made. See the
- [commit log](https://github.com/Python-Markdown/markdown/commits/master)
- for a complete history of the changes.
diff --git a/docs/release-2.6.txt b/docs/release-2.6.txt
deleted file mode 100644
index e450162..0000000
--- a/docs/release-2.6.txt
+++ /dev/null
@@ -1,263 +0,0 @@
-title: Release Notes for v2.6
-prev_title: Change Log
-prev_url: change_log.html
-next_title: Release Notes for v2.5
-next_url: release-2.5.html
-
-Python-Markdown 2.6 Release Notes
-=================================
-
-We are pleased to release Python-Markdown 2.6 which adds a few new features
-and fixes various bugs. See the list of changes below for details.
-
-Python-Markdown version 2.6 supports Python versions 2.7, 3.2, 3.3, and 3.4 as well as PyPy.
-
-Backwards-incompatible Changes
-------------------------------
-
-### `safe_mode` Deprecated
-
-Both `safe_mode` and the associated `html_replacement_text` keywords are deprecated
-in version 2.6 and will raise a **`DeprecationWarning`**. The `safe_mode` and
-`html_replacement_text` keywords will be ignored in version 2.7. The so-called
-"safe mode" was never actually "safe" which has resulted in many people having a false
-sense of security when using it. As an alternative, the developers of Python-Markdown
-recommend that any untrusted content be passed through an HTML sanitizer (like [Bleach])
-after being converted to HTML by markdown.
-
-If your code previously looked like this:
-
- html = markdown.markdown(text, safe_mode=True)
-
-Then it is recommended that you change your code to read something like this:
-
- import bleach
- html = bleach.clean(markdown.markdown(text))
-
-If you are not interested in sanitizing untrusted text, but simply desire to escape
-raw HTML, then that can be accomplished through an extension which removes HTML parsing:
-
- from markdown.extensions import Extension
-
- class EscapeHtml(Extension):
- def extendMarkdown(self, md, md_globals):
- del md.preprocessors['html_block']
- del md.inlinePatterns['html']
-
- html = markdown.markdown(text, extensions=[EscapeHtml()])
-
-As the HTML would not be parsed with the above Extension, then the serializer will
-escape the raw HTML, which is exactly what happens now when `safe_mode="escape"`.
-
-[Bleach]: https://bleach.readthedocs.io/
-
-### Positional Arguments Deprecated
-
-Positional arguments on the `markdown.Markdown()` class are deprecated as are
-all except the `text` argument on the `markdown.markdown()` wrapper function.
-Using positional arguments will raise a **`DeprecationWarning`** in 2.6 and an error
-in version 2.7. Only keyword arguments should be used. For example, if your code
-previously looked like this:
-
- html = markdown.markdown(text, [SomeExtension()])
-
-Then it is recommended that you change it to read something like this:
-
- html = markdown.markdown(text, extensions=[SomeExtension()])
-
-!!! Note
- This change is being made as a result of deprecating `"safe_mode"` as the
- `safe_mode` argument was one of the positional arguments. When that argument
- is removed, the two arguments following it will no longer be at the correct
- position. It is recommended that you always use keywords when they are supported
- for this reason.
-
-### "Shortened" Extension Names Deprecated
-
-In previous versions of Python-Markdown, the built-in extensions received
-special status and did not require the full path to be provided. Additionally,
-third party extensions whose name started with `"mdx_"` received the same
-special treatment. This behavior is deprecated and will raise a
-**`DeprecationWarning`** in version 2.6 and an error in 2.7. Ensure that you
-always use the full path to your extensions. For example, if you previously
-did the following:
-
- markdown.markdown(text, extensions=['extra'])
-
-You should change your code to the following:
-
- markdown.markdown(text, extensions=['markdown.extensions.extra'])
-
-The same applies to the command line:
-
- $ python -m markdown -x markdown.extensions.extra input.txt
-
-Similarly, if you have used a third party extension (for example `mdx_math`), previously
-you might have called it like this:
-
- markdown.markdown(text, extensions=['math'])
-
-As the `"mdx"` prefix will no longer be appended, you will need to change your code
-as follows (assuming the file `mdx_math.py` is installed at the root of your PYTHONPATH):
-
- markdown.markdown(text, extensions=['mdx_math'])
-
-Extension authors will want to update their documentation to reflect the new behavior.
-
-See the [documentation](reference.html#extensions) for a full explanation
-of the current behavior.
-
-### Extension Configuration as Part of Extension Name Deprecated
-
-The previously documented method of appending the extension configuration options as
-a string to the extension name is deprecated and will raise a
-**`DeprecationWarning`** in version 2.6 and an error in 2.7.
-The [`extension_configs`](reference.html#extension_configs) keyword should
-be used instead. See the [documentation](reference.html#extension-configs)
-for a full explanation of the current behavior.
-
-### HeaderId Extension Pending Deprecation
-
-The [HeaderId][hid] Extension is pending deprecation and will raise a
-**`PendingDeprecationWarning`** in version 2.6. The extension will be
-deprecated in version 2.7 and raise an error in version 2.8. Use the
-[Table of Contents][TOC] Extension instead, which offers most of the
-features of the HeaderId Extension and more (support for meta data is missing).
-
-Extension authors who have been using the `slugify` and `unique` functions
-defined in the HeaderId Extension should note that those functions are now
-defined in the Table of Contents extension and should adjust their import
-statements accordingly (`from markdown.extensions.toc import slugify, unique`).
-
-[hid]: extensions/header_id.html
-
-### The `configs` Keyword is Deprecated
-
-Positional arguments and the `configs` keyword on the `markdown.extension.Extension` class
-(and its subclasses) are deprecated. Each individual configuration option should be passed
-to the class as a keyword/value pair. For example. one might have previously initiated
-an extension subclass like this:
-
- ext = SomeExtension(configs={'somekey': 'somevalue'})
-
-That code should be updated to pass in the options directly:
-
- ext = SomeExtension(somekey='somevalue')
-
-Extension authors will want to note that this affects the `makeExtension` function as well.
-Previously it was common for the function to be defined as follows:
-
- def makeExtension(configs=None):
- return SomeExtension(configs=configs)
-
-Extension authors will want to update their code to the following instead:
-
- def makeExtension(**kwargs):
- return SomeExtension(**kwargs)
-
-Failing to do so will result in a **`DeprecationWarning`** and will raise an error in the next
-release. See the [Extension API][mext] documentation for more information.
-
-In the event that an `markdown.extension.Extension` subclass overrides the `__init__` method
-and implements its own configuration handling, then the above may not apply. However, it is
-recommended that the subclass still calls the parent `__init__` method to handle configuration
-options like so:
-
- class SomeExtension(markdown.extension.Extension):
- def __init__(**kwargs):
- # Do pre-config stuff here
- # Set config defaults
- self.config = {
- 'option1' : ['value1', 'description1'],
- 'option2' : ['value2', 'description2']
- }
- # Set user defined configs
- super(MyExtension, self).__init__(**kwargs)
- # Do post-config stuff here
-
-Note the call to `super` to get the benefits of configuration handling from the parent class.
-See the [documentation][config] for more information.
-
-[config]: extensions/api.html#configsettings
-[mext]: extensions/api.html#makeextension
-
-What's New in Python-Markdown 2.6
----------------------------------
-
-### Official Support for PyPy
-
-Official support for [PyPy] has been added. While Python-Markdown has most likely
-worked on PyPy for some time, it is now officially supported and tested on PyPy.
-
-[PyPy]: http://pypy.org/
-
-### YAML Style Meta-Data
-
-The [Meta-Data] Extension now includes optional support for [YAML] style
-meta-data. By default, the YAML deliminators are recognized, however, the
-actual data is parsed as previously. This follows the syntax of
-[MultiMarkdown], which inspired this extension.
-
-<del>Alternatively, if the `yaml` option is set, then the data is parsed as YAML.</del>
-<ins>As the `yaml` option was buggy, it was removed in 2.6.1. It is suggested that a third
-party extension be used if you want true YAML support. See [Issue #390][#390] for a full
-explanation.</ins>
-
-[MultiMarkdown]: http://fletcherpenney.net/MultiMarkdown_Syntax_Guide#metadata
-[Meta-Data]: extensions/meta_data.html
-[YAML]: http://yaml.org/
-[#390]: https://github.com/Python-Markdown/markdown/issues/390
-
-### Table of Contents Extension Refactored
-
-The [Table of Contents][TOC] Extension has been refactored and some new features
-have been added. See the documentation for a full explanation of each feature
-listed below:
-
-* The extension now assigns the Table of Contents to the `toc` attribute of
- the Markdown class regardless of whether a "marker" was found in the document.
- Third party frameworks no longer need to insert a "marker," run the document
- through Markdown, then extract the Table of Contents from the document.
-
-* The Table of Contents Extension is now a "registered extension." Therefore, when the `reset`
- method of the Markdown class is called, the `toc` attribute on the Markdown
- class is cleared (set to an empty string).
-
-* When the `marker` configuration option is set to an empty string, the parser completely
- skips the process of searching the document for markers. This should save parsing
- time when the Table of Contents Extension is being used only to assign ids to headers.
-
-* A `separator` configuration option has been added allowing users to override the
- separator character used by the slugify function.
-
-* A `baselevel` configuration option has been added allowing users to set the base level
- of headers in their documents (h1-h6). This allows the header levels to be
- automatically adjusted to fit within the hierarchy of an HTML template.
-
-[TOC]: extensions/toc.html
-
-### Pygments can now be disabled
-
-The [CodeHilite][ch] Extension has gained a new configuration option: `use_pygments`.
-The option is `True` by default, however, it allows one to turn off Pygments code
-highlighting (set to `False`) while preserving the language detection features of
-the extension. Note that Pygments language guessing is not used as that would 'use
-Pygments'. If a language is defined for a code block, it will be assigned to the
-`<code>` tag as a class in the manner suggested by the [HTML5 spec][spec]
-(alternate output will not be entertained) and could potentially be used by a JavaScript
-library in the browser to highlight the code block.
-
-[ch]: extensions/code_hilite.html
-[spec]: http://www.w3.org/TR/html5/text-level-semantics.html#the-code-element
-
-### Miscellaneous
-
-Test coverage has been improved including running [flake8]. While those changes
-will not directly effect end users, the code is being better tested which will
-benefit everyone.
-
-[flake8]: https://flake8.readthedocs.io/en/latest/
-
-Various bug fixes have been made. See the
-[commit log](https://github.com/Python-Markdown/markdown/commits/master)
-for a complete history of the changes.
diff --git a/docs/siteindex.txt b/docs/siteindex.txt
deleted file mode 100644
index 0139bd7..0000000
--- a/docs/siteindex.txt
+++ /dev/null
@@ -1,78 +0,0 @@
-title: Table of Contents
-prev_title: Authors
-prev_url: authors.html
-next_title: Summary
-next_url: index.html
-
-Table of Contents
-=================
-
-* [Python Markdown](index.html)
- * [Goals](index.html#goals)
- * [Features](index.html#features)
- * [Differences](index.html#differences)
- * [Support](index.html#support)
-* [Installation](install.html)
- * [The Easy Way](install.html#the-easy-way)
- * [Installing on Windows](install.html#windows)
- * [Installing on *nix Systems](install.html#linux)
- * [Using the Git Repository](install.html#git)
- * [Dependencies](install.html#dependencies)
-* [Library Reference](reference.html)
- * [The Basics](reference.html#the-basics)
- * [The Details](reference.html#the-details)
- * [`markdown.markdown`](reference.html#markdown)
- * [`markdown.markdownFromFile`](reference.html#markdownFromFile)
- * [`markdown.Markdown`](reference.html#Markdown)
-* [Command Line](cli.html)
- * [Setup](cli.html#setup)
- * [Usage](cli.html#usage)
- * [Using Extensions](cli.html#using-extensions)
-* [Extensions](extensions/index.html)
- * [Officially Supported Extensions](extensions/index.html#officially-supported-extensions)
- * [Extra](extensions/extra.html)
- * [Abbreviations](extensions/abbreviations.html)
- * [Attribute Lists](extensions/attr_list.html)
- * [Definition Lists](extensions/definition_lists.html)
- * [Fenced Code Blocks](extensions/fenced_code_blocks.html)
- * [Footnotes](extensions/footnotes.html)
- * [Tables](extensions/tables.html)
- * [Smart Strong](extensions/smart_strong.html)
- * [Admonition](extensions/admonition.html)
- * [CodeHilite](extensions/code_hilite.html)
- * [HeaderId](extensions/header_id.html)
- * [Meta-Data](extensions/meta_data.html)
- * [New Line to Break](extensions/nl2br.html)
- * [Sane Lists](extensions/sane_lists.html)
- * [SmartyPants](extensions/smarty.html)
- * [Table of Contents](extensions/toc.html)
- * [WikiLinks](extensions/wikilinks.html)
- * [Third Party Extensions](extensions/index.html#third-party-extensions)
- * [Extension API](extensions/api.html)
- * [Preprocessors](extensions/api.html#preprocessors)
- * [Inline Patterns](extensions/api.html#inlinepatterns)
- * [Treeprocessors](extensions/api.html#treeprocessors)
- * [Postprocessors](extensions/api.html#postprocessors)
- * [BlockParser](extensions/api.html#blockparser)
- * [Working with the ElementTree](extensions/api.html#working_with_et)
- * [Integrating your code into Markdown](extensions/api.html#integrating_into_markdown)
- * [extendMarkdown](extensions/api.html#extendmarkdown)
- * [OrderedDict](extensions/api.html#ordereddict)
- * [registerExtension](extensions/api.html#registerextension)
- * [Configuration Settings](extensions/api.html#configsettings)
- * [makeExtension](extensions/api.html#makeextension)
-* [Test Suite](test_suite.html)
- * [Markdown Syntax Test](test_suite.html#markdown-syntax-tests)
- * [Syntax Test Configuration Settings](test_suite.html#syntax-test-config-settings)
- * [Unit Tests](test_suite.html#unit-tests)
-* [Change Log](change_log.html)
- * [Release Notes for v.2.6](release-2.6.html)
- * [Release Notes for v.2.5](release-2.5.html)
- * [Release Notes for v.2.4](release-2.4.html)
- * [Release Notes for v.2.3](release-2.3.html)
- * [Release Notes for v.2.2.1](release-2.1.1.html)
- * [Release Notes for v.2.2.0](release-2.1.0.html)
- * [Release Notes for v.2.0.2](release-2.0.2.html)
- * [Release Notes for v.2.0.1](release-2.0.1.html)
- * [Release Notes for v.2.0](release-2.0.html)
-* [Authors](authors.html)
diff --git a/docs/test_suite.txt b/docs/test_suite.md
index ee761f2..9ead4c6 100644
--- a/docs/test_suite.txt
+++ b/docs/test_suite.md
@@ -7,10 +7,10 @@ next_url: change_log.html
# Test Suite
Python-Markdown comes with a test suite which uses the [Nose] testing
-framework and [YAML]. The test suite primarily serves to ensure that new bugs
-are not introduced as existing bugs are patched or new features are added. It
-also allows Python-Markdown to be tested with the tests from other
-implementations such as John Gruber's [Perl] implementation or Michel
+framework and [YAML]. The test suite primarily serves to ensure that new bugs
+are not introduced as existing bugs are patched or new features are added. It
+also allows Python-Markdown to be tested with the tests from other
+implementations such as John Gruber's [Perl] implementation or Michel
Fortin's [PHP] implementation.
The test suite can be run by calling the `run_tests.py` command at the root of
@@ -24,8 +24,8 @@ temporary file in `test-output.html`. Open the file in a browser to view
the report.
A `tox.ini` file is also provided, so [tox] can be used to automatically create
-virtual environments, install all testing dependencies and run the tests on
-each supported Python version. See the wiki for instructions on
+virtual environments, install all testing dependencies and run the tests on
+each supported Python version. See the wiki for instructions on
[setting up a testing environment] to use tox.
The test suite contains two kinds of tests: Markdown Syntax Tests and Unit
@@ -61,18 +61,18 @@ insignificant white space differences:
MarkdownSyntaxError: Output from "/home/waylan/code/python-markdown/te
sts/misc/lists3.txt" failed to match expected output.
- --- /home/waylan/code/python-markdown/tests/misc/lists3.html
- +++ actual_output.html
- @@ -1,5 +1,5 @@
- <ul>
- <li>blah blah blah
- -sdf asdf asdf asdf asdf
- -asda asdf asdfasd</li>
- + sdf asdf asdf asdf asdf
- + asda asdf asdfasd</li>
+ --- /home/waylan/code/python-markdown/tests/misc/lists3.html
+ +++ actual_output.html
+ @@ -1,5 +1,5 @@
+ <ul>
+ <li>blah blah blah
+ -sdf asdf asdf asdf asdf
+ -asda asdf asdfasd</li>
+ + sdf asdf asdf asdf asdf
+ + asda asdf asdfasd</li>
</ul>
- ----------------------------------------------------------------------
+ ----------------------------------------------------------------------
Ran 219 tests in 7.698s
FAILED (MarkdownSyntaxError=1, SKIP=53)
@@ -109,29 +109,29 @@ settings under a specific file section will override anything in the
Below are the configuration options available and the defaults used when they
are not explicitly set.
-* `normalize`: Switches white space normalization of the test output on or off.
- Defaults to `False` (off). Note: This requires that [PyTidyLib] be installed on
- the system. Otherwise the test will be skipped, regardless of any other
- settings.
-* `skip`: Switches skipping of the test on and off. Defaults to `False` (off).
-* `input_ext`: Extension of input file. Defaults to `.txt`. Useful for tests
+* `normalize`: Switches white space normalization of the test output on or off.
+ Defaults to `False` (off). Note: This requires that [PyTidyLib] be installed
+ on the system. Otherwise the test will be skipped, regardless of any other
+ settings.
+* `skip`: Switches skipping of the test on and off. Defaults to `False` (off).
+* `input_ext`: Extension of input file. Defaults to `.txt`. Useful for tests
from other implementations.
* `output_ext`: Extension of output file. Defaults to `.html`. Useful for tests
from other implementations.
-* Any keyword argument accepted by the Markdown class. If not set, Markdown's
- defaults are used.
+* Any keyword argument accepted by the Markdown class. If not set, Markdown's
+ defaults are used.
## Unit Tests
Unit Tests are used as regression tests for Python-Markdown's API.
All Unit Tests shipped with Python-Markdown are standard Python Unit Tests and
-are all contained in `tests/test_apis.py` and `tests/test_extensions.py`.
-Standard discovery methods are used to find and run the tests. Therefore, when
+are all contained in `tests/test_apis.py` and `tests/test_extensions.py`.
+Standard discovery methods are used to find and run the tests. Therefore, when
writing new tests, those standards and naming conventions should be followed.
-[Nose]: http://somethingaboutorange.com/mrl/projects/nose/
-[Perl]: http://daringfireball.net/projects/markdown/
-[PHP]: http://michelf.com/projects/php-markdown/
+[Nose]: http://somethingaboutorange.com/mrl/projects/nose/
+[Perl]: http://daringfireball.net/projects/markdown/
+[PHP]: http://michelf.com/projects/php-markdown/
[PyTidyLib]: http://countergram.com/open-source/pytidylib/
[tox]: http://testrun.org/tox/latest/
[setting up a testing environment]: https://github.com/Python-Markdown/markdown/wiki/Test-Environment-Setup
diff --git a/makefile b/makefile
index 2752d6a..aeb81aa 100644
--- a/makefile
+++ b/makefile
@@ -22,6 +22,7 @@ install:
deploy:
python setup.py sdist --manifest-only
python setup.py sdist --formats zip,gztar upload
+ mkdocs gh-deploy -r pages -b master
.PHONY : build
build:
@@ -35,8 +36,7 @@ build-win:
.PHONY : docs
docs:
- python setup.py build_docs --force
- cd build/docs && zip -r ../docs.zip .
+ mkdocs build --clean
.PHONY : test
test:
@@ -62,4 +62,5 @@ clean:
rm -rf build
rm -rf dist
rm -rf tmp
+ rm -rf site
# git clean -dfx'
diff --git a/markdown/__init__.py b/markdown/__init__.py
index 409f9cf..5b8be47 100644
--- a/markdown/__init__.py
+++ b/markdown/__init__.py
@@ -10,7 +10,7 @@ called from the command line.
import markdown
html = markdown.markdown(your_text_string)
-See <https://pythonhosted.org/Markdown/> for more
+See <https://Python-Markdown.github.io/> for more
information and instructions on how to extend the functionality of
Python Markdown. Read that before you try modifying this file.
diff --git a/markdown/__main__.py b/markdown/__main__.py
index 17bfa9f..c24f756 100644
--- a/markdown/__main__.py
+++ b/markdown/__main__.py
@@ -27,7 +27,7 @@ def parse_options(args=None, values=None):
usage = """%prog [options] [INPUTFILE]
(STDIN is assumed if no INPUTFILE is given)"""
desc = "A Python implementation of John Gruber's Markdown. " \
- "https://pythonhosted.org/Markdown/"
+ "https://Python-Markdown.github.io/"
ver = "%%prog %s" % markdown.version
parser = optparse.OptionParser(usage=usage, description=desc, version=ver)
diff --git a/markdown/extensions/abbr.py b/markdown/extensions/abbr.py
index 353d126..bfa8c10 100644
--- a/markdown/extensions/abbr.py
+++ b/markdown/extensions/abbr.py
@@ -4,7 +4,7 @@ Abbreviation Extension for Python-Markdown
This extension adds abbreviation handling to Python-Markdown.
-See <https://pythonhosted.org/Markdown/extensions/abbreviations.html>
+See <https://Python-Markdown.github.io/extensions/abbreviations>
for documentation.
Oringinal code Copyright 2007-2008 [Waylan Limberg](http://achinghead.com/) and
diff --git a/markdown/extensions/admonition.py b/markdown/extensions/admonition.py
index 0c5ce46..2e83900 100644
--- a/markdown/extensions/admonition.py
+++ b/markdown/extensions/admonition.py
@@ -6,7 +6,7 @@ Adds rST-style admonitions. Inspired by [rST][] feature with the same name.
[rST]: http://docutils.sourceforge.net/docs/ref/rst/directives.html#specific-admonitions # noqa
-See <https://pythonhosted.org/Markdown/extensions/admonition.html>
+See <https://Python-Markdown.github.io/extensions/admonition>
for documentation.
Original code Copyright [Tiago Serafim](http://www.tiagoserafim.com/).
diff --git a/markdown/extensions/attr_list.py b/markdown/extensions/attr_list.py
index a7f92b6..894e545 100644
--- a/markdown/extensions/attr_list.py
+++ b/markdown/extensions/attr_list.py
@@ -6,7 +6,7 @@ Adds attribute list syntax. Inspired by
[maruku](http://maruku.rubyforge.org/proposal.html#attribute_lists)'s
feature of the same name.
-See <https://pythonhosted.org/Markdown/extensions/attr_list.html>
+See <https://Python-Markdown.github.io/extensions/attr_list>
for documentation.
Original code Copyright 2011 [Waylan Limberg](http://achinghead.com/).
diff --git a/markdown/extensions/codehilite.py b/markdown/extensions/codehilite.py
index 20b889c..ee42d57 100644
--- a/markdown/extensions/codehilite.py
+++ b/markdown/extensions/codehilite.py
@@ -4,7 +4,7 @@ CodeHilite Extension for Python-Markdown
Adds code/syntax highlighting to standard Python-Markdown code blocks.
-See <https://pythonhosted.org/Markdown/extensions/code_hilite.html>
+See <https://Python-Markdown.github.io/extensions/code_hilite>
for documentation.
Original code Copyright 2006-2008 [Waylan Limberg](http://achinghead.com/).
diff --git a/markdown/extensions/def_list.py b/markdown/extensions/def_list.py
index 77cca6e..9057ebd 100644
--- a/markdown/extensions/def_list.py
+++ b/markdown/extensions/def_list.py
@@ -4,7 +4,7 @@ Definition List Extension for Python-Markdown
Adds parsing of Definition Lists to Python-Markdown.
-See <https://pythonhosted.org/Markdown/extensions/definition_lists.html>
+See <https://Python-Markdown.github.io/extensions/definition_lists>
for documentation.
Original code Copyright 2008 [Waylan Limberg](http://achinghead.com)
diff --git a/markdown/extensions/extra.py b/markdown/extensions/extra.py
index de5db03..587ba64 100644
--- a/markdown/extensions/extra.py
+++ b/markdown/extensions/extra.py
@@ -20,7 +20,7 @@ under a differant name. You could also edit the `extensions` global
variable defined below, but be aware that such changes may be lost
when you upgrade to any future version of Python-Markdown.
-See <https://pythonhosted.org/Markdown/extensions/extra.html>
+See <https://Python-Markdown.github.io/extensions/extra>
for documentation.
Copyright The Python Markdown Project
diff --git a/markdown/extensions/fenced_code.py b/markdown/extensions/fenced_code.py
index 277bac4..392c654 100644
--- a/markdown/extensions/fenced_code.py
+++ b/markdown/extensions/fenced_code.py
@@ -4,7 +4,7 @@ Fenced Code Extension for Python Markdown
This extension adds Fenced Code Blocks to Python-Markdown.
-See <https://pythonhosted.org/Markdown/extensions/fenced_code_blocks.html>
+See <https://Python-Markdown.github.io/extensions/fenced_code_blocks>
for documentation.
Original code Copyright 2007-2008 [Waylan Limberg](http://achinghead.com/).
diff --git a/markdown/extensions/footnotes.py b/markdown/extensions/footnotes.py
index 8bd8595..7edf813 100644
--- a/markdown/extensions/footnotes.py
+++ b/markdown/extensions/footnotes.py
@@ -4,7 +4,7 @@ Footnotes Extension for Python-Markdown
Adds footnote handling to Python-Markdown.
-See <https://pythonhosted.org/Markdown/extensions/footnotes.html>
+See <https://Python-Markdown.github.io/extensions/footnotes>
for documentation.
Copyright The Python Markdown Project
diff --git a/markdown/extensions/headerid.py b/markdown/extensions/headerid.py
index 2cb20b9..fdcc8f2 100644
--- a/markdown/extensions/headerid.py
+++ b/markdown/extensions/headerid.py
@@ -4,7 +4,7 @@ HeaderID Extension for Python-Markdown
Auto-generate id attributes for HTML headers.
-See <https://pythonhosted.org/Markdown/extensions/header_id.html>
+See <https://Python-Markdown.github.io/extensions/header_id>
for documentation.
Original code Copyright 2007-2011 [Waylan Limberg](http://achinghead.com/).
diff --git a/markdown/extensions/meta.py b/markdown/extensions/meta.py
index 711235e..7902bd4 100644
--- a/markdown/extensions/meta.py
+++ b/markdown/extensions/meta.py
@@ -4,7 +4,7 @@ Meta Data Extension for Python-Markdown
This extension adds Meta Data handling to markdown.
-See <https://pythonhosted.org/Markdown/extensions/meta_data.html>
+See <https://Python-Markdown.github.io/extensions/meta_data>
for documentation.
Original code Copyright 2007-2008 [Waylan Limberg](http://achinghead.com).
diff --git a/markdown/extensions/nl2br.py b/markdown/extensions/nl2br.py
index 8acd60c..a4c0fab 100644
--- a/markdown/extensions/nl2br.py
+++ b/markdown/extensions/nl2br.py
@@ -5,7 +5,7 @@ NL2BR Extension
A Python-Markdown extension to treat newlines as hard breaks; like
GitHub-flavored Markdown does.
-See <https://pythonhosted.org/Markdown/extensions/nl2br.html>
+See <https://Python-Markdown.github.io/extensions/nl2br>
for documentation.
Oringinal code Copyright 2011 [Brian Neal](http://deathofagremmie.com/)
diff --git a/markdown/extensions/sane_lists.py b/markdown/extensions/sane_lists.py
index 828ae7a..651b12b 100644
--- a/markdown/extensions/sane_lists.py
+++ b/markdown/extensions/sane_lists.py
@@ -4,7 +4,7 @@ Sane List Extension for Python-Markdown
Modify the behavior of Lists in Python-Markdown to act in a sane manor.
-See <https://pythonhosted.org/Markdown/extensions/sane_lists.html>
+See <https://Python-Markdown.github.io/extensions/sane_lists>
for documentation.
Original code Copyright 2011 [Waylan Limberg](http://achinghead.com)
diff --git a/markdown/extensions/smart_strong.py b/markdown/extensions/smart_strong.py
index 58570bb..eeded31 100644
--- a/markdown/extensions/smart_strong.py
+++ b/markdown/extensions/smart_strong.py
@@ -4,7 +4,7 @@ Smart_Strong Extension for Python-Markdown
This extention adds smarter handling of double underscores within words.
-See <https://pythonhosted.org/Markdown/extensions/smart_strong.html>
+See <https://Python-Markdown.github.io/extensions/smart_strong>
for documentation.
Original code Copyright 2011 [Waylan Limberg](http://achinghead.com)
diff --git a/markdown/extensions/smarty.py b/markdown/extensions/smarty.py
index 600d74c..5031bc4 100644
--- a/markdown/extensions/smarty.py
+++ b/markdown/extensions/smarty.py
@@ -6,7 +6,7 @@ Smarty extension for Python-Markdown
Adds conversion of ASCII dashes, quotes and ellipses to their HTML
entity equivalents.
-See <https://pythonhosted.org/Markdown/extensions/smarty.html>
+See <https://Python-Markdown.github.io/extensions/smarty>
for documentation.
Author: 2013, Dmitry Shachnev <mitya57@gmail.com>
diff --git a/markdown/extensions/tables.py b/markdown/extensions/tables.py
index ec3b6ac..6d28aef 100644
--- a/markdown/extensions/tables.py
+++ b/markdown/extensions/tables.py
@@ -4,7 +4,7 @@ Tables Extension for Python-Markdown
Added parsing of tables to Python-Markdown.
-See <https://pythonhosted.org/Markdown/extensions/tables.html>
+See <https://Python-Markdown.github.io/extensions/tables>
for documentation.
Original code Copyright 2009 [Waylan Limberg](http://achinghead.com)
diff --git a/markdown/extensions/toc.py b/markdown/extensions/toc.py
index 56db33c..2c4a4b5 100644
--- a/markdown/extensions/toc.py
+++ b/markdown/extensions/toc.py
@@ -2,7 +2,7 @@
Table of Contents Extension for Python-Markdown
===============================================
-See <https://pythonhosted.org/Markdown/extensions/toc.html>
+See <https://Python-Markdown.github.io/extensions/toc>
for documentation.
Oringinal code Copyright 2008 [Jack Miller](http://codezen.org)
diff --git a/markdown/extensions/wikilinks.py b/markdown/extensions/wikilinks.py
index 94e1b67..ff16494 100644
--- a/markdown/extensions/wikilinks.py
+++ b/markdown/extensions/wikilinks.py
@@ -4,7 +4,7 @@ WikiLinks Extension for Python-Markdown
Converts [[WikiLinks]] to relative links.
-See <https://pythonhosted.org/Markdown/extensions/wikilinks.html>
+See <https://Python-Markdown.github.io/extensions/wikilinks>
for documentation.
Original code Copyright [Waylan Limberg](http://achinghead.com/).
diff --git a/mkdocs.yml b/mkdocs.yml
new file mode 100644
index 0000000..dfecb3c
--- /dev/null
+++ b/mkdocs.yml
@@ -0,0 +1,57 @@
+site_name: Python-Markdown
+site_url: https://Python-Markdown.github.io/
+repo_url: https://github.com/Python-Markdown/markdown
+site_author: "The Python-Markdown Project"
+copyright: "Copyright &copy; 2010-2017"
+
+use_directory_urls: true
+
+theme:
+ name: nature
+ icon: py.png
+ release: 2.6.9
+ issue_tracker: https://github.com/Python-Markdown/markdown/issues
+
+pages:
+ - Python-Markdown: index.md
+ - Installation: install.md
+ - Library Reference: reference.md
+ - Command Line: cli.md
+ - Extensions: extensions/index.md
+ - Officially Supported Extensions:
+ - Abbreviations: extensions/abbreviations.md
+ - Admonition: extensions/admonition.md
+ - Attribute Lists: extensions/attr_list.md
+ - CodeHilite: extensions/code_hilite.md
+ - Definition Lists: extensions/definition_lists.md
+ - Extra: extensions/extra.md
+ - Fenced Code Blocks: extensions/fenced_code_blocks.md
+ - Footnotes: extensions/footnotes.md
+ - HeaderId: extensions/header_id.md
+ - Meta-Data: extensions/meta_data.md
+ - New Line to Break: extensions/nl2br.md
+ - Sane Lists: extensions/sane_lists.md
+ - Smart Strong: extensions/smart_strong.md
+ - SmartyPants: extensions/smarty.md
+ - Table of Contents: extensions/toc.md
+ - Tables: extensions/tables.md
+ - WikiLinks: extensions/wikilinks.md
+ - Extension API: extensions/api.md
+ - Test Suite: test_suite.md
+ - Change Log: change_log/index.md
+ - Release Notes for v.2.6: change_log/release-2.6.md
+ - Release Notes for v.2.5: change_log/release-2.5.md
+ - Release Notes for v.2.4: change_log/release-2.4.md
+ - Release Notes for v.2.3: change_log/release-2.3.md
+ - Release Notes for v.2.2: change_log/release-2.2.md
+ - Release Notes for v.2.1: change_log/release-2.1.md
+ - Release Notes for v.2.0: change_log/release-2.0.md
+ - Authors: authors.md
+
+markdown_extensions:
+ - extra
+ - admonition
+ - smarty
+ - codehilite
+ - toc:
+ permalink: true
diff --git a/setup.py b/setup.py
index 3821c6c..fba5172 100755
--- a/setup.py
+++ b/setup.py
@@ -5,10 +5,6 @@ import sys
import os
from distutils.core import setup
from distutils.command.install_scripts import install_scripts
-from distutils.command.build import build
-from distutils.core import Command
-from distutils.util import change_root, newer
-import codecs
import imp
@@ -68,150 +64,6 @@ class md_install_scripts(install_scripts):
print('ERROR: Unable to create %s: %s' % (bat_path, err))
-class build_docs(Command):
-
- """ Build markdown documentation into html."""
-
- description = '"build" documentation (convert markdown text to html)'
-
- user_options = [
- ('build-base=', 'd', 'directory to "build" to'),
- ('force', 'f', 'forcibly build everything (ignore file timestamps)'),
- ]
-
- boolean_options = ['force']
-
- def initialize_options(self):
- self.build_base = None
- self.force = None
- self.docs = None
- self.sitemap = ''
-
- def finalize_options(self):
- self.set_undefined_options(
- 'build',
- ('build_base', 'build_base'),
- ('force', 'force')
- )
- self.docs = self._get_docs()
-
- def _get_docs(self):
- for root, dirs, files in os.walk('docs'):
- for file in files:
- if not file.startswith('_'):
- path = os.path.join(root, file)
- yield path
-
- def _get_context(self, src, path):
- """ Build and return context to pass to template. """
- # set defaults
- c = {
- 'title': '',
- 'prev_url': '',
- 'prev_title': '',
- 'next_url': '',
- 'next_title': '',
- 'crumb': '',
- 'version': version,
- }
- c['body'] = self.md.convert(src)
- c['toc'] = self.md.toc
- for k, v in self.md.Meta.items():
- c[k] = ' '.join(v)
- self.md.reset()
- # Manipulate path
- path = path[len(os.path.join(self.build_base, 'docs/')):]
- dir, file = os.path.split(path)
- name, ext = os.path.splitext(file)
- parts = [x for x in dir.split(os.sep) if x]
- c['source'] = '%s.txt' % name
- c['base'] = '../' * len(parts)
- # Build page title
- if name.lower() != 'index' or parts:
- c['page_title'] = '%s &#8212; Python Markdown' % c['title']
- else:
- c['page_title'] = 'Python Markdown'
- # Build crumb trail
- crumbs = []
- ctemp = '<li><a href="%s">%s</a> &raquo;</li>'
- for n, part in enumerate(parts):
- href = ('../' * n) + 'index.html'
- label = part.replace('_', ' ').capitalize()
- crumbs.append(ctemp % (href, label))
- if c['title'] and name.lower() != 'index':
- crumbs.append(ctemp % (file, c['title']))
- c['crumb'] = '\n'.join(crumbs)
- return c
-
- def run(self):
- # Before importing markdown, tweak sys.path to import from the
- # build directory (2to3 might have run on the library).
- bld_cmd = self.get_finalized_command("build")
- sys.path.insert(0, bld_cmd.build_lib)
- try:
- import markdown
- except ImportError:
- print('skipping build_docs: Markdown "import" failed!')
- else:
- with codecs.open('docs/_template.html', encoding='utf-8') as f:
- template = f.read()
- self.md = markdown.Markdown(
- extensions=[
- 'extra',
- 'toc(permalink=true)',
- 'meta',
- 'admonition',
- 'smarty'
- ]
- )
- for infile in self.docs:
- outfile, ext = os.path.splitext(infile)
- if ext == '.txt':
- # Copy src to .txt file
- srcfile = outfile + '.txt'
- srcfile = change_root(self.build_base, srcfile)
- self.mkpath(os.path.split(srcfile)[0])
- self.copy_file(infile, srcfile)
- # Render html file
- outfile += '.html'
- outfile = change_root(self.build_base, outfile)
- self.mkpath(os.path.split(outfile)[0])
- if self.force or newer(infile, outfile):
- if self.verbose:
- print('Converting %s -> %s' % (infile, outfile))
- if not self.dry_run:
- with codecs.open(infile, encoding='utf-8') as f:
- src = f.read()
- out = template % self._get_context(src, outfile)
- doc = open(outfile, 'wb')
- doc.write(out.encode('utf-8'))
- doc.close()
- else:
- outfile = change_root(self.build_base, infile)
- self.mkpath(os.path.split(outfile)[0])
- self.copy_file(infile, outfile)
-
-
-class md_build(build):
-
- """ Run "build_docs" command from "build" command. """
-
- user_options = build.user_options + [
- ('no-build-docs', None, 'do not build documentation'),
- ]
-
- boolean_options = build.boolean_options + ['build-docs']
-
- def initialize_options(self):
- build.initialize_options(self)
- self.no_build_docs = False
-
- def has_docs(self):
- return not self.no_build_docs
-
- sub_commands = build.sub_commands + [('build_docs', has_docs)]
-
-
long_description = '''
This is a Python implementation of John Gruber's Markdown_.
It is almost completely compliant with the reference implementation,
@@ -220,8 +72,8 @@ on what exactly is supported and what is not. Additional features are
supported by the `Available Extensions`_.
.. _Markdown: http://daringfireball.net/projects/markdown/
-.. _Features: https://pythonhosted.org/Markdown/index.html#Features
-.. _`Available Extensions`: https://pythonhosted.org/Markdown/extensions/index.html
+.. _Features: https://Python-Markdown.github.io#Features
+.. _`Available Extensions`: https://Python-Markdown.github.io/extensions/
Support
=======
@@ -236,7 +88,7 @@ You may ask for help and discuss various other issues on the
setup(
name='Markdown',
version=version,
- url='https://pythonhosted.org/Markdown/',
+ url='https://Python-Markdown.github.io/',
download_url='http://pypi.python.org/packages/source/M/Markdown/Markdown-%s.tar.gz' % version,
description='Python implementation of Markdown.',
long_description=long_description,
@@ -248,9 +100,7 @@ setup(
packages=['markdown', 'markdown.extensions'],
scripts=['bin/%s' % SCRIPT_NAME],
cmdclass={
- 'install_scripts': md_install_scripts,
- 'build_docs': build_docs,
- 'build': md_build
+ 'install_scripts': md_install_scripts
},
classifiers=[
'Development Status :: %s' % DEVSTATUS,
diff --git a/test-requirements.txt b/test-requirements.txt
index b7bcf16..65bfae0 100644
--- a/test-requirements.txt
+++ b/test-requirements.txt
@@ -2,4 +2,5 @@ nose
coverage<4.0
pyyaml
pytidylib
-pygments
+mkdocs
+mkdocs-nature
diff --git a/tests/misc/em-around-links.html b/tests/misc/em-around-links.html
index a7593c5..cc415f5 100644
--- a/tests/misc/em-around-links.html
+++ b/tests/misc/em-around-links.html
@@ -1,13 +1,13 @@
<h1>Title</h1>
<ul>
-<li><em><a href="https://pythonhosted.org/Markdown/">Python in Markdown</a> by some
+<li><em><a href="http://example.com">Python in Markdown</a> by some
great folks</em> - This <em>does</em> work as expected.</li>
-<li><em><a href="https://pythonhosted.org/Markdown/">Python in Markdown</a> by some
+<li><em><a href="http://example.com">Python in Markdown</a> by some
great folks</em> - This <em>does</em> work as expected.</li>
-<li><a href="https://pythonhosted.org/Markdown/"><em>Python in Markdown</em></a> by some
+<li><a href="http://example.com"><em>Python in Markdown</em></a> by some
great folks - This <em>does</em> work as expected.</li>
-<li><a href="https://pythonhosted.org/Markdown/"><em>Python in Markdown</em></a> <em>by some
+<li><a href="http://example.com"><em>Python in Markdown</em></a> <em>by some
great folks</em> - This <em>does</em> work as expected.</li>
</ul>
-<p><em><a href="https://pythonhosted.org/Markdown/">Python in Markdown</a> by some
+<p><em><a href="http://example.com">Python in Markdown</a> by some
great folks</em> - This <em>does</em> work as expected.</p> \ No newline at end of file
diff --git a/tests/misc/em-around-links.txt b/tests/misc/em-around-links.txt
index de04d3b..dbc3644 100644
--- a/tests/misc/em-around-links.txt
+++ b/tests/misc/em-around-links.txt
@@ -1,14 +1,14 @@
# Title
- - *[Python in Markdown](https://pythonhosted.org/Markdown/) by some
+ - *[Python in Markdown](http://example.com) by some
great folks* - This *does* work as expected.
- - _[Python in Markdown](https://pythonhosted.org/Markdown/) by some
+ - _[Python in Markdown](http://example.com) by some
great folks_ - This *does* work as expected.
- - [_Python in Markdown_](https://pythonhosted.org/Markdown/) by some
+ - [_Python in Markdown_](http://example.com) by some
great folks - This *does* work as expected.
- - [_Python in Markdown_](https://pythonhosted.org/Markdown/) _by some
+ - [_Python in Markdown_](http://example.com) _by some
great folks_ - This *does* work as expected.
-_[Python in Markdown](https://pythonhosted.org/Markdown/) by some
+_[Python in Markdown](http://example.com) by some
great folks_ - This *does* work as expected.