/usr/share/doc/python-markdown-doc/docs/extensions/fenced_code_blocks.html is in python-markdown-doc 2.6.9-1.
This file is owned by root:root, with mode 0o644.
The actual contents of the file can be viewed below.
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 | <!DOCTYPE html>
<html>
<head>
<meta charset=utf-8>
<title>Fenced Code Blocks Extension — Python Markdown</title>
<link rel="stylesheet" href="../default.css" type="text/css">
</head>
<body>
<div class="related">
<h3>Navigation</h3>
<ul>
<li class="right" style="margin-right: 10px">
<a href="../siteindex.html" title="General Index">index</a></li>
<li class="right">
<a href="footnotes.html" title="Footnotes Extension"
accesskey="N">next</a> |</li>
<li class="right">
<a href="definition_lists.html" title="Definition Lists Extension"
accesskey="P">previous</a> |</li>
<li><img src="../py.png" alt=""
style="vertical-align: middle; margin-top: -1px"/></li>
<li><a href="../index.html">Python Markdown v2.6.9 documentation</a> »</li>
<li><a href="index.html">Extensions</a> »</li>
<li><a href="fenced_code_blocks.html">Fenced Code Blocks Extension</a> »</li>
</ul>
</div> <!-- .related -->
<div class="document">
<div class="documentwrapper">
<div class="bodywrapper">
<div class="body">
<h1 id="fenced-code-blocks">Fenced Code Blocks<a class="headerlink" href="#fenced-code-blocks" title="Permanent link">¶</a></h1>
<h2 id="summary">Summary<a class="headerlink" href="#summary" title="Permanent link">¶</a></h2>
<p>The Fenced Code Blocks extension adds a secondary way to define code blocks,
which overcomes a few limitations of the indented code blocks.</p>
<p>This extension is included in the standard Markdown library.</p>
<h2 id="syntax">Syntax<a class="headerlink" href="#syntax" title="Permanent link">¶</a></h2>
<p>Fenced Code Blocks are defined using the syntax established in
<a href="http://www.michelf.com/projects/php-markdown/extra/#fenced-code-blocks">PHP Markdown Extra</a>.</p>
<p>Thus, the following text (taken from the above referenced PHP documentation):</p>
<pre><code>This is a paragraph introducing:
~~~~~~~~~~~~~~~~~~~~
a one-line code block
~~~~~~~~~~~~~~~~~~~~
</code></pre>
<p>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.</p>
<div class="admonition warning">
<p class="admonition-title">Warning</p>
<p>Fenced Code Blocks are only supported at the document root level.
Therefore, they cannot be nested inside lists or blockquotes.</p>
</div>
<h3 id="language">Language<a class="headerlink" href="#language" title="Permanent link">¶</a></h3>
<p>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><code></code> element in the output. Therefore, you should
define the language as you would a CSS class - <code>.language</code>. For consistency
with other markdown syntax, the language can <em>optionally</em> be wrapped in curly
brackets:</p>
<pre><code>~~~~{.python}
# python code
~~~~
~~~~.html
<p>HTML Document</p>
~~~~
</code></pre>
<p>The above will output:</p>
<pre><code><pre><code class="python"># python code
</code></pre>
<pre><code class="html">&lt;p&gt;HTML Document&lt;/p&gt;
</code></pre>
</code></pre>
<p><a href="http://github.github.com/github-flavored-markdown/">GitHub</a>‘s backtick (```) syntax is also supported:</p>
<pre><code>```python
# more python code
```
</code></pre>
<h3 id="emphasized-lines">Emphasized Lines<a class="headerlink" href="#emphasized-lines" title="Permanent link">¶</a></h3>
<p>If you would like to have your fenced code blocks highlighted with the
<a href="code_hilite.html">CodeHilite</a> extension, simply enable that extension (remember that
<a href="http://pygments.org/">Pygments</a> is its dependency) and the language of your fenced code blocks
will be passed in and highlighted appropriately.</p>
<p>Similar to the <a href="code_hilite.html#colons">colon</a> syntax of the CodeHilite extension, fenced code blocks
can also have emphasized certain lines of code.</p>
<p>The lines can be specified with PHP Extra’s syntax:</p>
<pre><code>~~~~{.python hl_lines="1 3"}
# This line is emphasized
# This line isn't
# This line is emphasized
~~~~
</code></pre>
<p>… or with GitHub’s:</p>
<pre><code>```python hl_lines="1 3"
# This line is emphasized
# This line isn't
# This line is emphasized
```
</code></pre>
<h2 id="usage">Usage<a class="headerlink" href="#usage" title="Permanent link">¶</a></h2>
<p>See <a href="index.html">Extensions</a> for general extension usage, specify <code>markdown.extensions.fenced_code</code>
as the name of the extension.</p>
<p>This extension does not accept any special configuration options.</p>
</div> <!-- .body -->
</div> <!-- .bodywrapper -->
</div> <!-- .documentwrapper -->
<div class="sphinxsidebar">
<div class="sphinxsidebarwrapper">
<h3>Table Of Contents</h3>
<div class="toc">
<ul>
<li><a href="#fenced-code-blocks">Fenced Code Blocks</a><ul>
<li><a href="#summary">Summary</a></li>
<li><a href="#syntax">Syntax</a><ul>
<li><a href="#language">Language</a></li>
<li><a href="#emphasized-lines">Emphasized Lines</a></li>
</ul>
</li>
<li><a href="#usage">Usage</a></li>
</ul>
</li>
</ul>
</div>
<h4>Previous topic</h4>
<p class="topless"><a href="definition_lists.html"
title="previous chapter">Definition Lists Extension</a></p>
<h4>Next topic</h4>
<p class="topless"><a href="footnotes.html"
title="next chapter">Footnotes Extension</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="fenced_code_blocks.txt"
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="../siteindex.html" title="General Index">index</a></li>
<li class="right">
<a href="footnotes.html" title="Footnotes Extension"
accesskey="N">next</a> |</li>
<li class="right">
<a href="definition_lists.html" title="Definition Lists Extension"
accesskey="P">previous</a> |</li>
<li><img src="../py.png" alt=""
style="vertical-align: middle; margin-top: -1px"/></li>
<li><a href="../index.html">Python Markdown v2.6.9 documentation</a> »</li>
<li><a href="index.html">Extensions</a> »</li>
<li><a href="fenced_code_blocks.html">Fenced Code Blocks Extension</a> »</li>
</ul>
</div> <!-- .related -->
<div class="footer">© 2010-2012 Python Markdown Project</div>
</body>
</html>
|