-
Notifications
You must be signed in to change notification settings - Fork 2
/
Copy pathindex.html
248 lines (228 loc) · 11.7 KB
/
index.html
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
<!DOCTYPE html>
<html lang="en">
<head>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
<meta name="description" content="None">
<meta name="author" content="The Python-Markdown Project">
<link rel="canonical" href="https://Python-Markdown.github.io/">
<link rel="shortcut icon" href="favicon.ico">
<link rel="search" title="Search" href="search.html" />
<link rel="next" title="Installation" href="install/" />
<title>Python-Markdown — Python-Markdown 3.8 documentation</title>
<link rel="stylesheet" href="static/nature.css" type="text/css" />
<link rel="stylesheet" href="static/pygments.css" type="text/css" />
<link rel="stylesheet" href="assets/_mkdocstrings.css" type="text/css" />
<link rel="stylesheet" href="custom.css" type="text/css" />
<link rel="stylesheet" href="mkdocstrings.css" type="text/css" />
<script type="text/javascript" src="static/jquery.js"></script>
<script type="text/javascript" src="static/underscore.js"></script>
</head>
<body class="homepage">
<div class="related" role="navigation" aria-label="related navigation">
<h3>Navigation</h3>
<ul>
<li class="right" style="margin-right: 10px">
<a href="https://github.com/Python-Markdown/markdown" title="View this project on GitHub"><img src="static/github.png" width=16px style="vertical-align: middle; margin-top: -1px" /></a>
</li>
<li class="right" style="margin-right: 10px">
<a href="sitemap.html" title="Sitemap" accesskey="I">index</a>
</li>
<li class="right">
<a href="install/" title="Installation" accesskey="N">next</a> |
</li>
<li><img src="py.png"
alt="icon" style="vertical-align: middle; margin-top: -1px"/></li>
<li class="nav-item nav-item-0">
<a href=".">Python-Markdown 3.8 documentation</a> »
</li>
</ul>
</div>
<div class="document">
<div class="documentwrapper">
<div class="bodywrapper">
<div class="body" role="main"><h1 id="python-markdown">Python-Markdown<a class="headerlink" href="#python-markdown" title="Permanent link">¶</a></h1>
<p>This is a Python implementation of John Gruber’s
<a href="https://daringfireball.net/projects/markdown/">Markdown</a>.
It is almost completely compliant with the reference implementation,
though there are a few very minor <a href="#differences">differences</a>. See John’s
<a href="https://daringfireball.net/projects/markdown/syntax">Syntax Documentation</a>
for the syntax rules.</p>
<p>To get started, see the <a href="install/">installation instructions</a>, the <a href="reference/">library
reference</a>, and the <a href="cli/">command line interface</a>.</p>
<h2 id="goals">Goals<a class="headerlink" href="#goals" title="Permanent link">¶</a></h2>
<p>The Python-Markdown project is developed with the following goals in mind:</p>
<ul>
<li>
<p>Maintain a Python 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 follows the
<a href="https://daringfireball.net/projects/markdown/syntax">syntax rules</a> and the behavior of the original (markdown.pl)
implementation as reasonably as possible (see <a href="#differences">differences</a> for
a few exceptions).</p>
</li>
<li>
<p>Provide an <a href="extensions/api/">Extension API</a> which makes it possible
to change and/or extend the behavior of the parser.</p>
</li>
</ul>
<div class="admonition note">
<p class="admonition-title">Note</p>
<p><em>This is not a CommonMark implementation</em>; nor is it trying to be!
Python-Markdown was developed long before the CommonMark specification was
released and has always (mostly) followed the <a href="https://daringfireball.net/projects/markdown/syntax">syntax rules</a> and behavior
of the original reference implementation. No accommodations have been made
to address the changes which CommonMark has suggested. It is recommended
that you look elsewhere if you want an implementation which follows the
CommonMark specification.</p>
</div>
<h2 id="features">Features<a class="headerlink" href="#features" title="Permanent link">¶</a></h2>
<p>In addition to the basic markdown syntax, Python-Markdown supports the following
features:</p>
<ul>
<li>
<p><strong>International Input</strong></p>
<p>Python-Markdown will accept <a href="reference/#text">input</a> in any language
supported by Unicode including bi-directional text. In fact the test suite
includes documents written in Russian and Arabic.</p>
</li>
<li>
<p><strong>Extensions</strong></p>
<p>Various <a href="extensions/">extensions</a> are provided (including
<a href="extensions/extra/">extra</a>) to change and/or extend the base syntax.
Additionally, a public <a href="extensions/api/">Extension API</a> is available
to write your own extensions.</p>
</li>
<li>
<p><strong>Output Formats</strong></p>
<p>Python-Markdown can output documents with either HTML or XHTML style tags.
See the <a href="reference/#output_format">Library Reference</a> for details.</p>
</li>
<li>
<p><strong>Command Line Interface</strong></p>
<p>In addition to being a Python Library, a
<a href="cli/">command line script</a> is available for your convenience.</p>
</li>
</ul>
<h2 id="differences">Differences<a class="headerlink" href="#differences" title="Permanent link">¶</a></h2>
<p>While Python-Markdown strives to fully implement markdown as described in the
<a href="https://daringfireball.net/projects/markdown/syntax">syntax rules</a>, the rules
can be interpreted in different ways and different implementations
occasionally vary in their behavior (see the
<a href="https://johnmacfarlane.net/babelmark2/faq.html#what-are-some-examples-of-interesting-divergences-between-implementations">Babelmark FAQ</a>
for some examples). Known and intentional differences found in Python-Markdown
are summarized below:</p>
<ul>
<li>
<p><strong>Middle-Word Emphasis</strong></p>
<p>Python-Markdown defaults to ignoring middle-word emphasis (and strong
emphasis). In other words, <code>some_long_filename.txt</code> will not become
<code>some<em>long</em>filename.txt</code>. This can be switched off if desired. See
the <a href="extensions/legacy_em/">Legacy EM Extension</a> for details.</p>
</li>
<li>
<p><strong>Indentation/Tab Length</strong></p>
<p>The <a href="https://daringfireball.net/projects/markdown/syntax#list">syntax rules</a>
clearly state that when a list item consists of multiple paragraphs, “each
subsequent paragraph in a list item <strong>must</strong> 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.</p>
<p>This applies to any block level elements nested in a list, including
paragraphs, sub-lists, blockquotes, code blocks, etc. They <strong>must</strong> always
be indented by at least four spaces (or one tab) for each level of nesting.</p>
<p>In the event that one would prefer different behavior,
<a href="reference/#tab_length">tab_length</a> 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). Alternatively, a
<a href="https://github.com/Python-Markdown/markdown/wiki/Third-Party-Extensions">third party extension</a> may offer a solution that meets your needs.</p>
</li>
<li>
<p><strong>Consecutive Lists</strong></p>
<p>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 <a href="extensions/sane_lists/">Sane List Extension</a>
is available to provide a less surprising behavior.</p>
</li>
</ul>
<h2 id="support">Support<a class="headerlink" href="#support" title="Permanent link">¶</a></h2>
<p>You may report bugs, ask for help, and discuss various other issues on the <a href="https://github.com/Python-Markdown/markdown/issues">bug tracker</a>.</p>
</div>
</div>
</div>
<div class="sphinxsidebar" role="navigation" aria-label="main navigation">
<div class="sphinxsidebarwrapper">
<h3><a href="index.html">Table Of Contents</a></h3>
<ul>
<li>
<a class="reference internal" href="#python-markdown">Python-Markdown</a>
<ul>
<li>
<a class="reference internal" href="#goals">Goals</a>
</li>
<li>
<a class="reference internal" href="#features">Features</a>
</li>
<li>
<a class="reference internal" href="#differences">Differences</a>
</li>
<li>
<a class="reference internal" href="#support">Support</a>
</li>
</ul>
</li>
</ul>
<h4>Next topic</h4>
<p class="topless">
<a href="install/" title="next page">Installation</a>
</p>
<div role="note" aria-label="source link">
<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="https://github.com/Python-Markdown/markdown/edit/master/docs/index.md">Edit on GitHub</a></li>
</ul>
</div>
<div id="searchbox" style="display: none" role="search">
<h3>Quick search</h3>
<form class="search" action="search.html" method="get">
<div><input type="text" name="q" placeholder="Search docs" /></div>
<div><input type="submit" value="Go" /></div>
</form>
</div>
<script type="text/javascript">$('#searchbox').show(0);</script>
</div>
</div>
<div class="clearer"></div>
</div>
<div class="related" role="navigation" aria-label="related navigation">
<h3>Navigation</h3>
<ul>
<li class="right" style="margin-right: 10px">
<a href="https://github.com/Python-Markdown/markdown" title="View this project on GitHub"><img src="static/github.png" width=16px style="vertical-align: middle; margin-top: -1px" /></a>
</li>
<li class="right" style="margin-right: 10px">
<a href="sitemap.html" title="Sitemap" accesskey="I">index</a>
</li>
<li class="right">
<a href="install/" title="Installation" accesskey="N">next</a> |
</li>
<li><img src="py.png"
alt="icon" style="vertical-align: middle; margin-top: -1px"/></li>
<li class="nav-item nav-item-0">
<a href=".">Python-Markdown 3.8 documentation</a> »
</li>
</ul>
</div>
<div class="footer" role="contentinfo">Copyright © 2010-2023, The Python-Markdown Project.
Created using <a href="https://www.mkdocs.org/">MkDocs</a> 1.6.1.
</div>
<script>var base_url = '.';</script>
<script src="search/main.js"></script>
<!--
MkDocs version : 1.6.1
Docs Build Date UTC : 2025-04-09 17:38:32.428369+00:00
-->
</body>
</html>