| 1 |
<!DOCTYPE html> |
| 2 |
<html xmlns="http://www.w3.org/1999/xhtml" xml:lang="en" lang="en"> |
| 3 |
<head> |
| 4 |
<meta charset="utf-8" /> |
| 5 |
<meta name="generator" content="Docutils 0.23: https://docutils.sourceforge.io/" /> |
| 6 |
<meta name="viewport" content="width=device-width, initial-scale=1" /> |
| 7 |
<meta content="reStructuredText, test, parser" name="keywords" /> |
| 8 |
<meta content="A test document, containing at least one example of each reStructuredText construct." lang="en" name="description" xml:lang="en" /> |
| 9 |
<meta name="author" content="David Goodger" /> |
| 10 |
<meta name="author" content="Me" /> |
| 11 |
<meta name="author" content="Myself" /> |
| 12 |
<meta name="author" content="I" /> |
| 13 |
<meta name="dcterms.date" content="Now, or yesterday. Or maybe even before yesterday." /> |
| 14 |
<meta name="dcterms.rights" content="This document has been placed in the public domain. You may do with it as you wish. You may copy, modify, redistribute, reattribute, sell, buy, rent, lease, destroy, or improve it, quote it at length, excerpt, incorporate, collate, fold, staple, or mutilate it, or do anything else to it that your or anyone else's heart desires." /> |
| 15 |
<title>reStructuredText Test Document</title> |
| 16 |
<link rel="schema.dcterms" href="http://purl.org/dc/terms/"/> |
| 17 |
<link rel="stylesheet" href="../input/data/minimal.css" type="text/css" /> |
| 18 |
<link rel="stylesheet" href="../input/data/plain.css" type="text/css" /> |
| 19 |
</head> |
| 20 |
<body class="with-toc"> |
| 21 |
<header> |
| 22 |
<p>Document header</p> |
| 23 |
</header> |
| 24 |
<main id="restructuredtext-test-document"> |
| 25 |
<span id="doctitle"></span> |
| 26 |
<h1 class="title">reStructuredText Test Document</h1> |
| 27 |
<p class="subtitle" id="examples-of-syntax-constructs"><span id="subtitle"></span>Examples of Syntax Constructs</p> |
| 28 |
<dl class="docinfo"> |
| 29 |
<dt class="author">Author<span class="colon">:</span></dt> |
| 30 |
<dd class="author"><p>David Goodger</p></dd> |
| 31 |
<dt class="address">Address<span class="colon">:</span></dt> |
| 32 |
<dd class="address"><pre class="address">123 Example Street |
| 33 |
Example, EX Canada |
| 34 |
A1B 2C3 |
| 35 |
</pre> |
| 36 |
</dd> |
| 37 |
<dt class="contact">Contact<span class="colon">:</span></dt> |
| 38 |
<dd class="contact"><a class="reference external" href="mailto:goodger@python.org">goodger@python.org</a></dd> |
| 39 |
<dt class="authors">Authors<span class="colon">:</span></dt> |
| 40 |
<dd class="authors"><p>Me</p> |
| 41 |
<p>Myself</p> |
| 42 |
<p>I</p> |
| 43 |
</dd> |
| 44 |
<dt class="organization">Organization<span class="colon">:</span></dt> |
| 45 |
<dd class="organization">humankind</dd> |
| 46 |
<dt class="date">Date<span class="colon">:</span></dt> |
| 47 |
<dd class="date">Now, or yesterday. Or maybe even <em>before</em> yesterday.</dd> |
| 48 |
<dt class="status">Status<span class="colon">:</span></dt> |
| 49 |
<dd class="status">This is a "work in progress"</dd> |
| 50 |
<dt class="revision">Revision<span class="colon">:</span></dt> |
| 51 |
<dd class="revision">is managed by a version control system.</dd> |
| 52 |
<dt class="version">Version<span class="colon">:</span></dt> |
| 53 |
<dd class="version">1</dd> |
| 54 |
<dt class="copyright">Copyright<span class="colon">:</span></dt> |
| 55 |
<dd class="copyright">This document has been placed in the public domain. You |
| 56 |
may do with it as you wish. You may copy, modify, |
| 57 |
redistribute, reattribute, sell, buy, rent, lease, |
| 58 |
destroy, or improve it, quote it at length, excerpt, |
| 59 |
incorporate, collate, fold, staple, or mutilate it, or do |
| 60 |
anything else to it that your or anyone else's heart |
| 61 |
desires.</dd> |
| 62 |
<dt class="field-name">field name<span class="colon">:</span></dt> |
| 63 |
<dd class="field-name"><p>This is a "generic bibliographic field".</p> |
| 64 |
</dd> |
| 65 |
<dt class="field-name-2">field name "2"<span class="colon">:</span></dt> |
| 66 |
<dd class="field-name-2"><p>Generic bibliographic fields may contain multiple body elements.</p> |
| 67 |
<p>Like this.</p> |
| 68 |
</dd> |
| 69 |
</dl> |
| 70 |
<div class="topic dedication" role="doc-dedication"> |
| 71 |
<p class="topic-title">Dedication</p> |
| 72 |
<p>For Docutils users & co-developers.</p> |
| 73 |
</div> |
| 74 |
<div class="topic abstract" role="doc-abstract"> |
| 75 |
<p class="topic-title">Abstract</p> |
| 76 |
<p>This is a test document, containing at least one example of each |
| 77 |
reStructuredText construct.</p> |
| 78 |
</div> |
| 79 |
|
| 80 |
|
| 81 |
|
| 82 |
|
| 83 |
|
| 84 |
<nav class="contents" id="table-of-contents" role="doc-toc"> |
| 85 |
<p class="topic-title"><a class="reference internal" href="#top">Table of Contents</a></p> |
| 86 |
<ul class="auto-toc simple"> |
| 87 |
<li><p><a class="reference internal" href="#structural-elements" id="toc-entry-1"><span class="sectnum">1 </span>Structural Elements</a></p> |
| 88 |
<ul class="auto-toc"> |
| 89 |
<li><p><a class="reference internal" href="#section-title" id="toc-entry-2"><span class="sectnum">1.1 </span>Section Title</a></p></li> |
| 90 |
<li><p><a class="reference internal" href="#empty-section" id="toc-entry-3"><span class="sectnum">1.2 </span>Empty Section</a></p></li> |
| 91 |
<li><p><a class="reference internal" href="#transitions" id="toc-entry-4"><span class="sectnum">1.3 </span>Transitions</a></p></li> |
| 92 |
</ul> |
| 93 |
</li> |
| 94 |
<li><p><a class="reference internal" href="#body-elements" id="toc-entry-5"><span class="sectnum">2 </span>Body Elements</a></p> |
| 95 |
<ul class="auto-toc"> |
| 96 |
<li><p><a class="reference internal" href="#paragraphs" id="toc-entry-6"><span class="sectnum">2.1 </span>Paragraphs</a></p> |
| 97 |
<ul class="auto-toc"> |
| 98 |
<li><p><a class="reference internal" href="#inline-markup" id="toc-entry-7"><span class="sectnum">2.1.1 </span>Inline Markup</a></p></li> |
| 99 |
</ul> |
| 100 |
</li> |
| 101 |
<li><p><a class="reference internal" href="#bullet-lists" id="toc-entry-8"><span class="sectnum">2.2 </span>Bullet Lists</a></p></li> |
| 102 |
<li><p><a class="reference internal" href="#enumerated-lists" id="toc-entry-9"><span class="sectnum">2.3 </span>Enumerated Lists</a></p></li> |
| 103 |
<li><p><a class="reference internal" href="#definition-lists" id="toc-entry-10"><span class="sectnum">2.4 </span>Definition Lists</a></p></li> |
| 104 |
<li><p><a class="reference internal" href="#field-lists" id="toc-entry-11"><span class="sectnum">2.5 </span>Field Lists</a></p></li> |
| 105 |
<li><p><a class="reference internal" href="#option-lists" id="toc-entry-12"><span class="sectnum">2.6 </span>Option Lists</a></p></li> |
| 106 |
<li><p><a class="reference internal" href="#literal-blocks" id="toc-entry-13"><span class="sectnum">2.7 </span>Literal Blocks</a></p></li> |
| 107 |
<li><p><a class="reference internal" href="#line-blocks" id="toc-entry-14"><span class="sectnum">2.8 </span>Line Blocks</a></p></li> |
| 108 |
<li><p><a class="reference internal" href="#block-quotes" id="toc-entry-15"><span class="sectnum">2.9 </span>Block Quotes</a></p></li> |
| 109 |
<li><p><a class="reference internal" href="#doctest-blocks" id="toc-entry-16"><span class="sectnum">2.10 </span>Doctest Blocks</a></p></li> |
| 110 |
<li><p><a class="reference internal" href="#footnotes" id="toc-entry-17"><span class="sectnum">2.11 </span>Footnotes</a></p></li> |
| 111 |
<li><p><a class="reference internal" href="#citations" id="toc-entry-18"><span class="sectnum">2.12 </span>Citations</a></p></li> |
| 112 |
<li><p><a class="reference internal" href="#targets" id="toc-entry-19"><span class="sectnum">2.13 </span>Targets</a></p> |
| 113 |
<ul class="auto-toc"> |
| 114 |
<li><p><a class="reference internal" href="#duplicate-target-names-1" id="toc-entry-20"><span class="sectnum">2.13.1 </span>Duplicate Target Names</a></p></li> |
| 115 |
<li><p><a class="reference internal" href="#duplicate-target-names-2" id="toc-entry-21"><span class="sectnum">2.13.2 </span>Duplicate Target Names</a></p></li> |
| 116 |
</ul> |
| 117 |
</li> |
| 118 |
<li><p><a class="reference internal" href="#directives" id="toc-entry-22"><span class="sectnum">2.14 </span>Directives</a></p> |
| 119 |
<ul class="auto-toc"> |
| 120 |
<li><p><a class="reference internal" href="#document-parts" id="toc-entry-23"><span class="sectnum">2.14.1 </span>Document Parts</a></p></li> |
| 121 |
<li><p><a class="reference internal" href="#images-and-figures" id="toc-entry-24"><span class="sectnum">2.14.2 </span>Images and Figures</a></p></li> |
| 122 |
<li><p><a class="reference internal" href="#tables" id="toc-entry-25"><span class="sectnum">2.14.3 </span>Tables</a></p></li> |
| 123 |
<li><p><a class="reference internal" href="#admonitions" id="toc-entry-26"><span class="sectnum">2.14.4 </span>Admonitions</a></p></li> |
| 124 |
<li><p><a class="reference internal" href="#topics-sidebars-and-rubrics" id="toc-entry-27"><span class="sectnum">2.14.5 </span>Topics, Sidebars, and Rubrics</a></p></li> |
| 125 |
<li><p><a class="reference internal" href="#target-footnotes" id="toc-entry-28"><span class="sectnum">2.14.6 </span>Target Footnotes</a></p></li> |
| 126 |
<li><p><a class="reference internal" href="#replacement-text" id="toc-entry-29"><span class="sectnum">2.14.7 </span>Replacement Text</a></p></li> |
| 127 |
<li><p><a class="reference internal" href="#compound-paragraph" id="toc-entry-30"><span class="sectnum">2.14.8 </span>Compound Paragraph</a></p></li> |
| 128 |
<li><p><a class="reference internal" href="#parsed-literal-blocks" id="toc-entry-31"><span class="sectnum">2.14.9 </span>Parsed Literal Blocks</a></p></li> |
| 129 |
<li><p><a class="reference internal" href="#code" id="toc-entry-32"><span class="sectnum">2.14.10 </span>Code</a></p></li> |
| 130 |
<li><p><a class="reference internal" href="#meta" id="toc-entry-33"><span class="sectnum">2.14.11 </span>Meta</a></p></li> |
| 131 |
</ul> |
| 132 |
</li> |
| 133 |
<li><p><a class="reference internal" href="#substitution-definitions" id="toc-entry-34"><span class="sectnum">2.15 </span>Substitution Definitions</a></p></li> |
| 134 |
<li><p><a class="reference internal" href="#comments" id="toc-entry-35"><span class="sectnum">2.16 </span>Comments</a></p></li> |
| 135 |
<li><p><a class="reference internal" href="#raw-text" id="toc-entry-36"><span class="sectnum">2.17 </span>Raw text</a></p></li> |
| 136 |
<li><p><a class="reference internal" href="#container" id="toc-entry-37"><span class="sectnum">2.18 </span>Container</a></p></li> |
| 137 |
<li><p><a class="reference internal" href="#colspanning-tables" id="toc-entry-38"><span class="sectnum">2.19 </span>Colspanning tables</a></p></li> |
| 138 |
<li><p><a class="reference internal" href="#rowspanning-tables" id="toc-entry-39"><span class="sectnum">2.20 </span>Rowspanning tables</a></p></li> |
| 139 |
<li><p><a class="reference internal" href="#complex-tables" id="toc-entry-40"><span class="sectnum">2.21 </span>Complex tables</a></p></li> |
| 140 |
<li><p><a class="reference internal" href="#list-tables" id="toc-entry-41"><span class="sectnum">2.22 </span>List Tables</a></p></li> |
| 141 |
<li><p><a class="reference internal" href="#custom-roles" id="toc-entry-42"><span class="sectnum">2.23 </span>Custom Roles</a></p></li> |
| 142 |
</ul> |
| 143 |
</li> |
| 144 |
<li><p><a class="reference internal" href="#differences-to-the-html4css1-writer" id="toc-entry-43"><span class="sectnum">3 </span>Differences to the <cite>html4css1</cite> Writer</a></p> |
| 145 |
<ul class="auto-toc"> |
| 146 |
<li><p><a class="reference internal" href="#field-list-rendering" id="toc-entry-44"><span class="sectnum">3.1 </span>Field List Rendering</a></p></li> |
| 147 |
<li><p><a class="reference internal" href="#styling-with-class-arguments" id="toc-entry-45"><span class="sectnum">3.2 </span>Styling with Class Arguments</a></p> |
| 148 |
<ul class="auto-toc"> |
| 149 |
<li><p><a class="reference internal" href="#description-lists" id="toc-entry-46"><span class="sectnum">3.2.1 </span>Description Lists</a></p></li> |
| 150 |
<li><p><a class="reference internal" href="#details-disclosure-elements" id="toc-entry-47"><span class="sectnum">3.2.2 </span>Details disclosure elements</a></p></li> |
| 151 |
<li><p><a class="reference internal" href="#field-list-variants" id="toc-entry-48"><span class="sectnum">3.2.3 </span>Field List Variants</a></p></li> |
| 152 |
<li><p><a class="reference internal" href="#table-variants" id="toc-entry-49"><span class="sectnum">3.2.4 </span>Table Variants</a></p></li> |
| 153 |
<li><p><a class="reference internal" href="#numbered-figures" id="toc-entry-50"><span class="sectnum">3.2.5 </span>Numbered Figures</a></p></li> |
| 154 |
</ul> |
| 155 |
</li> |
| 156 |
<li><p><a class="reference internal" href="#text-level-semantics" id="toc-entry-51"><span class="sectnum">3.3 </span>Text-Level Semantics</a></p></li> |
| 157 |
<li><p><a class="reference internal" href="#indicating-edits" id="toc-entry-52"><span class="sectnum">3.4 </span>Indicating Edits</a></p></li> |
| 158 |
<li><p><a class="reference internal" href="#svg-images" id="toc-entry-53"><span class="sectnum">3.5 </span>SVG Images</a></p></li> |
| 159 |
</ul> |
| 160 |
</li> |
| 161 |
<li><p><a class="reference internal" href="#error-handling" id="toc-entry-54"><span class="sectnum">4 </span>Error Handling</a></p></li> |
| 162 |
</ul> |
| 163 |
</nav> |
| 164 |
<section id="structural-elements"> |
| 165 |
<h2><a class="toc-backref" href="#toc-entry-1" role="doc-backlink"><span class="sectnum">1 </span>Structural Elements</a></h2> |
| 166 |
<section id="section-title"> |
| 167 |
<h3><a class="toc-backref" href="#toc-entry-2" role="doc-backlink"><span class="sectnum">1.1 </span>Section Title</a></h3> |
| 168 |
<p class="section-subtitle" id="section-subtitle">Section Subtitle</p> |
| 169 |
<p>Lone subsections are converted to a section subtitle by a transform |
| 170 |
activated with the <span class="docutils literal"><span class="pre">--section-subtitles</span></span> command line option or the |
| 171 |
<span class="docutils literal"><span class="pre">sectsubtitle-xform</span></span> configuration value.</p> |
| 172 |
</section> |
| 173 |
<section id="empty-section"> |
| 174 |
<h3><a class="toc-backref" href="#toc-entry-3" role="doc-backlink"><span class="sectnum">1.2 </span>Empty Section</a></h3> |
| 175 |
</section> |
| 176 |
<section id="transitions"> |
| 177 |
<h3><a class="toc-backref" href="#toc-entry-4" role="doc-backlink"><span class="sectnum">1.3 </span>Transitions</a></h3> |
| 178 |
<p>Here's a transition:</p> |
| 179 |
<hr class="docutils" /> |
| 180 |
<p>It divides the section. Transitions may also occur between sections:</p> |
| 181 |
</section> |
| 182 |
</section> |
| 183 |
<hr class="docutils" /> |
| 184 |
<section id="body-elements"> |
| 185 |
<h2><a class="toc-backref" href="#toc-entry-5" role="doc-backlink"><span class="sectnum">2 </span>Body Elements</a></h2> |
| 186 |
<section id="paragraphs"> |
| 187 |
<h3><a class="toc-backref" href="#toc-entry-6" role="doc-backlink"><span class="sectnum">2.1 </span>Paragraphs</a></h3> |
| 188 |
<p>A paragraph.</p> |
| 189 |
<section id="inline-markup"> |
| 190 |
<h4><a class="toc-backref" href="#toc-entry-7" role="doc-backlink"><span class="sectnum">2.1.1 </span>Inline Markup</a></h4> |
| 191 |
<p>Paragraphs contain text and may contain inline markup: <em>emphasis</em>, |
| 192 |
<strong>strong emphasis</strong>, <span class="docutils literal">inline literals</span>, standalone hyperlinks |
| 193 |
(<a class="reference external" href="http://www.python.org">http://www.python.org</a>), external hyperlinks (<a class="reference external" href="http://www.python.org/">Python</a> <a class="brackets" href="#footnote-7" id="footnote-reference-18" role="doc-noteref"><span class="fn-bracket">[</span>7<span class="fn-bracket">]</span></a>), internal |
| 194 |
cross-references (<a class="reference internal" href="#example">example</a>), external hyperlinks with embedded URIs |
| 195 |
(<a class="reference external" href="http://www.python.org">Python web site</a>), <a class="reference external" href="http://www.python.org/">anonymous hyperlink |
| 196 |
references</a> <a class="brackets" href="#footnote-7" id="footnote-reference-27" role="doc-noteref"><span class="fn-bracket">[</span>7<span class="fn-bracket">]</span></a> (<a class="reference external" href="https://docutils.sourceforge.io/">a second reference</a> <a class="brackets" href="#footnote-14" id="footnote-reference-28" role="doc-noteref"><span class="fn-bracket">[</span>14<span class="fn-bracket">]</span></a>), footnote references (manually |
| 197 |
numbered <a class="brackets" href="#footnote-1" id="footnote-reference-1" role="doc-noteref"><span class="fn-bracket">[</span>1<span class="fn-bracket">]</span></a>, anonymous auto-numbered <a class="brackets" href="#footnote-2" id="footnote-reference-2" role="doc-noteref"><span class="fn-bracket">[</span>3<span class="fn-bracket">]</span></a>, labeled auto-numbered |
| 198 |
<a class="brackets" href="#label" id="footnote-reference-3" role="doc-noteref"><span class="fn-bracket">[</span>2<span class="fn-bracket">]</span></a>, or symbolic <a class="brackets" href="#footnote-3" id="footnote-reference-4" role="doc-noteref"><span class="fn-bracket">[</span>*<span class="fn-bracket">]</span></a>), citation references (see <a class="citation-reference" href="#cit2002" id="citation-reference-1" role="doc-biblioref">[CIT2002]</a>), |
| 199 |
substitution references (<img alt="EXAMPLE" src="../../../docs/user/rst/images/biohazard.png" /> & |
| 200 |
a <em>trimmed heart</em> <span class="docutils literal">(U+2665):</span>♥), and <span class="target" id="inline-hyperlink-targets">inline hyperlink targets</span> |
| 201 |
(see <a class="reference internal" href="#targets">Targets</a> below for a reference back to here). Character-level |
| 202 |
inline markup is also possible (although exceedingly ugly!) in <em>re</em><span class="docutils literal">Structured</span><em>Text</em>. Problems are indicated by <a href="#system-message-1"><span class="problematic" id="problematic-1">|problematic|</span></a> text |
| 203 |
(generated by processing errors; this one is intentional). Here is a |
| 204 |
reference to the <a class="reference internal" href="#doctitle">doctitle</a> and the <a class="reference internal" href="#subtitle">subtitle</a>.</p> |
| 205 |
<p>The default role for interpreted text is <cite>Title Reference</cite>. Here are |
| 206 |
some explicit interpreted text roles: a PEP reference (<a class="reference external" href="https://peps.python.org/pep-0287">PEP 287</a>); an |
| 207 |
RFC reference (<a class="reference external" href="https://tools.ietf.org/html/rfc2822.html">RFC 2822</a>); an abbreviation (<abbr>abb.</abbr>), an acronym |
| 208 |
(<abbr>reST</abbr>), code (<code>print "hello world"</code>); a <sub>subscript</sub>; |
| 209 |
a <sup>superscript</sup> and explicit roles for <cite>Docutils</cite>' |
| 210 |
<em>standard</em> <strong>inline</strong> <span class="docutils literal">markup</span>.</p> |
| 211 |
|
| 212 |
<p>Let's test wrapping and whitespace significance in inline literals: |
| 213 |
<span class="docutils literal">This is an example of <span class="pre">--inline-literal</span> <span class="pre">--text,</span> <span class="pre">--including</span> <span class="pre">some--</span> <span class="pre">strangely--hyphenated-words.</span> <span class="pre">Adjust-the-width-of-your-browser-window</span> to see how the text is wrapped. <span class="pre">--</span> <span class="pre">----</span> <span class="pre">--------</span> Now note the spacing between the words of this sentence (words should be grouped in pairs).</span></p> |
| 214 |
<p>If the <span class="docutils literal"><span class="pre">--pep-references</span></span> option was supplied, there should be a |
| 215 |
live link to PEP 258 here.</p> |
| 216 |
</section> |
| 217 |
</section> |
| 218 |
<section id="bullet-lists"> |
| 219 |
<h3><a class="toc-backref" href="#toc-entry-8" role="doc-backlink"><span class="sectnum">2.2 </span>Bullet Lists</a></h3> |
| 220 |
<ul> |
| 221 |
<li><p>A bullet list</p> |
| 222 |
<ul class="simple"> |
| 223 |
<li><p>Nested bullet list.</p></li> |
| 224 |
<li><p>Nested item 2.</p></li> |
| 225 |
</ul> |
| 226 |
</li> |
| 227 |
<li><p>Item 2.</p> |
| 228 |
<p>Paragraph 2 of item 2.</p> |
| 229 |
<ul class="simple"> |
| 230 |
<li><p>Nested bullet list.</p></li> |
| 231 |
<li><p>Nested item 2.</p> |
| 232 |
<ul> |
| 233 |
<li><p>Third level.</p></li> |
| 234 |
<li><p>Item 2.</p></li> |
| 235 |
</ul> |
| 236 |
</li> |
| 237 |
<li><p>Nested item 3.</p></li> |
| 238 |
<li><p>This nested list should be compacted by the HTML writer.</p> |
| 239 |
<span class="target" id="target"></span> |
| 240 |
</li> |
| 241 |
</ul> |
| 242 |
</li> |
| 243 |
</ul> |
| 244 |
</section> |
| 245 |
<section id="enumerated-lists"> |
| 246 |
<h3><a class="toc-backref" href="#toc-entry-9" role="doc-backlink"><span class="sectnum">2.3 </span>Enumerated Lists</a></h3> |
| 247 |
<ol class="arabic"> |
| 248 |
<li><p>Arabic numerals.</p> |
| 249 |
<ol class="loweralpha simple"> |
| 250 |
<li><p>lower alpha)</p> |
| 251 |
<ol class="lowerroman simple"> |
| 252 |
<li><p>(lower roman)</p> |
| 253 |
<ol class="upperalpha simple"> |
| 254 |
<li><p>upper alpha.</p> |
| 255 |
<ol class="upperroman simple"> |
| 256 |
<li><p>upper roman)</p></li> |
| 257 |
</ol> |
| 258 |
</li> |
| 259 |
</ol> |
| 260 |
</li> |
| 261 |
</ol> |
| 262 |
</li> |
| 263 |
</ol> |
| 264 |
</li> |
| 265 |
<li><p>Lists that don't start at 1:</p> |
| 266 |
<ol class="arabic simple" start="3"> |
| 267 |
<li><p>Three</p></li> |
| 268 |
<li><p>Four</p></li> |
| 269 |
</ol> |
| 270 |
<ol class="upperalpha simple" start="3"> |
| 271 |
<li><p>C</p></li> |
| 272 |
<li><p>D</p></li> |
| 273 |
</ol> |
| 274 |
<ol class="lowerroman simple" start="3"> |
| 275 |
<li><p>iii</p></li> |
| 276 |
<li><p>iv</p></li> |
| 277 |
</ol> |
| 278 |
</li> |
| 279 |
</ol> |
| 280 |
</section> |
| 281 |
<section id="definition-lists"> |
| 282 |
<h3><a class="toc-backref" href="#toc-entry-10" role="doc-backlink"><span class="sectnum">2.4 </span>Definition Lists</a></h3> |
| 283 |
<dl> |
| 284 |
<dt>Term</dt> |
| 285 |
<dd><p>Definition</p> |
| 286 |
</dd> |
| 287 |
<dt>Term<span class="classifier">classifier</span></dt> |
| 288 |
<dd><p>Definition paragraph 1.</p> |
| 289 |
<p>Definition paragraph 2.</p> |
| 290 |
</dd> |
| 291 |
<dt>Term</dt> |
| 292 |
<dd><p>Definition</p> |
| 293 |
</dd> |
| 294 |
<dt>Term<span class="classifier">classifier one</span><span class="classifier">classifier two</span></dt> |
| 295 |
<dd><p>Definition</p> |
| 296 |
</dd> |
| 297 |
</dl> |
| 298 |
</section> |
| 299 |
<section id="field-lists"> |
| 300 |
<h3><a class="toc-backref" href="#toc-entry-11" role="doc-backlink"><span class="sectnum">2.5 </span>Field Lists</a></h3> |
| 301 |
<dl class="field-list"> |
| 302 |
<dt>what<span class="colon">:</span></dt> |
| 303 |
<dd><p>Field lists map field names to field bodies, like database |
| 304 |
records. They are often part of an extension syntax. They are |
| 305 |
an unambiguous variant of RFC 2822 fields.</p> |
| 306 |
</dd> |
| 307 |
<dt>how arg1 arg2<span class="colon">:</span></dt> |
| 308 |
<dd><p>The field marker is a colon, the field name, and a colon.</p> |
| 309 |
<p>The field body may contain one or more body elements, indented |
| 310 |
relative to the field marker.</p> |
| 311 |
</dd> |
| 312 |
<dt>credits<span class="colon">:</span></dt> |
| 313 |
<dd><p class="credits">This paragraph has the <cite>credits</cite> class set. (This is actually not |
| 314 |
about credits but just for ensuring that the class attribute |
| 315 |
doesn't get stripped away.)</p> |
| 316 |
</dd> |
| 317 |
</dl> |
| 318 |
</section> |
| 319 |
<section id="option-lists"> |
| 320 |
<h3><a class="toc-backref" href="#toc-entry-12" role="doc-backlink"><span class="sectnum">2.6 </span>Option Lists</a></h3> |
| 321 |
<p>For listing command-line options:</p> |
| 322 |
<dl class="option-list"> |
| 323 |
<dt><kbd><span class="option">-a</span></kbd></dt> |
| 324 |
<dd><p>command-line option "a"</p> |
| 325 |
</dd> |
| 326 |
<dt><kbd><span class="option">-b <var>file</var></span></kbd></dt> |
| 327 |
<dd><p>options can have arguments |
| 328 |
and long descriptions</p> |
| 329 |
</dd> |
| 330 |
<dt><kbd><span class="option">--long</span></kbd></dt> |
| 331 |
<dd><p>options can be long, too</p> |
| 332 |
</dd> |
| 333 |
<dt><kbd><span class="option">--input=<var>file</var></span></kbd></dt> |
| 334 |
<dd><p>long options can also have arguments</p> |
| 335 |
</dd> |
| 336 |
<dt><kbd><span class="option">/V</span></kbd></dt> |
| 337 |
<dd><p>DOS/VMS-style option</p> |
| 338 |
</dd> |
| 339 |
<dt><kbd><span class="option">--very-long-option</span></kbd></dt> |
| 340 |
<dd><p>The description can also start on the next line.</p> |
| 341 |
<p>The description may contain multiple body elements, |
| 342 |
regardless of where it starts.</p> |
| 343 |
</dd> |
| 344 |
<dt><kbd><span class="option">-x</span>, <span class="option">-y</span>, <span class="option">-z</span></kbd></dt> |
| 345 |
<dd><p>Multiple options are an "option group".</p> |
| 346 |
</dd> |
| 347 |
<dt><kbd><span class="option">-v</span>, <span class="option">--verbose</span></kbd></dt> |
| 348 |
<dd><p>Commonly-seen: short & long options.</p> |
| 349 |
</dd> |
| 350 |
<dt><kbd><span class="option">-1 <var>file</var></span>, <span class="option">--one=<var>file</var></span>, <span class="option">--two <var>file</var></span></kbd></dt> |
| 351 |
<dd><p>Multiple options with arguments.</p> |
| 352 |
</dd> |
| 353 |
<dt><kbd><span class="option">-f <var><[path]file></var></span></kbd></dt> |
| 354 |
<dd><p>Option argumens must start with a letter |
| 355 |
or be wrapped in angle brackets.</p> |
| 356 |
</dd> |
| 357 |
<dt><kbd><span class="option">-d <var><src dest></var></span></kbd></dt> |
| 358 |
<dd><p>Angle brackets are also required if an |
| 359 |
option expects more than one argument.</p> |
| 360 |
</dd> |
| 361 |
</dl> |
| 362 |
<p>There must be at least two spaces between the option and the |
| 363 |
description.</p> |
| 364 |
</section> |
| 365 |
<section id="literal-blocks"> |
| 366 |
<h3><a class="toc-backref" href="#toc-entry-13" role="doc-backlink"><span class="sectnum">2.7 </span>Literal Blocks</a></h3> |
| 367 |
<p>Literal blocks are indicated with a double-colon ("::") at the end of |
| 368 |
the preceding paragraph (over there <span class="docutils literal"><span class="pre">--></span></span>). They can be indented:</p> |
| 369 |
<pre class="literal-block">if literal_block: |
| 370 |
text = 'is left as-is' |
| 371 |
spaces_and_linebreaks = 'are preserved' |
| 372 |
markup_processing = None</pre> |
| 373 |
<p>Or they can be quoted without indentation:</p> |
| 374 |
<pre class="literal-block">>> Great idea! |
| 375 |
> |
| 376 |
> Why didn't I think of that?</pre> |
| 377 |
</section> |
| 378 |
<section id="line-blocks"> |
| 379 |
<h3><a class="toc-backref" href="#toc-entry-14" role="doc-backlink"><span class="sectnum">2.8 </span>Line Blocks</a></h3> |
| 380 |
<p>This section tests line blocks. Line blocks are body elements which |
| 381 |
consist of lines and other line blocks. Nested line blocks cause |
| 382 |
indentation.</p> |
| 383 |
<div class="line-block"> |
| 384 |
<div class="line">This is a line block. It ends with a blank line.</div> |
| 385 |
<div class="line-block"> |
| 386 |
<div class="line">New lines begin with a vertical bar ("|").</div> |
| 387 |
<div class="line">Line breaks and initial indent are significant, and preserved.</div> |
| 388 |
<div class="line-block"> |
| 389 |
<div class="line">Continuation lines are also possible. A long line that is intended |
| 390 |
to wrap should begin with a space in place of the vertical bar.</div> |
| 391 |
</div> |
| 392 |
<div class="line">The left edge of a continuation line need not be aligned with |
| 393 |
the left edge of the text above it.</div> |
| 394 |
</div> |
| 395 |
</div> |
| 396 |
<div class="line-block"> |
| 397 |
<div class="line">This is a second line block.</div> |
| 398 |
<div class="line"><br /></div> |
| 399 |
<div class="line">Blank lines are permitted internally, but they must begin with a "|".</div> |
| 400 |
</div> |
| 401 |
<p>Another line block, surrounded by paragraphs:</p> |
| 402 |
<div class="line-block"> |
| 403 |
<div class="line">And it's no good waiting by the window</div> |
| 404 |
<div class="line">It's no good waiting for the sun</div> |
| 405 |
<div class="line">Please believe me, the things you dream of</div> |
| 406 |
<div class="line">They don't fall in the lap of no-one</div> |
| 407 |
</div> |
| 408 |
<p>Take it away, Eric the Orchestra Leader!</p> |
| 409 |
<blockquote> |
| 410 |
<div class="line-block"> |
| 411 |
<div class="line">A one, two, a one two three four</div> |
| 412 |
<div class="line"><br /></div> |
| 413 |
<div class="line">Half a bee, philosophically,</div> |
| 414 |
<div class="line-block"> |
| 415 |
<div class="line">must, <em>ipso facto</em>, half not be.</div> |
| 416 |
</div> |
| 417 |
<div class="line">But half the bee has got to be,</div> |
| 418 |
<div class="line-block"> |
| 419 |
<div class="line"><em>vis a vis</em> its entity. D'you see?</div> |
| 420 |
<div class="line"><br /></div> |
| 421 |
</div> |
| 422 |
<div class="line">But can a bee be said to be</div> |
| 423 |
<div class="line-block"> |
| 424 |
<div class="line">or not to be an entire bee,</div> |
| 425 |
<div class="line-block"> |
| 426 |
<div class="line">when half the bee is not a bee,</div> |
| 427 |
<div class="line-block"> |
| 428 |
<div class="line">due to some ancient injury?</div> |
| 429 |
<div class="line"><br /></div> |
| 430 |
</div> |
| 431 |
</div> |
| 432 |
</div> |
| 433 |
<div class="line">Singing...</div> |
| 434 |
</div> |
| 435 |
</blockquote> |
| 436 |
<p>A line block, like the following poem by Christian Morgenstern, can |
| 437 |
also be centre-aligned:</p> |
| 438 |
<div class="align-center line-block" lang="de"> |
| 439 |
<div class="line"><strong>Die Trichter</strong></div> |
| 440 |
<div class="line"><br /></div> |
| 441 |
<div class="line">Zwei Trichter wandeln durch die Nacht.</div> |
| 442 |
<div class="line">Durch ihres Rumpfs verengten Schacht</div> |
| 443 |
<div class="line">fließt weißes Mondlicht</div> |
| 444 |
<div class="line">still und heiter</div> |
| 445 |
<div class="line">auf ihren</div> |
| 446 |
<div class="line">Waldweg</div> |
| 447 |
<div class="line">u. s.</div> |
| 448 |
<div class="line">w.</div> |
| 449 |
<div class="line"><br /></div> |
| 450 |
</div> |
| 451 |
</section> |
| 452 |
<section id="block-quotes"> |
| 453 |
<h3><a class="toc-backref" href="#toc-entry-15" role="doc-backlink"><span class="sectnum">2.9 </span>Block Quotes</a></h3> |
| 454 |
<p>Block quotes consist of indented body elements:</p> |
| 455 |
<blockquote> |
| 456 |
<p>My theory by A. Elk. Brackets Miss, brackets. This theory goes |
| 457 |
as follows and begins now. All brontosauruses are thin at one |
| 458 |
end, much much thicker in the middle and then thin again at the |
| 459 |
far end. That is my theory, it is mine, and belongs to me and I |
| 460 |
own it, and what it is too.</p> |
| 461 |
<p class="attribution">—Anne Elk (Miss)</p> |
| 462 |
</blockquote> |
| 463 |
<p>The language of a quote (like any other object) can be specified by |
| 464 |
a class attribute:</p> |
| 465 |
|
| 466 |
<blockquote lang="fr"> |
| 467 |
<p>ReStructuredText est un langage de balisage léger utilisé |
| 468 |
notamment dans la documentation du langage Python.</p> |
| 469 |
</blockquote> |
| 470 |
</section> |
| 471 |
<section id="doctest-blocks"> |
| 472 |
<h3><a class="toc-backref" href="#toc-entry-16" role="doc-backlink"><span class="sectnum">2.10 </span>Doctest Blocks</a></h3> |
| 473 |
<pre class="code python doctest">>>> print 'Python-specific usage examples; begun with ">>>"' |
| 474 |
Python-specific usage examples; begun with ">>>" |
| 475 |
>>> print '(cut and pasted from interactive Python sessions)' |
| 476 |
(cut and pasted from interactive Python sessions) |
| 477 |
</pre> |
| 478 |
</section> |
| 479 |
<section id="footnotes"> |
| 480 |
<h3><a class="toc-backref" href="#toc-entry-17" role="doc-backlink"><span class="sectnum">2.11 </span>Footnotes</a></h3> |
| 481 |
<aside class="footnote-list brackets"> |
| 482 |
<aside class="footnote brackets" id="footnote-1" role="doc-footnote"> |
| 483 |
<span class="label"><span class="fn-bracket">[</span>1<span class="fn-bracket">]</span></span> |
| 484 |
<span class="backrefs">(<a role="doc-backlink" href="#footnote-reference-1">1</a>,<a role="doc-backlink" href="#footnote-reference-5">2</a>,<a role="doc-backlink" href="#footnote-reference-9">3</a>)</span> |
| 485 |
<p>A footnote contains body elements, consistently indented by at |
| 486 |
least 1 space.</p> |
| 487 |
<p>This is the footnote's second paragraph.</p> |
| 488 |
</aside> |
| 489 |
<aside class="footnote brackets" id="label" role="doc-footnote"> |
| 490 |
<span class="label"><span class="fn-bracket">[</span>2<span class="fn-bracket">]</span></span> |
| 491 |
<span class="backrefs">(<a role="doc-backlink" href="#footnote-reference-3">1</a>,<a role="doc-backlink" href="#footnote-reference-6">2</a>)</span> |
| 492 |
<p>Footnotes may be numbered, either manually (as in <a class="brackets" href="#footnote-1" id="footnote-reference-5" role="doc-noteref"><span class="fn-bracket">[</span>1<span class="fn-bracket">]</span></a>) or |
| 493 |
automatically using a "#"-prefixed label. This footnote has a |
| 494 |
label so it can be referred to from multiple places, both as a |
| 495 |
footnote reference (<a class="brackets" href="#label" id="footnote-reference-6" role="doc-noteref"><span class="fn-bracket">[</span>2<span class="fn-bracket">]</span></a>) and as a <a class="reference internal" href="#label">hyperlink reference</a>.</p> |
| 496 |
</aside> |
| 497 |
<aside class="footnote brackets" id="footnote-2" role="doc-footnote"> |
| 498 |
<span class="label"><span class="fn-bracket">[</span><a role="doc-backlink" href="#footnote-reference-2">3</a><span class="fn-bracket">]</span></span> |
| 499 |
<p>This footnote is numbered automatically and anonymously using a |
| 500 |
label of "#" only.</p> |
| 501 |
<p>This is the second paragraph.</p> |
| 502 |
<p>And this is the third paragraph.</p> |
| 503 |
</aside> |
| 504 |
<aside class="footnote brackets" id="footnote-3" role="doc-footnote"> |
| 505 |
<span class="label"><span class="fn-bracket">[</span><a role="doc-backlink" href="#footnote-reference-4">*</a><span class="fn-bracket">]</span></span> |
| 506 |
<p>Footnotes may also use symbols, specified with a "*" label. |
| 507 |
Here's a reference to the next footnote: <a class="brackets" href="#footnote-4" id="footnote-reference-7" role="doc-noteref"><span class="fn-bracket">[</span>†<span class="fn-bracket">]</span></a>.</p> |
| 508 |
</aside> |
| 509 |
<aside class="footnote brackets" id="footnote-4" role="doc-footnote"> |
| 510 |
<span class="label"><span class="fn-bracket">[</span><a role="doc-backlink" href="#footnote-reference-7">†</a><span class="fn-bracket">]</span></span> |
| 511 |
<p>This footnote shows the next symbol in the sequence.</p> |
| 512 |
</aside> |
| 513 |
<aside class="footnote brackets" id="footnote-5" role="doc-footnote"> |
| 514 |
<span class="label"><span class="fn-bracket">[</span>4<span class="fn-bracket">]</span></span> |
| 515 |
<p>Here's an unreferenced footnote, with a reference to a |
| 516 |
nonexistent footnote: <a href="#system-message-2"><span class="problematic" id="footnote-reference-8">[5]_</span></a>.</p> |
| 517 |
</aside> |
| 518 |
</aside> |
| 519 |
</section> |
| 520 |
<section id="citations"> |
| 521 |
<h3><a class="toc-backref" href="#toc-entry-18" role="doc-backlink"><span class="sectnum">2.12 </span>Citations</a></h3> |
| 522 |
<div role="list" class="citation-list"> |
| 523 |
<div class="citation" id="cit2002" role="doc-biblioentry"> |
| 524 |
<span class="label"><span class="fn-bracket">[</span>CIT2002<span class="fn-bracket">]</span></span> |
| 525 |
<span class="backrefs">(<a role="doc-backlink" href="#citation-reference-1">1</a>,<a role="doc-backlink" href="#citation-reference-2">2</a>)</span> |
| 526 |
<p>Citations are text-labeled footnotes. They may be |
| 527 |
rendered separately and differently from footnotes.</p> |
| 528 |
</div> |
| 529 |
</div> |
| 530 |
<p>Here's a reference to the above, <a class="citation-reference" href="#cit2002" id="citation-reference-2" role="doc-biblioref">[CIT2002]</a>, and a <a href="#system-message-3"><span class="problematic" id="citation-reference-3">[nonexistent]_</span></a> |
| 531 |
citation.</p> |
| 532 |
</section> |
| 533 |
<section id="targets"> |
| 534 |
<span id="another-target"></span><h3><a class="toc-backref" href="#toc-entry-19" role="doc-backlink"><span class="sectnum">2.13 </span>Targets</a></h3> |
| 535 |
<p id="example">This paragraph is pointed to by the explicit "example" target. A |
| 536 |
reference can be found under <a class="reference internal" href="#inline-markup">Inline Markup</a>, above. <a class="reference internal" href="#inline-hyperlink-targets">Inline |
| 537 |
hyperlink targets</a> are also possible.</p> |
| 538 |
<p>Section headers are implicit targets, referred to by name. See |
| 539 |
<a class="reference internal" href="#targets">Targets</a>, which is a subsection of <a class="reference internal" href="#body-elements">Body Elements</a>.</p> |
| 540 |
<p>Explicit external targets are interpolated into references such as |
| 541 |
"<a class="reference external" href="http://www.python.org/">Python</a> <a class="brackets" href="#footnote-7" id="footnote-reference-19" role="doc-noteref"><span class="fn-bracket">[</span>7<span class="fn-bracket">]</span></a>".</p> |
| 542 |
<p>Targets may be indirect and anonymous. Thus <a class="reference internal" href="#targets">this phrase</a> may also |
| 543 |
refer to the <a class="reference internal" href="#targets">Targets</a> section.</p> |
| 544 |
<p>Here's a <a href="#system-message-4"><span class="problematic" id="problematic-2">`hyperlink reference without a target`_</span></a>, which generates an |
| 545 |
error.</p> |
| 546 |
<section id="duplicate-target-names-1"> |
| 547 |
<h4><a class="toc-backref" href="#toc-entry-20" role="doc-backlink"><span class="sectnum">2.13.1 </span>Duplicate Target Names</a></h4> |
| 548 |
<p>Duplicate names in section headers or other implicit targets will |
| 549 |
generate "info" (level-1) system messages. Duplicate names in |
| 550 |
explicit targets will generate "warning" (level-2) system messages.</p> |
| 551 |
</section> |
| 552 |
<section id="duplicate-target-names-2"> |
| 553 |
<h4><a class="toc-backref" href="#toc-entry-21" role="doc-backlink"><span class="sectnum">2.13.2 </span>Duplicate Target Names</a></h4> |
| 554 |
<p>Since there are two "Duplicate Target Names" section headers, we |
| 555 |
cannot uniquely refer to either of them by name. If we try to (like |
| 556 |
this: <a href="#system-message-5"><span class="problematic" id="problematic-3">`Duplicate Target Names`_</span></a>), an error is generated.</p> |
| 557 |
</section> |
| 558 |
</section> |
| 559 |
<section id="directives"> |
| 560 |
<h3><a class="toc-backref" href="#toc-entry-22" role="doc-backlink"><span class="sectnum">2.14 </span>Directives</a></h3> |
| 561 |
<nav class="contents local" id="contents"> |
| 562 |
<ul class="auto-toc simple"> |
| 563 |
<li><p><a class="reference internal" href="#document-parts" id="toc-entry-55"><span class="sectnum">2.14.1 </span>Document Parts</a></p></li> |
| 564 |
<li><p><a class="reference internal" href="#images-and-figures" id="toc-entry-56"><span class="sectnum">2.14.2 </span>Images and Figures</a></p></li> |
| 565 |
<li><p><a class="reference internal" href="#tables" id="toc-entry-57"><span class="sectnum">2.14.3 </span>Tables</a></p></li> |
| 566 |
<li><p><a class="reference internal" href="#admonitions" id="toc-entry-58"><span class="sectnum">2.14.4 </span>Admonitions</a></p></li> |
| 567 |
<li><p><a class="reference internal" href="#topics-sidebars-and-rubrics" id="toc-entry-59"><span class="sectnum">2.14.5 </span>Topics, Sidebars, and Rubrics</a></p></li> |
| 568 |
<li><p><a class="reference internal" href="#target-footnotes" id="toc-entry-60"><span class="sectnum">2.14.6 </span>Target Footnotes</a></p></li> |
| 569 |
<li><p><a class="reference internal" href="#replacement-text" id="toc-entry-61"><span class="sectnum">2.14.7 </span>Replacement Text</a></p></li> |
| 570 |
<li><p><a class="reference internal" href="#compound-paragraph" id="toc-entry-62"><span class="sectnum">2.14.8 </span>Compound Paragraph</a></p></li> |
| 571 |
<li><p><a class="reference internal" href="#parsed-literal-blocks" id="toc-entry-63"><span class="sectnum">2.14.9 </span>Parsed Literal Blocks</a></p></li> |
| 572 |
<li><p><a class="reference internal" href="#code" id="toc-entry-64"><span class="sectnum">2.14.10 </span>Code</a></p></li> |
| 573 |
<li><p><a class="reference internal" href="#meta" id="toc-entry-65"><span class="sectnum">2.14.11 </span>Meta</a></p></li> |
| 574 |
</ul> |
| 575 |
</nav> |
| 576 |
<p>These are just a sample of the many reStructuredText Directives. For |
| 577 |
others, please see <a class="reference external" href="https://docutils.sourceforge.io/docs/ref/rst/directives.html">reStructuredText Directives</a> <a class="brackets" href="#footnote-15" id="footnote-reference-29" role="doc-noteref"><span class="fn-bracket">[</span>15<span class="fn-bracket">]</span></a>.</p> |
| 578 |
<section id="document-parts"> |
| 579 |
<h4><a class="toc-backref" href="#toc-entry-55" role="doc-backlink"><span class="sectnum">2.14.1 </span>Document Parts</a></h4> |
| 580 |
<p>An example of the "contents" directive can be seen above this section |
| 581 |
(a local, untitled table of <a class="reference internal" href="#contents">contents</a>) and at the beginning of the |
| 582 |
document (a document-wide <a class="reference internal" href="#table-of-contents">table of contents</a>).</p> |
| 583 |
</section> |
| 584 |
<section id="images-and-figures"> |
| 585 |
<h4><a class="toc-backref" href="#toc-entry-56" role="doc-backlink"><span class="sectnum">2.14.2 </span>Images and Figures</a></h4> |
| 586 |
<p>An image directive (also clickable -- a hyperlink reference):</p> |
| 587 |
<a class="reference internal image-reference" href="#directives"> |
| 588 |
<img alt="../../../docs/user/rst/images/title.png" class="class1 class2" src="../../../docs/user/rst/images/title.png" style="width: 70%;" /> |
| 589 |
</a> |
| 590 |
<p>Image with multiple IDs:</p> |
| 591 |
<span id="image-target-2"></span><span id="image-target-1"></span><img alt="../../../docs/user/rst/images/biohazard.png" id="image-target-3" src="../../../docs/user/rst/images/biohazard.png" /> |
| 592 |
<p>A centered image:</p> |
| 593 |
<img alt="../../../docs/user/rst/images/biohazard.png" class="align-center" src="../../../docs/user/rst/images/biohazard.png" /> |
| 594 |
<p>A left-aligned image:</p> |
| 595 |
<img alt="../../../docs/user/rst/images/biohazard.png" class="align-left" src="../../../docs/user/rst/images/biohazard.png" /> |
| 596 |
<p>This paragraph might flow around the image. |
| 597 |
The specific behavior depends upon the style sheet and |
| 598 |
the browser or rendering software used.</p> |
| 599 |
<p>A right-aligned image:</p> |
| 600 |
<img alt="../../../docs/user/rst/images/biohazard.png" class="align-right" src="../../../docs/user/rst/images/biohazard.png" /> |
| 601 |
<p>This paragraph might flow around the image. |
| 602 |
The specific behavior depends upon the style sheet and |
| 603 |
the browser or rendering software used.</p> |
| 604 |
<p>For inline images see <a class="reference internal" href="#substitution-definitions">Substitution Definitions</a>.</p> |
| 605 |
<p>Image size:</p> |
| 606 |
<p>An image 2 em wide:</p> |
| 607 |
<img alt="../../../docs/user/rst/images/biohazard.png" src="../../../docs/user/rst/images/biohazard.png" style="width: 2em;" /> |
| 608 |
<p>An image 2 cm wide and 15 pixel high:</p> |
| 609 |
<img alt="../../../docs/user/rst/images/biohazard.png" src="../../../docs/user/rst/images/biohazard.png" style="width: 2cm; height: 15px;" /> |
| 610 |
<p>Relative units allow adaption of the image to the screen or paper size. |
| 611 |
An image occupying 50% of the line width:</p> |
| 612 |
<img alt="../../../docs/user/rst/images/title.png" src="../../../docs/user/rst/images/title.png" style="width: 50%;" /> |
| 613 |
<p>A <em>figure</em> is an image with a caption and/or a legend. With page-based output |
| 614 |
media, figures might float to a different position if this helps the page |
| 615 |
layout.</p> |
| 616 |
<figure class="figclass1 figclass2"> |
| 617 |
<a class="reference external image-reference" href="https://docutils.sourceforge.io/rst.html"> |
| 618 |
<img alt="reStructuredText, the markup syntax" class="class1 class2" src="../../../docs/user/rst/images/title.png" width="258" /> |
| 619 |
</a> |
| 620 |
<figcaption> |
| 621 |
<p>Plaintext markup syntax and parser system.</p> |
| 622 |
<div class="legend"> |
| 623 |
<table> |
| 624 |
<tbody> |
| 625 |
<tr><td><p>re</p></td> |
| 626 |
<td><p>Revised, revisited, based on 're' module.</p></td> |
| 627 |
</tr> |
| 628 |
<tr><td><p>Structured</p></td> |
| 629 |
<td><p>Structure-enhanced text, structuredtext.</p></td> |
| 630 |
</tr> |
| 631 |
<tr><td><p>Text</p></td> |
| 632 |
<td><p>Well it is, isn't it?</p></td> |
| 633 |
</tr> |
| 634 |
</tbody> |
| 635 |
</table> |
| 636 |
<p>This paragraph is also part of the legend.</p> |
| 637 |
</div> |
| 638 |
</figcaption> |
| 639 |
</figure> |
| 640 |
<p>A left-aligned figure, 70% wide:</p> |
| 641 |
<figure class="figclass1 figclass2 align-left" style="width: 70%"> |
| 642 |
<img alt="reStructuredText, the markup syntax" class="class1 class2" src="../../../docs/user/rst/images/biohazard.png" style="width: 40px;" /> |
| 643 |
<figcaption class="captionclass1 captionclass2" id="caption-label"> |
| 644 |
<p>This is the caption.</p> |
| 645 |
<div class="legend"> |
| 646 |
<p>This is the legend.</p> |
| 647 |
<p>The legend may consist of several paragraphs.</p> |
| 648 |
</div> |
| 649 |
</figcaption> |
| 650 |
</figure> |
| 651 |
<p>This paragraph might flow around the figure.</p> |
| 652 |
<p>The specific behavior depends upon the style sheet and the browser or |
| 653 |
rendering software used.</p> |
| 654 |
<p>A centred figure, 40% wide:</p> |
| 655 |
<figure class="align-center" style="width: 40%"> |
| 656 |
<img alt="../../../docs/user/rst/images/biohazard.png" src="../../../docs/user/rst/images/biohazard.png" style="width: 40px;" /> |
| 657 |
<figcaption> |
| 658 |
<p>This is the caption.</p> |
| 659 |
<div class="legend"> |
| 660 |
<p>This is the legend.</p> |
| 661 |
<p>The legend may consist of several paragraphs.</p> |
| 662 |
</div> |
| 663 |
</figcaption> |
| 664 |
</figure> |
| 665 |
<p>This paragraph might flow around the figure.</p> |
| 666 |
<p>The specific behavior depends upon the style sheet and the browser or |
| 667 |
rendering software used.</p> |
| 668 |
<p>A right-aligned figure:</p> |
| 669 |
<figure class="align-right"> |
| 670 |
<img alt="../../../docs/user/rst/images/biohazard.png" src="../../../docs/user/rst/images/biohazard.png" style="width: 40px;" /> |
| 671 |
<figcaption> |
| 672 |
<p>This is the caption.</p> |
| 673 |
<div class="legend"> |
| 674 |
<p>This is the legend.</p> |
| 675 |
<p>The legend may consist of several paragraphs.</p> |
| 676 |
</div> |
| 677 |
</figcaption> |
| 678 |
</figure> |
| 679 |
<p>This paragraph might flow around the figure. The specific behavior depends |
| 680 |
upon the style sheet and the browser or rendering software used.</p> |
| 681 |
</section> |
| 682 |
<section id="tables"> |
| 683 |
<h4><a class="toc-backref" href="#toc-entry-57" role="doc-backlink"><span class="sectnum">2.14.3 </span>Tables</a></h4> |
| 684 |
<p>Tables may be given titles and additional arguments with the <em>table</em> |
| 685 |
directive:</p> |
| 686 |
<table class="align-left"> |
| 687 |
<caption>left-aligned table</caption> |
| 688 |
<thead> |
| 689 |
<tr><th class="head"><p>A</p></th> |
| 690 |
<th class="head"><p>not A</p></th> |
| 691 |
</tr> |
| 692 |
</thead> |
| 693 |
<tbody> |
| 694 |
<tr><td><p>False</p></td> |
| 695 |
<td><p>True</p></td> |
| 696 |
</tr> |
| 697 |
<tr><td><p>True</p></td> |
| 698 |
<td><p>False</p></td> |
| 699 |
</tr> |
| 700 |
</tbody> |
| 701 |
</table> |
| 702 |
<table class="align-center"> |
| 703 |
<caption>center-aligned table</caption> |
| 704 |
<thead> |
| 705 |
<tr><th class="head"><p>A</p></th> |
| 706 |
<th class="head"><p>not A</p></th> |
| 707 |
</tr> |
| 708 |
</thead> |
| 709 |
<tbody> |
| 710 |
<tr><td><p>False</p></td> |
| 711 |
<td><p>True</p></td> |
| 712 |
</tr> |
| 713 |
<tr><td><p>True</p></td> |
| 714 |
<td><p>False</p></td> |
| 715 |
</tr> |
| 716 |
</tbody> |
| 717 |
</table> |
| 718 |
<table class="align-right"> |
| 719 |
<caption>right-aligned table</caption> |
| 720 |
<thead> |
| 721 |
<tr><th class="head"><p>A</p></th> |
| 722 |
<th class="head"><p>not A</p></th> |
| 723 |
</tr> |
| 724 |
</thead> |
| 725 |
<tbody> |
| 726 |
<tr><td><p>False</p></td> |
| 727 |
<td><p>True</p></td> |
| 728 |
</tr> |
| 729 |
<tr><td><p>True</p></td> |
| 730 |
<td><p>False</p></td> |
| 731 |
</tr> |
| 732 |
</tbody> |
| 733 |
</table> |
| 734 |
<p>With the "widths" argument "auto" (or "class" value "colwidths-auto"), |
| 735 |
column widths are determined by the backend (if supported by the |
| 736 |
writer/backend).</p> |
| 737 |
<span id="target1"></span><table id="target2"> |
| 738 |
<thead> |
| 739 |
<tr><th class="head"><p>A</p></th> |
| 740 |
<th class="head"><p>B</p></th> |
| 741 |
<th class="head"><p>A or B</p></th> |
| 742 |
</tr> |
| 743 |
</thead> |
| 744 |
<tbody> |
| 745 |
<tr><td><p>False</p></td> |
| 746 |
<td><p>False</p></td> |
| 747 |
<td><p>False</p></td> |
| 748 |
</tr> |
| 749 |
<tr><td><p>True</p></td> |
| 750 |
<td><p>False</p></td> |
| 751 |
<td><p>True</p></td> |
| 752 |
</tr> |
| 753 |
<tr><td><p>False</p></td> |
| 754 |
<td><p>True</p></td> |
| 755 |
<td><p>True</p></td> |
| 756 |
</tr> |
| 757 |
<tr><td><p>True</p></td> |
| 758 |
<td><p>True</p></td> |
| 759 |
<td><p>True</p></td> |
| 760 |
</tr> |
| 761 |
</tbody> |
| 762 |
</table> |
| 763 |
</section> |
| 764 |
<section id="admonitions"> |
| 765 |
<h4><a class="toc-backref" href="#toc-entry-58" role="doc-backlink"><span class="sectnum">2.14.4 </span>Admonitions</a></h4> |
| 766 |
<aside class="admonition attention"> |
| 767 |
<p class="admonition-title">Attention!</p> |
| 768 |
<p>Directives at large.</p> |
| 769 |
</aside> |
| 770 |
<aside class="admonition caution"> |
| 771 |
<p class="admonition-title">Caution!</p> |
| 772 |
<p>Don't take any wooden nickels.</p> |
| 773 |
</aside> |
| 774 |
<aside class="admonition danger"> |
| 775 |
<p class="admonition-title">!DANGER!</p> |
| 776 |
<p>Mad scientist at work!</p> |
| 777 |
</aside> |
| 778 |
<aside class="admonition error"> |
| 779 |
<p class="admonition-title">Error</p> |
| 780 |
<p>Does not compute.</p> |
| 781 |
</aside> |
| 782 |
<aside class="admonition hint"> |
| 783 |
<p class="admonition-title">Hint</p> |
| 784 |
<p>It's bigger than a bread box.</p> |
| 785 |
</aside> |
| 786 |
<aside class="admonition important"> |
| 787 |
<p class="admonition-title">Important</p> |
| 788 |
<ul class="simple"> |
| 789 |
<li><p>Wash behind your ears.</p></li> |
| 790 |
<li><p>Clean up your room.</p></li> |
| 791 |
<li><p>Call your mother.</p></li> |
| 792 |
<li><p>Back up your data.</p></li> |
| 793 |
</ul> |
| 794 |
</aside> |
| 795 |
<aside class="admonition note"> |
| 796 |
<p class="admonition-title">Note</p> |
| 797 |
<p>This is a note.</p> |
| 798 |
</aside> |
| 799 |
<aside class="admonition tip"> |
| 800 |
<p class="admonition-title">Tip</p> |
| 801 |
<p>15% if the service is good.</p> |
| 802 |
</aside> |
| 803 |
<aside class="admonition warning"> |
| 804 |
<p class="admonition-title">Warning</p> |
| 805 |
<p>Strong prose may provoke extreme mental exertion. |
| 806 |
Reader discretion is strongly advised.</p> |
| 807 |
</aside> |
| 808 |
<aside class="admonition admonition-and-by-the-way"> |
| 809 |
<p class="admonition-title">And, by the way...</p> |
| 810 |
<p>You can make up your own admonition too.</p> |
| 811 |
</aside> |
| 812 |
</section> |
| 813 |
<section id="topics-sidebars-and-rubrics"> |
| 814 |
<h4><a class="toc-backref" href="#toc-entry-59" role="doc-backlink"><span class="sectnum">2.14.5 </span>Topics, Sidebars, and Rubrics</a></h4> |
| 815 |
<p><em>Sidebars</em> are like miniature, parallel documents.</p> |
| 816 |
<aside class="sidebar"> |
| 817 |
<p class="sidebar-title">Optional Sidebar Title</p> |
| 818 |
<p class="sidebar-subtitle">Optional Subtitle</p> |
| 819 |
<p>This is a sidebar. It is for text outside the flow of the main |
| 820 |
text.</p> |
| 821 |
<p class="rubric">This is a rubric inside a sidebar</p> |
| 822 |
<p>Sidebars often appear beside the main text with a border and a different |
| 823 |
background or font color.</p> |
| 824 |
</aside> |
| 825 |
<p>A <em>topic</em> is like a block quote with a title, or a self-contained section |
| 826 |
with no subsections.</p> |
| 827 |
<aside class="topic"> |
| 828 |
<p class="topic-title">Topic Title</p> |
| 829 |
<p>This is a topic.</p> |
| 830 |
</aside> |
| 831 |
<p>A <em>rubric</em> is like an informal heading that doesn't correspond to the |
| 832 |
document's structure. It is typically highlighted in red (hence the name).</p> |
| 833 |
<p class="rubric">This is a rubric</p> |
| 834 |
<p>Topics and rubrics can be used at places where a <a class="reference internal" href="#section-title">section title</a> is not |
| 835 |
allowed (e.g. inside a directive).</p> |
| 836 |
</section> |
| 837 |
<section id="target-footnotes"> |
| 838 |
<h4><a class="toc-backref" href="#toc-entry-60" role="doc-backlink"><span class="sectnum">2.14.6 </span>Target Footnotes</a></h4> |
| 839 |
<aside class="footnote-list brackets"> |
| 840 |
<aside class="footnote brackets" id="footnote-7" role="doc-footnote"> |
| 841 |
<span class="label"><span class="fn-bracket">[</span>7<span class="fn-bracket">]</span></span> |
| 842 |
<span class="backrefs">(<a role="doc-backlink" href="#footnote-reference-18">1</a>,<a role="doc-backlink" href="#footnote-reference-19">2</a>,<a role="doc-backlink" href="#footnote-reference-20">3</a>,<a role="doc-backlink" href="#footnote-reference-27">4</a>)</span> |
| 843 |
<p><a class="reference external" href="http://www.python.org/">http://www.python.org/</a></p> |
| 844 |
</aside> |
| 845 |
<aside class="footnote brackets" id="footnote-8" role="doc-footnote"> |
| 846 |
<span class="label"><span class="fn-bracket">[</span><a role="doc-backlink" href="#footnote-reference-21">8</a><span class="fn-bracket">]</span></span> |
| 847 |
<p><a class="reference external" href="http://pygments.org/">http://pygments.org/</a></p> |
| 848 |
</aside> |
| 849 |
<aside class="footnote brackets" id="footnote-9" role="doc-footnote"> |
| 850 |
<span class="label"><span class="fn-bracket">[</span><a role="doc-backlink" href="#footnote-reference-22">9</a><span class="fn-bracket">]</span></span> |
| 851 |
<p><a class="reference external" href="https://docutils.sourceforge.io/docs/user/config.html#image-loading">https://docutils.sourceforge.io/docs/user/config.html#image-loading</a></p> |
| 852 |
</aside> |
| 853 |
<aside class="footnote brackets" id="footnote-10" role="doc-footnote"> |
| 854 |
<span class="label"><span class="fn-bracket">[</span><a role="doc-backlink" href="#footnote-reference-23">10</a><span class="fn-bracket">]</span></span> |
| 855 |
<p><a class="reference external" href="https://www.w3.org/TR/html52/interactive-elements.html#the-details-element">https://www.w3.org/TR/html52/interactive-elements.html#the-details-element</a></p> |
| 856 |
</aside> |
| 857 |
<aside class="footnote brackets" id="footnote-11" role="doc-footnote"> |
| 858 |
<span class="label"><span class="fn-bracket">[</span><a role="doc-backlink" href="#footnote-reference-24">11</a><span class="fn-bracket">]</span></span> |
| 859 |
<p><a class="reference external" href="https://docutils.sourceforge.io/docs/user/config.html#table-style">https://docutils.sourceforge.io/docs/user/config.html#table-style</a></p> |
| 860 |
</aside> |
| 861 |
<aside class="footnote brackets" id="footnote-12" role="doc-footnote"> |
| 862 |
<span class="label"><span class="fn-bracket">[</span><a role="doc-backlink" href="#footnote-reference-25">12</a><span class="fn-bracket">]</span></span> |
| 863 |
<p><a class="reference external" href="http://tug.ctan.org/tex-archive/macros/latex/contrib/booktabs/booktabs.pdf">http://tug.ctan.org/tex-archive/macros/latex/contrib/booktabs/booktabs.pdf</a></p> |
| 864 |
</aside> |
| 865 |
<aside class="footnote brackets" id="footnote-13" role="doc-footnote"> |
| 866 |
<span class="label"><span class="fn-bracket">[</span><a role="doc-backlink" href="#footnote-reference-26">13</a><span class="fn-bracket">]</span></span> |
| 867 |
<p><a class="reference external" href="https://docutils.sourceforge.io/docs/dev/todo.html#interpreted-text">https://docutils.sourceforge.io/docs/dev/todo.html#interpreted-text</a></p> |
| 868 |
</aside> |
| 869 |
<aside class="footnote brackets" id="footnote-14" role="doc-footnote"> |
| 870 |
<span class="label"><span class="fn-bracket">[</span><a role="doc-backlink" href="#footnote-reference-28">14</a><span class="fn-bracket">]</span></span> |
| 871 |
<p><a class="reference external" href="https://docutils.sourceforge.io/">https://docutils.sourceforge.io/</a></p> |
| 872 |
</aside> |
| 873 |
<aside class="footnote brackets" id="footnote-15" role="doc-footnote"> |
| 874 |
<span class="label"><span class="fn-bracket">[</span><a role="doc-backlink" href="#footnote-reference-29">15</a><span class="fn-bracket">]</span></span> |
| 875 |
<p><a class="reference external" href="https://docutils.sourceforge.io/docs/ref/rst/directives.html">https://docutils.sourceforge.io/docs/ref/rst/directives.html</a></p> |
| 876 |
</aside> |
| 877 |
<aside class="footnote brackets" id="footnote-16" role="doc-footnote"> |
| 878 |
<span class="label"><span class="fn-bracket">[</span><a role="doc-backlink" href="#footnote-reference-30">16</a><span class="fn-bracket">]</span></span> |
| 879 |
<p><a class="reference external" href="https://docutils.sourceforge.io/docs/ref/rst/directives.html#metadata">https://docutils.sourceforge.io/docs/ref/rst/directives.html#metadata</a></p> |
| 880 |
</aside> |
| 881 |
<aside class="footnote brackets" id="footnote-17" role="doc-footnote"> |
| 882 |
<span class="label"><span class="fn-bracket">[</span><a role="doc-backlink" href="#footnote-reference-31">17</a><span class="fn-bracket">]</span></span> |
| 883 |
<p><a class="reference external" href="https://developer.mozilla.org/en-US/docs/Web/HTML/Viewport_meta_tag">https://developer.mozilla.org/en-US/docs/Web/HTML/Viewport_meta_tag</a></p> |
| 884 |
</aside> |
| 885 |
<aside class="footnote brackets" id="footnote-18" role="doc-footnote"> |
| 886 |
<span class="label"><span class="fn-bracket">[</span><a role="doc-backlink" href="#footnote-reference-32">18</a><span class="fn-bracket">]</span></span> |
| 887 |
<p><a class="reference external" href="https://stackoverflow.com/questions/39547412/same-font-size-for-h1-and-h2-in-article">https://stackoverflow.com/questions/39547412/same-font-size-for-h1-and-h2-in-article</a></p> |
| 888 |
</aside> |
| 889 |
<aside class="footnote brackets" id="footnote-19" role="doc-footnote"> |
| 890 |
<span class="label"><span class="fn-bracket">[</span><a role="doc-backlink" href="#footnote-reference-33">19</a><span class="fn-bracket">]</span></span> |
| 891 |
<p><a class="reference external" href="https://html.spec.whatwg.org/#text-level-semantics">https://html.spec.whatwg.org/#text-level-semantics</a></p> |
| 892 |
</aside> |
| 893 |
<aside class="footnote brackets" id="footnote-20" role="doc-footnote"> |
| 894 |
<span class="label"><span class="fn-bracket">[</span><a role="doc-backlink" href="#footnote-reference-34">20</a><span class="fn-bracket">]</span></span> |
| 895 |
<p><a class="reference external" href="https://html.spec.whatwg.org/multipage/edits.html">https://html.spec.whatwg.org/multipage/edits.html</a></p> |
| 896 |
</aside> |
| 897 |
</aside> |
| 898 |
</section> |
| 899 |
<section id="replacement-text"> |
| 900 |
<h4><a class="toc-backref" href="#toc-entry-61" role="doc-backlink"><span class="sectnum">2.14.7 </span>Replacement Text</a></h4> |
| 901 |
<p>I recommend you try <a class="reference external" href="http://www.python.org/">Python, <em>the</em> best language around</a> <a class="brackets" href="#footnote-7" id="footnote-reference-20" role="doc-noteref"><span class="fn-bracket">[</span>7<span class="fn-bracket">]</span></a>.</p> |
| 902 |
</section> |
| 903 |
<section id="compound-paragraph"> |
| 904 |
<h4><a class="toc-backref" href="#toc-entry-62" role="doc-backlink"><span class="sectnum">2.14.8 </span>Compound Paragraph</a></h4> |
| 905 |
<p>The <em>compound</em> directive is used to create a "compound paragraph", which |
| 906 |
is a single logical paragraph containing multiple physical body |
| 907 |
elements. For example:</p> |
| 908 |
<div class="compound"> |
| 909 |
<p>The 'rm' command is very dangerous. If you are logged |
| 910 |
in as root and enter</p> |
| 911 |
<pre class="literal-block">cd / |
| 912 |
rm -rf *</pre> |
| 913 |
<p>you will erase the entire contents of your file system.</p> |
| 914 |
</div> |
| 915 |
<p>Test the handling and display of compound paragraphs:</p> |
| 916 |
<div class="some-class compound"> |
| 917 |
<p>Compound 2, paragraph 1,</p> |
| 918 |
<p>compound 2, paragraph 2,</p> |
| 919 |
<ul class="simple"> |
| 920 |
<li><p>list item 1,</p></li> |
| 921 |
<li><p>list item 2,</p></li> |
| 922 |
</ul> |
| 923 |
<p>compound 2, paragraph 3.</p> |
| 924 |
</div> |
| 925 |
<div class="compound"> |
| 926 |
<p>Compound 3, only consisting of one paragraph.</p> |
| 927 |
</div> |
| 928 |
<div class="compound"> |
| 929 |
<pre class="literal-block">Compound 4. |
| 930 |
This one starts with a literal block.</pre> |
| 931 |
<p>Compound 4, paragraph following the literal block.</p> |
| 932 |
</div> |
| 933 |
<p>Now something <em>really</em> perverted -- a nested compound block. This is |
| 934 |
just to test that it works at all; the results don't have to be |
| 935 |
meaningful.</p> |
| 936 |
<div class="compound"> |
| 937 |
<p>Compound 5, block 1 (a paragraph).</p> |
| 938 |
<div class="compound"> |
| 939 |
<p>Compound 6 is block 2 in compound 5.</p> |
| 940 |
<p>Compound 6, another paragraph.</p> |
| 941 |
</div> |
| 942 |
<p>Compound 5, block 3 (a paragraph).</p> |
| 943 |
</div> |
| 944 |
<div class="compound"> |
| 945 |
<p>Compound 7, tests the inclusion of various block-level |
| 946 |
elements in one logical paragraph. First a table,</p> |
| 947 |
<table> |
| 948 |
<tbody> |
| 949 |
<tr><td><p>Left cell, first |
| 950 |
paragraph.</p> |
| 951 |
<p>Left cell, second |
| 952 |
paragraph.</p> |
| 953 |
</td> |
| 954 |
<td><p>Middle cell, |
| 955 |
consisting of |
| 956 |
exactly one |
| 957 |
paragraph.</p></td> |
| 958 |
<td><p>Right cell.</p> |
| 959 |
<p>Paragraph 2.</p> |
| 960 |
<p>Paragraph 3.</p> |
| 961 |
</td> |
| 962 |
</tr> |
| 963 |
</tbody> |
| 964 |
</table> |
| 965 |
<p>followed by a paragraph. This physical paragraph is |
| 966 |
actually a continuation of the paragraph before the table. It is followed |
| 967 |
by</p> |
| 968 |
<blockquote> |
| 969 |
<p>a quote and</p> |
| 970 |
</blockquote> |
| 971 |
<ol class="arabic simple"> |
| 972 |
<li><p>an enumerated list,</p></li> |
| 973 |
</ol> |
| 974 |
<p>a paragraph,</p> |
| 975 |
<dl class="option-list"> |
| 976 |
<dt><kbd><span class="option">--an</span></kbd></dt> |
| 977 |
<dd><p>option list,</p> |
| 978 |
</dd> |
| 979 |
</dl> |
| 980 |
<p>a paragraph,</p> |
| 981 |
<dl class="field-list simple"> |
| 982 |
<dt>a field<span class="colon">:</span></dt> |
| 983 |
<dd><p>list,</p> |
| 984 |
</dd> |
| 985 |
</dl> |
| 986 |
<p>a paragraph,</p> |
| 987 |
<dl class="simple"> |
| 988 |
<dt>a definition</dt> |
| 989 |
<dd><p>list,</p> |
| 990 |
</dd> |
| 991 |
</dl> |
| 992 |
<p>a paragraph, an image:</p> |
| 993 |
<img alt="../../../docs/user/rst/images/biohazard.png" src="../../../docs/user/rst/images/biohazard.png" /> |
| 994 |
<p>a paragraph,</p> |
| 995 |
<div class="line-block"> |
| 996 |
<div class="line">a line</div> |
| 997 |
<div class="line">block,</div> |
| 998 |
</div> |
| 999 |
<p>a paragraph followed by a comment,</p> |
| 1000 |
|
| 1001 |
<p>a paragraph, a</p> |
| 1002 |
<aside class="admonition note"> |
| 1003 |
<p class="admonition-title">Note</p> |
| 1004 |
<p>with content</p> |
| 1005 |
</aside> |
| 1006 |
<p>and the final paragraph of the compound 7.</p> |
| 1007 |
</div> |
| 1008 |
</section> |
| 1009 |
<section id="parsed-literal-blocks"> |
| 1010 |
<h4><a class="toc-backref" href="#toc-entry-63" role="doc-backlink"><span class="sectnum">2.14.9 </span>Parsed Literal Blocks</a></h4> |
| 1011 |
<pre class="literal-block">This is a parsed literal block. |
| 1012 |
This line is indented. The next line is blank. |
| 1013 |
|
| 1014 |
Inline markup is supported, e.g. <em>emphasis</em>, <strong>strong</strong>, <span class="docutils literal">literal |
| 1015 |
text</span>, <sub>sub-</sub> and <sup>super</sup>scripts, |
| 1016 |
inline formulas: <math xmlns="http://www.w3.org/1998/Math/MathML"> |
| 1017 |
<mi>A</mi> |
| 1018 |
<mo>=</mo> |
| 1019 |
<mn>2</mn> |
| 1020 |
<mi>π</mi> |
| 1021 |
<msup> |
| 1022 |
<mi>r</mi> |
| 1023 |
<mn>2</mn> |
| 1024 |
</msup> |
| 1025 |
</math>, |
| 1026 |
footnotes <a class="brackets" href="#footnote-1" id="footnote-reference-9" role="doc-noteref"><span class="fn-bracket">[</span>1<span class="fn-bracket">]</span></a>, <span class="target" id="hyperlink-targets">hyperlink targets</span>, and <a class="reference external" href="http://www.python.org/">references</a>.</pre> |
| 1027 |
</section> |
| 1028 |
<section id="code"> |
| 1029 |
<h4><a class="toc-backref" href="#toc-entry-64" role="doc-backlink"><span class="sectnum">2.14.10 </span>Code</a></h4> |
| 1030 |
<p>Blocks of source code can be set with the <cite>code</cite> directive. If the code |
| 1031 |
language is specified, the content is parsed and tagged by the <a class="reference external" href="http://pygments.org/">Pygments</a> <a class="brackets" href="#footnote-8" id="footnote-reference-21" role="doc-noteref"><span class="fn-bracket">[</span>8<span class="fn-bracket">]</span></a> |
| 1032 |
syntax highlighter and can be formatted with a style sheet. (Code parsing |
| 1033 |
is turned off using the <span class="docutils literal"><span class="pre">syntax-highlight</span></span> config setting in the test |
| 1034 |
conversions in order to get identical results with/without installed |
| 1035 |
Pygments highlighter.)</p> |
| 1036 |
<pre class="code python literal-block"><code>print 'This is Python code.'</code></pre> |
| 1037 |
<p>The <span class="docutils literal"><span class="pre">:number-lines:</span></span> option (with optional start value) generates line |
| 1038 |
numbers:</p> |
| 1039 |
<pre class="code python literal-block"><small class="ln"> 8 </small><code data-lineno=" 8 "># print integers from 0 to 9: |
| 1040 |
</code><small class="ln"> 9 </small><code data-lineno=" 9 ">for i in range(10): |
| 1041 |
</code><small class="ln">10 </small><code data-lineno="10 "> print i</code></pre> |
| 1042 |
<p>For inline code snippets, there is the <cite>code</cite> role, which can be used |
| 1043 |
directly (the code will not be parsed/tagged, as the language is not known) |
| 1044 |
or as base for special code roles, e.g. the LaTeX code in the next |
| 1045 |
paragraph.</p> |
| 1046 |
<p>Docutils uses LaTeX syntax for math directives and roles: |
| 1047 |
<code class="tex">\alpha = f(x)</code> prints <math xmlns="http://www.w3.org/1998/Math/MathML"> |
| 1048 |
<mi>α</mi> |
| 1049 |
<mo>=</mo> |
| 1050 |
<mi>f</mi> |
| 1051 |
<mo stretchy="false">(</mo> |
| 1052 |
<mi>x</mi> |
| 1053 |
<mo stretchy="false">)</mo> |
| 1054 |
</math>.</p> |
| 1055 |
<p>The <span class="docutils literal">:code:</span> option of the <cite>include</cite> directive sets the included content |
| 1056 |
as a code block, here the rst file <span class="docutils literal">header_footer.rst</span> with line numbers:</p> |
| 1057 |
<pre class="code rst literal-block"><small class="ln">1 </small><code data-lineno="1 ">.. header:: Document header |
| 1058 |
</code><small class="ln">2 </small><code data-lineno="2 ">.. footer:: Document footer</code></pre> |
| 1059 |
</section> |
| 1060 |
<section id="meta"> |
| 1061 |
<h4><a class="toc-backref" href="#toc-entry-65" role="doc-backlink"><span class="sectnum">2.14.11 </span>Meta</a></h4> |
| 1062 |
<p>The <a class="reference external" href="https://docutils.sourceforge.io/docs/ref/rst/directives.html#metadata">“meta” directive</a> <a class="brackets" href="#footnote-16" id="footnote-reference-30" role="doc-noteref"><span class="fn-bracket">[</span>16<span class="fn-bracket">]</span></a> is used to specify metadata to be stored in, |
| 1063 |
e.g., HTML META tags or ODT file properties.</p> |
| 1064 |
</section> |
| 1065 |
</section> |
| 1066 |
<section id="substitution-definitions"> |
| 1067 |
<h3><a class="toc-backref" href="#toc-entry-34" role="doc-backlink"><span class="sectnum">2.15 </span>Substitution Definitions</a></h3> |
| 1068 |
<p>An inline image (<img alt="EXAMPLE" src="../../../docs/user/rst/images/biohazard.png" />) example:</p> |
| 1069 |
<p>A Unicode example:</p> |
| 1070 |
<p>(Substitution definitions are only visible in the rST source.)</p> |
| 1071 |
</section> |
| 1072 |
<section id="comments"> |
| 1073 |
<h3><a class="toc-backref" href="#toc-entry-35" role="doc-backlink"><span class="sectnum">2.16 </span>Comments</a></h3> |
| 1074 |
<p>Here's one:</p> |
| 1075 |
|
| 1076 |
|
| 1077 |
|
| 1078 |
|
| 1079 |
|
| 1080 |
|
| 1081 |
å --> |
| 1082 |
<p>(View the HTML/LaTeX/... source to see the comment.)</p> |
| 1083 |
</section> |
| 1084 |
<section id="raw-text"> |
| 1085 |
<h3><a class="toc-backref" href="#toc-entry-36" role="doc-backlink"><span class="sectnum">2.17 </span>Raw text</a></h3> |
| 1086 |
<p>This does not necessarily look nice, because there may be missing white space.</p> |
| 1087 |
<p>It's just there to freeze the behavior.</p> |
| 1088 |
A test.Second test.<div class="myclass">Another test with myclass set.</div><p>This is the <span class="myrawroleclass">fourth test</span> with myrawroleclass set.</p> |
| 1089 |
Fifth test in HTML.<br />Line two.</section> |
| 1090 |
<section id="container"> |
| 1091 |
<h3><a class="toc-backref" href="#toc-entry-37" role="doc-backlink"><span class="sectnum">2.18 </span>Container</a></h3> |
| 1092 |
<div class="custom docutils container"> |
| 1093 |
<p>paragraph 1</p> |
| 1094 |
<p>paragraph 2</p> |
| 1095 |
</div> |
| 1096 |
</section> |
| 1097 |
<section id="colspanning-tables"> |
| 1098 |
<h3><a class="toc-backref" href="#toc-entry-38" role="doc-backlink"><span class="sectnum">2.19 </span>Colspanning tables</a></h3> |
| 1099 |
<p>This table has a cell spanning two columns:</p> |
| 1100 |
<table> |
| 1101 |
<thead> |
| 1102 |
<tr><th class="head" colspan="2"><p>Inputs</p></th> |
| 1103 |
<th class="head"><p>Output</p></th> |
| 1104 |
</tr> |
| 1105 |
<tr><th class="head"><p>A</p></th> |
| 1106 |
<th class="head"><p>B</p></th> |
| 1107 |
<th class="head"><p>A or B</p></th> |
| 1108 |
</tr> |
| 1109 |
</thead> |
| 1110 |
<tbody> |
| 1111 |
<tr><td><p>False</p></td> |
| 1112 |
<td><p>False</p></td> |
| 1113 |
<td><p>False</p></td> |
| 1114 |
</tr> |
| 1115 |
<tr><td><p>True</p></td> |
| 1116 |
<td><p>False</p></td> |
| 1117 |
<td><p>True</p></td> |
| 1118 |
</tr> |
| 1119 |
<tr><td><p>False</p></td> |
| 1120 |
<td><p>True</p></td> |
| 1121 |
<td><p>True</p></td> |
| 1122 |
</tr> |
| 1123 |
<tr><td><p>True</p></td> |
| 1124 |
<td><p>True</p></td> |
| 1125 |
<td><p>True</p></td> |
| 1126 |
</tr> |
| 1127 |
</tbody> |
| 1128 |
</table> |
| 1129 |
</section> |
| 1130 |
<section id="rowspanning-tables"> |
| 1131 |
<h3><a class="toc-backref" href="#toc-entry-39" role="doc-backlink"><span class="sectnum">2.20 </span>Rowspanning tables</a></h3> |
| 1132 |
<p>Here's a table with cells spanning several rows:</p> |
| 1133 |
<table> |
| 1134 |
<thead> |
| 1135 |
<tr><th class="head"><p>Header row, column 1 |
| 1136 |
(header rows optional)</p></th> |
| 1137 |
<th class="head"><p>Header 2</p></th> |
| 1138 |
<th class="head"><p>Header 3</p></th> |
| 1139 |
</tr> |
| 1140 |
</thead> |
| 1141 |
<tbody> |
| 1142 |
<tr><td><p>body row 1, column 1</p></td> |
| 1143 |
<td><p>column 2</p></td> |
| 1144 |
<td><p>column 3</p></td> |
| 1145 |
</tr> |
| 1146 |
<tr><td><p>body row 2</p></td> |
| 1147 |
<td rowspan="2"><p>Cells may |
| 1148 |
span rows.</p></td> |
| 1149 |
<td rowspan="2"><p>Another |
| 1150 |
rowspanning |
| 1151 |
cell.</p></td> |
| 1152 |
</tr> |
| 1153 |
<tr><td><p>body row 3</p></td> |
| 1154 |
</tr> |
| 1155 |
</tbody> |
| 1156 |
</table> |
| 1157 |
</section> |
| 1158 |
<section id="complex-tables"> |
| 1159 |
<h3><a class="toc-backref" href="#toc-entry-40" role="doc-backlink"><span class="sectnum">2.21 </span>Complex tables</a></h3> |
| 1160 |
<p>Here's a complex table, which should test all features.</p> |
| 1161 |
<table> |
| 1162 |
<thead> |
| 1163 |
<tr><th class="head"><p>Header row, column 1 |
| 1164 |
(header rows optional)</p></th> |
| 1165 |
<th class="head"><p>Header 2</p></th> |
| 1166 |
<th class="head"><p>Header 3</p></th> |
| 1167 |
<th class="head"><p>Header 4</p></th> |
| 1168 |
</tr> |
| 1169 |
</thead> |
| 1170 |
<tbody> |
| 1171 |
<tr><td><p>body row 1, column 1</p></td> |
| 1172 |
<td><p>column 2</p></td> |
| 1173 |
<td><p>column 3</p></td> |
| 1174 |
<td><p>column 4</p></td> |
| 1175 |
</tr> |
| 1176 |
<tr><td><p>body row 2</p></td> |
| 1177 |
<td colspan="3"><p>Cells may span columns.</p></td> |
| 1178 |
</tr> |
| 1179 |
<tr><td><p>body row 3</p></td> |
| 1180 |
<td rowspan="2"><p>Cells may |
| 1181 |
span rows.</p> |
| 1182 |
<p>Paragraph.</p> |
| 1183 |
</td> |
| 1184 |
<td colspan="2" rowspan="2"><ul class="simple"> |
| 1185 |
<li><p>Table cells</p></li> |
| 1186 |
<li><p>contain</p></li> |
| 1187 |
<li><p>body elements.</p></li> |
| 1188 |
</ul> |
| 1189 |
</td> |
| 1190 |
</tr> |
| 1191 |
<tr><td><p>body row 4</p></td> |
| 1192 |
</tr> |
| 1193 |
<tr><td><p>body row 5</p></td> |
| 1194 |
<td colspan="2"><p>Cells may also be |
| 1195 |
empty: <span class="docutils literal"><span class="pre">--></span></span></p></td> |
| 1196 |
<td></td> |
| 1197 |
</tr> |
| 1198 |
</tbody> |
| 1199 |
</table> |
| 1200 |
</section> |
| 1201 |
<section id="list-tables"> |
| 1202 |
<h3><a class="toc-backref" href="#toc-entry-41" role="doc-backlink"><span class="sectnum">2.22 </span>List Tables</a></h3> |
| 1203 |
<p>Here's a list table exercising all features:</p> |
| 1204 |
<table class="test" style="width: 95%;"> |
| 1205 |
<caption>list table with integral header</caption> |
| 1206 |
<colgroup> |
| 1207 |
<col style="width: 26.3%" /> |
| 1208 |
<col style="width: 21.1%" /> |
| 1209 |
<col style="width: 52.6%" /> |
| 1210 |
</colgroup> |
| 1211 |
<thead> |
| 1212 |
<tr><th class="head stub"><p>Treat</p></th> |
| 1213 |
<th class="head"><p>Quantity</p></th> |
| 1214 |
<th class="head"><p>Description</p></th> |
| 1215 |
</tr> |
| 1216 |
</thead> |
| 1217 |
<tbody> |
| 1218 |
<tr><th class="stub"><p>Albatross</p></th> |
| 1219 |
<td><p>2.99</p></td> |
| 1220 |
<td><p>On a stick!</p></td> |
| 1221 |
</tr> |
| 1222 |
<tr><th class="stub"><p>Crunchy Frog</p></th> |
| 1223 |
<td><p>1.49</p></td> |
| 1224 |
<td><p>If we took the bones out, it wouldn't be |
| 1225 |
crunchy, now would it?</p></td> |
| 1226 |
</tr> |
| 1227 |
<tr><th class="stub"><p>Gannet Ripple</p></th> |
| 1228 |
<td><p>1.99</p></td> |
| 1229 |
<td><p>On a stick!</p></td> |
| 1230 |
</tr> |
| 1231 |
</tbody> |
| 1232 |
</table> |
| 1233 |
<table class="align-center"> |
| 1234 |
<caption>center aligned list table</caption> |
| 1235 |
<tbody> |
| 1236 |
<tr><td><p>Albatross</p></td> |
| 1237 |
<td><p>2.99</p></td> |
| 1238 |
</tr> |
| 1239 |
<tr><td><p>Crunchy Frog</p></td> |
| 1240 |
<td><p>1.49</p></td> |
| 1241 |
</tr> |
| 1242 |
<tr><td><p>Gannet Ripple</p></td> |
| 1243 |
<td><p>1.99</p></td> |
| 1244 |
</tr> |
| 1245 |
</tbody> |
| 1246 |
</table> |
| 1247 |
</section> |
| 1248 |
<section id="custom-roles"> |
| 1249 |
<h3><a class="toc-backref" href="#toc-entry-42" role="doc-backlink"><span class="sectnum">2.23 </span>Custom Roles</a></h3> |
| 1250 |
<ul> |
| 1251 |
<li><p>A role based on an existing role.</p> |
| 1252 |
<p><span class="custom docutils literal">one</span> <span class="custom docutils literal">two</span> <span class="custom docutils literal">three</span></p> |
| 1253 |
</li> |
| 1254 |
<li><p>A new role.</p> |
| 1255 |
<p><span class="customnew">one two three</span></p> |
| 1256 |
</li> |
| 1257 |
<li><p>A role with class attribute.</p> |
| 1258 |
<p><span class="special">interpreted text</span></p> |
| 1259 |
</li> |
| 1260 |
<li><p>A language-switching role:</p> |
| 1261 |
<p>Let's count in German <span lang="de">eins zwei drei</span>.</p> |
| 1262 |
</li> |
| 1263 |
<li><p>A role with multiple class attributes, styled with raw directives:</p> |
| 1264 |
<p>The following works in most browsers but does not validate |
| 1265 |
(<span class="docutils literal"><style></span> is only allowed in the document head):</p> |
| 1266 |
<pre class="literal-block">.. raw:: html |
| 1267 |
|
| 1268 |
<style type="text/css"><!-- |
| 1269 |
.green {color: green;} |
| 1270 |
.sc {font-variant: small-caps;} |
| 1271 |
--></style></pre> |
| 1272 |
<p><span class="green sc" lang="en-gb">British colourful text in small-caps</span>.</p> |
| 1273 |
</li> |
| 1274 |
</ul> |
| 1275 |
</section> |
| 1276 |
</section> |
| 1277 |
<section id="differences-to-the-html4css1-writer"> |
| 1278 |
<h2><a class="toc-backref" href="#toc-entry-43" role="doc-backlink"><span class="sectnum">3 </span>Differences to the <cite>html4css1</cite> Writer</a></h2> |
| 1279 |
<ul> |
| 1280 |
<li><p>Use only <a class="reference internal" href="#meta">meta</a> keywords recognized by HTML 5. |
| 1281 |
Add HTML5-compatible meta tags for docinfo items |
| 1282 |
"authors", "date", and "copyright".</p> |
| 1283 |
<p>Add a <a class="reference external" href="https://developer.mozilla.org/en-US/docs/Web/HTML/Viewport_meta_tag">viewport meta tag</a> <a class="brackets" href="#footnote-17" id="footnote-reference-31" role="doc-noteref"><span class="fn-bracket">[</span>17<span class="fn-bracket">]</span></a> to tell mobile browsers |
| 1284 |
to use the device-width as viewport.</p> |
| 1285 |
</li> |
| 1286 |
<li><p>Set table column widths with <style="width: ...">, not "width" argument.</p></li> |
| 1287 |
<li><p>Horizontal alignment of table heads with CSS.</p></li> |
| 1288 |
<li><p>Do not drop paragraph elements, use CSS rules to prevent unwanted vertical |
| 1289 |
space.</p></li> |
| 1290 |
<li><p>Put subtitles in <p> elements.</p></li> |
| 1291 |
<li><p>Use the new semantic tags <main>, <section>, <header>, |
| 1292 |
<footer>, <aside>, <figure>, and <figcaption>. |
| 1293 |
See <span class="docutils literal">minimal.css</span> and <span class="docutils literal">responsive.css</span> for styling rule examples.</p> |
| 1294 |
<p>Change the <cite>initial_header_level</cite> setting default to "2", as browsers |
| 1295 |
use the <a class="reference external" href="https://stackoverflow.com/questions/39547412/same-font-size-for-h1-and-h2-in-article">same style for <h1> and <h2> when nested in a <section></a> <a class="brackets" href="#footnote-18" id="footnote-reference-32" role="doc-noteref"><span class="fn-bracket">[</span>18<span class="fn-bracket">]</span></a>.</p> |
| 1296 |
</li> |
| 1297 |
<li><p>Use HTML5 tags <small>, <s>, <q>, <dfn>, <var>, <samp>, <kbd>, |
| 1298 |
<i>, <b>, <u>, <mark>, and <bdi> if a matching class value |
| 1299 |
is found in <cite>inline</cite> and <cite>literal</cite> elements. |
| 1300 |
Use <ins> and <del> if a matching class value |
| 1301 |
is found in <cite>inline</cite>, <cite>literal</cite>, or <cite>container</cite> elements. |
| 1302 |
(See <a class="reference internal" href="#text-level-semantics">text-level semantics</a> and <a class="reference internal" href="#indicating-edits">indicating edits</a>.)</p></li> |
| 1303 |
<li><p>Use <img> tags for SVG images and <video> for video formats.</p></li> |
| 1304 |
<li><img alt="blue square" class="align-right" src="data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAACAAAAAgCAIAAAD8GO2jAAAALElEQVR4nO3NMQEAMAjAsDFjvIhHFCbgSwU0kdXvsn96BwAAAAAAAAAAAIsNnEwBk52VRuMAAAAASUVORK5CYII=" /> |
| 1305 |
<p>Embed images or defer fetching images with the <a class="reference external" href="https://docutils.sourceforge.io/docs/user/config.html#image-loading">image-loading</a> <a class="brackets" href="#footnote-9" id="footnote-reference-22" role="doc-noteref"><span class="fn-bracket">[</span>9<span class="fn-bracket">]</span></a> |
| 1306 |
configuration setting or the "loading" option of the "image" directive.</p> |
| 1307 |
<img alt="../../../docs/user/rst/images/biohazard.png" class="align-right" height="16" loading="lazy" src="../../../docs/user/rst/images/biohazard.png" width="16" /> |
| 1308 |
<p>Especially with "lazy" loading, it is strongly recommended to |
| 1309 |
specify both width and height of the image to prevent content layout |
| 1310 |
shifts or use the "scale" option to let the writer insert the size |
| 1311 |
determined from the image file.</p> |
| 1312 |
</li> |
| 1313 |
</ul> |
| 1314 |
<section id="field-list-rendering"> |
| 1315 |
<h3><a class="toc-backref" href="#toc-entry-44" role="doc-backlink"><span class="sectnum">3.1 </span>Field List Rendering</a></h3> |
| 1316 |
<p>A <cite>field list</cite> is converted to a HTML <cite>definition list</cite> and given the |
| 1317 |
<span class="docutils literal"><span class="pre">field-list</span></span> class argument value to allow CSS styling. |
| 1318 |
With <span class="docutils literal">html_plain.css</span>, the layout is similar to <cite>html4css1</cite>:</p> |
| 1319 |
<dl class="open field-list"> |
| 1320 |
<dt>A long field name<span class="colon">:</span></dt> |
| 1321 |
<dd><p>sticks into the field body.</p> |
| 1322 |
<p>The field body is pushed to the next line (you can suppress this |
| 1323 |
behaviour with the <a class="reference internal" href="#run-in">run-in</a> class argument).</p> |
| 1324 |
</dd> |
| 1325 |
<dt>Customization<span class="colon">:</span></dt> |
| 1326 |
<dd><p>of the field name width is possible with CSS instead |
| 1327 |
of the <cite>field-name-limit</cite> configuration setting, for |
| 1328 |
example:</p> |
| 1329 |
<pre class="literal-block">dl.field-list > dd { margin-left: 6em; }</pre> |
| 1330 |
</dd> |
| 1331 |
<dt>Empty<span class="colon">:</span></dt> |
| 1332 |
<dd><p></p></dd> |
| 1333 |
<dt>fields<span class="colon">:</span></dt> |
| 1334 |
<dd><p>must not lead to misalignment of the following content.</p> |
| 1335 |
</dd> |
| 1336 |
</dl> |
| 1337 |
</section> |
| 1338 |
<section id="styling-with-class-arguments"> |
| 1339 |
<h3><a class="toc-backref" href="#toc-entry-45" role="doc-backlink"><span class="sectnum">3.2 </span>Styling with Class Arguments</a></h3> |
| 1340 |
<p>The <span class="docutils literal">plain.css</span> style sheet comes with some pre-defined style variants |
| 1341 |
that can be chosen via a class argument.</p> |
| 1342 |
<section id="description-lists"> |
| 1343 |
<h4><a class="toc-backref" href="#toc-entry-46" role="doc-backlink"><span class="sectnum">3.2.1 </span>Description Lists</a></h4> |
| 1344 |
<p>Definition lists with the "description" class argument:</p> |
| 1345 |
<dl class="description"> |
| 1346 |
<dt>description lists</dt> |
| 1347 |
<dd><p>Definition lists that are styled like in most dictionaries, |
| 1348 |
encyclopedias etc. (as well as the LaTeX <cite>description</cite> environment).</p> |
| 1349 |
</dd> |
| 1350 |
<dt>label</dt> |
| 1351 |
<dd><p>The term to be described. Put in boldface or italic.</p> |
| 1352 |
</dd> |
| 1353 |
<dt>Content</dt> |
| 1354 |
<dd><p>starts on the same line and has a hanging indent.</p> |
| 1355 |
</dd> |
| 1356 |
<dt>A label without content</dt> |
| 1357 |
<dd> |
| 1358 |
</dd> |
| 1359 |
<dt>and the next label</dt> |
| 1360 |
<dd><p>must align.</p> |
| 1361 |
</dd> |
| 1362 |
<dt>as well</dt> |
| 1363 |
<dd><p>as content containing more than one</p> |
| 1364 |
<p>paragraph</p> |
| 1365 |
</dd> |
| 1366 |
<dt>or</dt> |
| 1367 |
<dd><ul class="simple"> |
| 1368 |
<li><p>nested lists</p></li> |
| 1369 |
<li><p>item 2</p></li> |
| 1370 |
</ul> |
| 1371 |
</dd> |
| 1372 |
<dt>or</dt> |
| 1373 |
<dd><dl class="simple"> |
| 1374 |
<dt>nested</dt> |
| 1375 |
<dd><p>definition lists</p> |
| 1376 |
</dd> |
| 1377 |
</dl> |
| 1378 |
</dd> |
| 1379 |
</dl> |
| 1380 |
</section> |
| 1381 |
<section id="details-disclosure-elements"> |
| 1382 |
<h4><a class="toc-backref" href="#toc-entry-47" role="doc-backlink"><span class="sectnum">3.2.2 </span>Details disclosure elements</a></h4> |
| 1383 |
<p>Items of <a class="reference internal" href="#definition-lists">definition lists</a> with class argument "details" are converted |
| 1384 |
to <a class="reference external" href="https://www.w3.org/TR/html52/interactive-elements.html#the-details-element">details</a> <a class="brackets" href="#footnote-10" id="footnote-reference-23" role="doc-noteref"><span class="fn-bracket">[</span>10<span class="fn-bracket">]</span></a> disclosure elements with the term becoming the "summary".</p> |
| 1385 |
<div class="details" id="closed-details"> |
| 1386 |
<details> |
| 1387 |
<summary>A summary</summary> |
| 1388 |
<p>with details only visible after user interaction.</p> |
| 1389 |
</details> |
| 1390 |
</div> |
| 1391 |
<div class="details open" id="open-details"> |
| 1392 |
<details open="open"> |
| 1393 |
<summary>Another summary</summary> |
| 1394 |
<p>with open details because the source list has the additional class |
| 1395 |
value "open".</p> |
| 1396 |
</details> |
| 1397 |
</div> |
| 1398 |
</section> |
| 1399 |
<section id="field-list-variants"> |
| 1400 |
<h4><a class="toc-backref" href="#toc-entry-48" role="doc-backlink"><span class="sectnum">3.2.3 </span>Field List Variants</a></h4> |
| 1401 |
<p>For field lists, the "compact/open", "narrow" and "run-in" styles are defined |
| 1402 |
in the style sheets <span class="docutils literal">plain.css</span> and <span class="docutils literal">responsive.css</span>.</p> |
| 1403 |
<dl class="simple"> |
| 1404 |
<dt><em>compact</em></dt> |
| 1405 |
<dd><dl class="compact field-list simple"> |
| 1406 |
<dt>Feature<span class="colon">:</span></dt> |
| 1407 |
<dd><p>No additional space between list items.</p> |
| 1408 |
</dd> |
| 1409 |
<dt>Option<span class="colon">:</span></dt> |
| 1410 |
<dd><p>The <span class="docutils literal"><span class="pre">--compact-field-lists</span></span> command line option (and the |
| 1411 |
corresponding configuration setting) set the <cite>compact</cite> |
| 1412 |
class argument on all "simple" field lists, if not |
| 1413 |
overridden with <cite>open</cite>.</p> |
| 1414 |
</dd> |
| 1415 |
<dt>Use<span class="colon">:</span></dt> |
| 1416 |
<dd><p>For lists with short field body.</p> |
| 1417 |
</dd> |
| 1418 |
</dl> |
| 1419 |
</dd> |
| 1420 |
<dt><em>open</em></dt> |
| 1421 |
<dd><dl class="open field-list"> |
| 1422 |
<dt>Feature<span class="colon">:</span></dt> |
| 1423 |
<dd><p>Additional space between list items also in "simple" lists. |
| 1424 |
(Overrides the <span class="docutils literal"><span class="pre">--compact-field-lists</span></span> command line |
| 1425 |
option and the corresponding configuration setting)</p> |
| 1426 |
</dd> |
| 1427 |
<dt>Use<span class="colon">:</span></dt> |
| 1428 |
<dd><p>For "simple" lists that should keep the space between list items.</p> |
| 1429 |
</dd> |
| 1430 |
</dl> |
| 1431 |
</dd> |
| 1432 |
<dt><em>narrow</em></dt> |
| 1433 |
<dd><dl class="narrow field-list simple"> |
| 1434 |
<dt>Feature<span class="colon">:</span></dt> |
| 1435 |
<dd><p>Less indented field body.</p> |
| 1436 |
</dd> |
| 1437 |
<dt>Use<span class="colon">:</span></dt> |
| 1438 |
<dd><p>For lists with short field names.</p> |
| 1439 |
</dd> |
| 1440 |
<dt>A long field name<span class="colon">:</span></dt> |
| 1441 |
<dd><p>sticks into the field body and the field body starts on a |
| 1442 |
new line (if not combined with <a class="reference internal" href="#run-in">run-in</a>).</p> |
| 1443 |
</dd> |
| 1444 |
</dl> |
| 1445 |
</dd> |
| 1446 |
<dt>custom <em>field-indent</em></dt> |
| 1447 |
<dd><dl class="field-list simple" style="--field-indent: 3em;"> |
| 1448 |
<dt>Feature<span class="colon">:</span></dt> |
| 1449 |
<dd><p>Field body indented by custom amount.</p> |
| 1450 |
</dd> |
| 1451 |
<dt>Use<span class="colon">:</span></dt> |
| 1452 |
<dd><p>class value starting with <span class="docutils literal"><span class="pre">field-indent-</span></span> followed by |
| 1453 |
a valid length, e.g. <span class="docutils literal"><span class="pre">field-indent-3em</span></span>.</p> |
| 1454 |
</dd> |
| 1455 |
<dt>The writer<span class="colon">:</span></dt> |
| 1456 |
<dd><p>will convert this class value to a <span class="docutils literal">style</span> attribute setting.</p> |
| 1457 |
</dd> |
| 1458 |
</dl> |
| 1459 |
</dd> |
| 1460 |
</dl> |
| 1461 |
<dl class="simple" id="run-in"> |
| 1462 |
<dt><em>run-in</em></dt> |
| 1463 |
<dd><dl class="run-in field-list simple"> |
| 1464 |
<dt>Feature<span class="colon">:</span></dt> |
| 1465 |
<dd><p>Field body starts on the same line also after long field |
| 1466 |
names.</p> |
| 1467 |
</dd> |
| 1468 |
<dt>A long field name<span class="colon">:</span></dt> |
| 1469 |
<dd><p>sticks into the field body which continues on |
| 1470 |
the same line.</p> |
| 1471 |
</dd> |
| 1472 |
<dt>The next field name<span class="colon">:</span></dt> |
| 1473 |
<dd><p>and field body should align. Long text in the field |
| 1474 |
body is wrapped and aligns with other fields.</p> |
| 1475 |
</dd> |
| 1476 |
</dl> |
| 1477 |
</dd> |
| 1478 |
</dl> |
| 1479 |
</section> |
| 1480 |
<section id="table-variants"> |
| 1481 |
<h4><a class="toc-backref" href="#toc-entry-49" role="doc-backlink"><span class="sectnum">3.2.4 </span>Table Variants</a></h4> |
| 1482 |
<p>The following styles can be applied to individual tables via a class |
| 1483 |
argument or as document wide setting with the <a class="reference external" href="https://docutils.sourceforge.io/docs/user/config.html#table-style">table-style</a> <a class="brackets" href="#footnote-11" id="footnote-reference-24" role="doc-noteref"><span class="fn-bracket">[</span>11<span class="fn-bracket">]</span></a> configuration |
| 1484 |
setting (or command line argument).</p> |
| 1485 |
<ul> |
| 1486 |
<li><p>Numbered tables can be achieved with the "numbered" class option:</p> |
| 1487 |
<table class="numbered"> |
| 1488 |
<caption>truth values</caption> |
| 1489 |
<thead> |
| 1490 |
<tr><th class="head"><p>A</p></th> |
| 1491 |
<th class="head"><p>B</p></th> |
| 1492 |
<th class="head"><p>A or B</p></th> |
| 1493 |
</tr> |
| 1494 |
</thead> |
| 1495 |
<tbody> |
| 1496 |
<tr><td><p>False</p></td> |
| 1497 |
<td><p>False</p></td> |
| 1498 |
<td><p>False</p></td> |
| 1499 |
</tr> |
| 1500 |
<tr><td><p>True</p></td> |
| 1501 |
<td><p>False</p></td> |
| 1502 |
<td><p>True</p></td> |
| 1503 |
</tr> |
| 1504 |
<tr><td><p>False</p></td> |
| 1505 |
<td><p>True</p></td> |
| 1506 |
<td><p>True</p></td> |
| 1507 |
</tr> |
| 1508 |
<tr><td><p>True</p></td> |
| 1509 |
<td><p>True</p></td> |
| 1510 |
<td><p>True</p></td> |
| 1511 |
</tr> |
| 1512 |
</tbody> |
| 1513 |
</table> |
| 1514 |
<p>Currently, referencing to the table by number is not supported. This is a |
| 1515 |
common request and already on the <cite>TODO list</cite>.</p> |
| 1516 |
</li> |
| 1517 |
<li><p>A table with "booktabs" class value, is rendered similar to the style |
| 1518 |
from the <a class="reference external" href="http://tug.ctan.org/tex-archive/macros/latex/contrib/booktabs/booktabs.pdf">booktabs</a> <a class="brackets" href="#footnote-12" id="footnote-reference-25" role="doc-noteref"><span class="fn-bracket">[</span>12<span class="fn-bracket">]</span></a> LaTeX package.</p> |
| 1519 |
</li> |
| 1520 |
</ul> |
| 1521 |
<p>"Booktabs" style table, numbered, centre-aligned, with auto-sized columns:</p> |
| 1522 |
<blockquote> |
| 1523 |
<table class="align-center booktabs numbered"> |
| 1524 |
<caption>I/O values</caption> |
| 1525 |
<thead> |
| 1526 |
<tr><th class="head" colspan="2"><p>Input</p></th> |
| 1527 |
<th class="head"><p>Output</p></th> |
| 1528 |
</tr> |
| 1529 |
<tr><th class="head"><p>A</p></th> |
| 1530 |
<th class="head"><p>B</p></th> |
| 1531 |
<th class="head"><p>A or B</p></th> |
| 1532 |
</tr> |
| 1533 |
</thead> |
| 1534 |
<tbody> |
| 1535 |
<tr><td><p>False</p></td> |
| 1536 |
<td><p>False</p></td> |
| 1537 |
<td><p>False</p></td> |
| 1538 |
</tr> |
| 1539 |
<tr><td><p>True</p></td> |
| 1540 |
<td><p>False</p></td> |
| 1541 |
<td><p>True</p></td> |
| 1542 |
</tr> |
| 1543 |
<tr><td><p>False</p></td> |
| 1544 |
<td><p>True</p></td> |
| 1545 |
<td><p>True</p></td> |
| 1546 |
</tr> |
| 1547 |
<tr><td><p>True</p></td> |
| 1548 |
<td><p>True</p></td> |
| 1549 |
<td><p>True</p></td> |
| 1550 |
</tr> |
| 1551 |
</tbody> |
| 1552 |
</table> |
| 1553 |
</blockquote> |
| 1554 |
</section> |
| 1555 |
<section id="numbered-figures"> |
| 1556 |
<h4><a class="toc-backref" href="#toc-entry-50" role="doc-backlink"><span class="sectnum">3.2.5 </span>Numbered Figures</a></h4> |
| 1557 |
<p>Numbered figures can be achieved with the "numbered" <span class="docutils literal">:figclass:</span> option:</p> |
| 1558 |
<figure class="numbered"> |
| 1559 |
<svg xmlns="http://www.w3.org/2000/svg" version="1.1" viewBox="0 0 240 32" style="width: 100%;"> |
| 1560 |
<title>reStructuredText, the markup syntax</title><text x="30.931458" y="27.488001" fill="#000000" font-family="'Times New Roman', 'Liberation Serif', FreeSerif, serif" font-size="32px" font-style="italic" letter-spacing="0px" stroke-width="1px" word-spacing="0px"><tspan x="6.9314575" y="27.488001">re<tspan font-family="Helvetica, 'Liberation Sans', FreeSans, sans-serif" font-style="normal">Structured</tspan>Text</tspan></text> |
| 1561 |
</svg> |
| 1562 |
<figcaption> |
| 1563 |
<p>Embedded SVG image in a numbered figure.</p> |
| 1564 |
</figcaption> |
| 1565 |
</figure> |
| 1566 |
</section> |
| 1567 |
</section> |
| 1568 |
<section id="text-level-semantics"> |
| 1569 |
<h3><a class="toc-backref" href="#toc-entry-51" role="doc-backlink"><span class="sectnum">3.3 </span>Text-Level Semantics</a></h3> |
| 1570 |
<p>This section describes the <a class="reference external" href="https://html.spec.whatwg.org/#text-level-semantics">HTML 5 tags for representation of text-level |
| 1571 |
semantics</a> <a class="brackets" href="#footnote-19" id="footnote-reference-33" role="doc-noteref"><span class="fn-bracket">[</span>19<span class="fn-bracket">]</span></a> and their reStructuredText equivalents.</p> |
| 1572 |
<dl class="description"> |
| 1573 |
<dt>a</dt> |
| 1574 |
<dd><p>Hyperlinks</p> |
| 1575 |
<blockquote> |
| 1576 |
<p>Visit my <a class="reference external" href="example.org:drinks.html">drinks</a> page.</p> |
| 1577 |
</blockquote> |
| 1578 |
</dd> |
| 1579 |
<dt>em</dt> |
| 1580 |
<dd><p>Stress emphasis</p> |
| 1581 |
<blockquote> |
| 1582 |
<p>I must say I <em>adore</em> lemonade. I's <em>sooo</em> sweet.</p> |
| 1583 |
</blockquote> |
| 1584 |
</dd> |
| 1585 |
<dt>strong</dt> |
| 1586 |
<dd><p>Importance</p> |
| 1587 |
<blockquote> |
| 1588 |
<p><strong>Warning</strong>: This tea is <strong>very hot</strong>.</p> |
| 1589 |
</blockquote> |
| 1590 |
</dd> |
| 1591 |
<dt>small</dt> |
| 1592 |
<dd><p>Side comments</p> |
| 1593 |
<blockquote> |
| 1594 |
<p>These grapes are made into wine. |
| 1595 |
<small>Alcohol is addictive.</small></p> |
| 1596 |
</blockquote> |
| 1597 |
</dd> |
| 1598 |
<dt>s</dt> |
| 1599 |
<dd><p>Inaccurate text</p> |
| 1600 |
<blockquote> |
| 1601 |
<p>Price: <s>£4.50</s> £2.00!</p> |
| 1602 |
</blockquote> |
| 1603 |
</dd> |
| 1604 |
<dt>cite</dt> |
| 1605 |
<dd><p>Titles of works</p> |
| 1606 |
<blockquote> |
| 1607 |
<p>The case <cite>Hugo v. Danielle</cite> is relevant here. |
| 1608 |
I recommend reading <cite>Harry Potter</cite>.</p> |
| 1609 |
</blockquote> |
| 1610 |
</dd> |
| 1611 |
<dt>q</dt> |
| 1612 |
<dd><p>Quotations</p> |
| 1613 |
<blockquote> |
| 1614 |
<p>The judge said <q>You can drink water from the fish tank</q> |
| 1615 |
but advised against it.</p> |
| 1616 |
</blockquote> |
| 1617 |
</dd> |
| 1618 |
<dt>dfn</dt> |
| 1619 |
<dd><p>Defining instance</p> |
| 1620 |
<blockquote> |
| 1621 |
<p>The term <dfn>organic food</dfn> refers to food produced without synthetic |
| 1622 |
chemicals.</p> |
| 1623 |
</blockquote> |
| 1624 |
</dd> |
| 1625 |
<dt>abbr</dt> |
| 1626 |
<dd><p>Abbreviations <a class="brackets" href="#attribute-optional" id="footnote-reference-10" role="doc-noteref"><span class="fn-bracket">[</span>5<span class="fn-bracket">]</span></a></p> |
| 1627 |
<blockquote> |
| 1628 |
<p>Organic food in Ireland is certified by the <abbr>IOFGA</abbr> <a class="brackets" href="#footnote-6" id="footnote-reference-11" role="doc-noteref"><span class="fn-bracket">[</span>‡<span class="fn-bracket">]</span></a></p> |
| 1629 |
</blockquote> |
| 1630 |
<p>In rST there are separate roles for <cite>abbreviations</cite> <abbr>rsp.</abbr> |
| 1631 |
<cite>acronymes</cite>. In HTML, the <acronym> tag is obsolete and authors are |
| 1632 |
advised to use <abbr> instead. The HTML5 writer uses <abbr> for Docutil's |
| 1633 |
<abbreviation> element.</p> |
| 1634 |
<aside class="footnote-list brackets"> |
| 1635 |
<aside class="footnote brackets" id="footnote-6" role="doc-footnote"> |
| 1636 |
<span class="label"><span class="fn-bracket">[</span><a role="doc-backlink" href="#footnote-reference-11">‡</a><span class="fn-bracket">]</span></span> |
| 1637 |
<p>Irish Organic Farmers and Growers Association</p> |
| 1638 |
</aside> |
| 1639 |
</aside> |
| 1640 |
</dd> |
| 1641 |
<dt>ruby, rt, rp</dt> |
| 1642 |
<dd><p>Ruby annotations</p> |
| 1643 |
<p>Require inline nesting, currently not supported in rST.</p> |
| 1644 |
|
| 1645 |
</dd> |
| 1646 |
<dt>data</dt> |
| 1647 |
<dd><p>Machine-readable equivalent <a class="brackets" href="#attribute-required" id="footnote-reference-12" role="doc-noteref"><span class="fn-bracket">[</span>6<span class="fn-bracket">]</span></a></p> |
| 1648 |
|
| 1649 |
|
| 1650 |
</dd> |
| 1651 |
<dt>time</dt> |
| 1652 |
<dd><p>Machine-readable equivalent of date- or time-related data <a class="brackets" href="#attribute-required" id="footnote-reference-13" role="doc-noteref"><span class="fn-bracket">[</span>6<span class="fn-bracket">]</span></a></p> |
| 1653 |
|
| 1654 |
</dd> |
| 1655 |
<dt>code</dt> |
| 1656 |
<dd><p>Computer code</p> |
| 1657 |
<blockquote> |
| 1658 |
<p>The <code>fruitdb</code> program can be used for tracking fruit production.</p> |
| 1659 |
</blockquote> |
| 1660 |
</dd> |
| 1661 |
<dt>var</dt> |
| 1662 |
<dd><p>Variables</p> |
| 1663 |
<blockquote> |
| 1664 |
<p>If there are <var>n</var> fruit in the bowl, at least <var>n</var>÷2 will be |
| 1665 |
ripe.</p> |
| 1666 |
</blockquote> |
| 1667 |
</dd> |
| 1668 |
<dt>samp</dt> |
| 1669 |
<dd><p>Computer output</p> |
| 1670 |
<blockquote> |
| 1671 |
<p>The computer said <samp class="docutils literal">Unknown error <span class="pre">-3</span></samp>.</p> |
| 1672 |
</blockquote> |
| 1673 |
</dd> |
| 1674 |
<dt>kbd</dt> |
| 1675 |
<dd><p>User input</p> |
| 1676 |
<blockquote> |
| 1677 |
<p>Hit <kbd>F1</kbd> to continue.</p> |
| 1678 |
</blockquote> |
| 1679 |
</dd> |
| 1680 |
<dt>sub</dt> |
| 1681 |
<dd><p>Subscripts</p> |
| 1682 |
<blockquote> |
| 1683 |
<p>Water is H<sub>2</sub>O.</p> |
| 1684 |
</blockquote> |
| 1685 |
</dd> |
| 1686 |
<dt>sup</dt> |
| 1687 |
<dd><p>Superscripts</p> |
| 1688 |
<blockquote> |
| 1689 |
<p>The Hydrogen in heavy water is usually <sup>2</sup>H.</p> |
| 1690 |
</blockquote> |
| 1691 |
</dd> |
| 1692 |
<dt>i</dt> |
| 1693 |
<dd><p>Alternative voice</p> |
| 1694 |
<blockquote> |
| 1695 |
<p>Lemonade consists primarily of <i lang="la">Citrus limon</i>.</p> |
| 1696 |
</blockquote> |
| 1697 |
</dd> |
| 1698 |
<dt>b</dt> |
| 1699 |
<dd><p>Keywords</p> |
| 1700 |
<blockquote> |
| 1701 |
<p>Take a <b>lemon</b> and squeeze it with a <b>juicer</b>.</p> |
| 1702 |
</blockquote> |
| 1703 |
</dd> |
| 1704 |
<dt>u</dt> |
| 1705 |
<dd><p>Annotations</p> |
| 1706 |
<blockquote> |
| 1707 |
<p>The mixture of apple juice and <u class="spelling">eldeflower</u> juice is very |
| 1708 |
pleasant.</p> |
| 1709 |
</blockquote> |
| 1710 |
</dd> |
| 1711 |
<dt>mark</dt> |
| 1712 |
<dd><p>Highlight</p> |
| 1713 |
<blockquote> |
| 1714 |
<p>Elderflower cordial, with one <mark>part</mark> cordial to ten |
| 1715 |
<mark>part</mark>s water, stands a<mark>part</mark> from the rest.</p> |
| 1716 |
</blockquote> |
| 1717 |
</dd> |
| 1718 |
<dt>bdi</dt> |
| 1719 |
<dd><p>Text directionality isolation <a class="brackets" href="#attribute-optional" id="footnote-reference-14" role="doc-noteref"><span class="fn-bracket">[</span>5<span class="fn-bracket">]</span></a></p> |
| 1720 |
<blockquote> |
| 1721 |
<p>The recommended restaurant is <bdi>My Juice Café (At The Beach)</bdi>.</p> |
| 1722 |
</blockquote> |
| 1723 |
<p>The <cite>dir</cite> global attribute defaults to "auto" (not "inherit") on this |
| 1724 |
element.</p> |
| 1725 |
</dd> |
| 1726 |
<dt>bdo</dt> |
| 1727 |
<dd><p>Text directionality formatting <a class="brackets" href="#attribute-required" id="footnote-reference-15" role="doc-noteref"><span class="fn-bracket">[</span>6<span class="fn-bracket">]</span></a></p> |
| 1728 |
|
| 1729 |
|
| 1730 |
<p>Authors <em>must</em> specify the dir attribute on this element.</p> |
| 1731 |
</dd> |
| 1732 |
<dt>span</dt> |
| 1733 |
<dd><p>Other</p> |
| 1734 |
<blockquote> |
| 1735 |
<p>In French we call it <span lang="fr">sirop de sureau</span>.</p> |
| 1736 |
</blockquote> |
| 1737 |
</dd> |
| 1738 |
<dt>br</dt> |
| 1739 |
<dd><p>Line break</p> |
| 1740 |
<p>For complete paragraphs, use a line-block:</p> |
| 1741 |
<blockquote> |
| 1742 |
<div class="line-block"> |
| 1743 |
<div class="line">Simply Orange Juice Company</div> |
| 1744 |
<div class="line">Apopka, FL 32703</div> |
| 1745 |
<div class="line">U.S.A.</div> |
| 1746 |
</div> |
| 1747 |
</blockquote> |
| 1748 |
<p>rST does not natively support an exceptional hard line break in a floating |
| 1749 |
paragraph. You may use a HTML-only substitution.</p> |
| 1750 |
<blockquote> |
| 1751 |
<p>I want to break this line after the colon: <br /> but allow other |
| 1752 |
linebreaks in this paragraph according to the width of the containing |
| 1753 |
block.</p> |
| 1754 |
</blockquote> |
| 1755 |
</dd> |
| 1756 |
<dt>wbr</dt> |
| 1757 |
<dd><p>Line breaking opportunity</p> |
| 1758 |
<p>Not supported by rST. You may use a ZWSP character (u200B), literal or via |
| 1759 |
a substitution.</p> |
| 1760 |
<blockquote> |
| 1761 |
<p>www.simplyorangejuice.com</p> |
| 1762 |
</blockquote> |
| 1763 |
</dd> |
| 1764 |
</dl> |
| 1765 |
<aside class="footnote-list brackets"> |
| 1766 |
<aside class="footnote brackets" id="attribute-optional" role="doc-footnote"> |
| 1767 |
<span class="label"><span class="fn-bracket">[</span>5<span class="fn-bracket">]</span></span> |
| 1768 |
<span class="backrefs">(<a role="doc-backlink" href="#footnote-reference-10">1</a>,<a role="doc-backlink" href="#footnote-reference-14">2</a>,<a role="doc-backlink" href="#footnote-reference-16">3</a>,<a role="doc-backlink" href="#footnote-reference-17">4</a>)</span> |
| 1769 |
<p>Would gain from support for attributes/arguments |
| 1770 |
to inline roles. See <a class="reference external" href="https://docutils.sourceforge.io/docs/dev/todo.html#interpreted-text">TODO</a> <a class="brackets" href="#footnote-13" id="footnote-reference-26" role="doc-noteref"><span class="fn-bracket">[</span>13<span class="fn-bracket">]</span></a></p> |
| 1771 |
</aside> |
| 1772 |
<aside class="footnote brackets" id="attribute-required" role="doc-footnote"> |
| 1773 |
<span class="label"><span class="fn-bracket">[</span>6<span class="fn-bracket">]</span></span> |
| 1774 |
<span class="backrefs">(<a role="doc-backlink" href="#footnote-reference-12">1</a>,<a role="doc-backlink" href="#footnote-reference-13">2</a>,<a role="doc-backlink" href="#footnote-reference-15">3</a>)</span> |
| 1775 |
<p>Requires support for attributes to inline |
| 1776 |
roles to make sense.</p> |
| 1777 |
</aside> |
| 1778 |
</aside> |
| 1779 |
</section> |
| 1780 |
<section id="indicating-edits"> |
| 1781 |
<h3><a class="toc-backref" href="#toc-entry-52" role="doc-backlink"><span class="sectnum">3.4 </span>Indicating Edits</a></h3> |
| 1782 |
<p>The <a class="reference external" href="https://html.spec.whatwg.org/multipage/edits.html">HTML tags for representation of edits to the document</a> <a class="brackets" href="#footnote-20" id="footnote-reference-34" role="doc-noteref"><span class="fn-bracket">[</span>20<span class="fn-bracket">]</span></a> and their |
| 1783 |
reStructuredText equivalents are:</p> |
| 1784 |
<dl class="description"> |
| 1785 |
<dt>ins</dt> |
| 1786 |
<dd><p>Additions <a class="brackets" href="#attribute-optional" id="footnote-reference-16" role="doc-noteref"><span class="fn-bracket">[</span>5<span class="fn-bracket">]</span></a></p> |
| 1787 |
<blockquote> |
| 1788 |
<p>This text has "always" been here. <ins>This text has been inserted.</ins></p> |
| 1789 |
<ins class="docutils container"> |
| 1790 |
<p>This paragraph has been inserted.</p> |
| 1791 |
</ins> |
| 1792 |
</blockquote> |
| 1793 |
</dd> |
| 1794 |
<dt>del</dt> |
| 1795 |
<dd><p>Removed content <a class="brackets" href="#attribute-optional" id="footnote-reference-17" role="doc-noteref"><span class="fn-bracket">[</span>5<span class="fn-bracket">]</span></a></p> |
| 1796 |
<blockquote> |
| 1797 |
<p><del>This text has been deleted</del>, here is the rest of the paragraph.</p> |
| 1798 |
<del class="docutils container"> |
| 1799 |
<p>This paragraph has been deleted.</p> |
| 1800 |
</del> |
| 1801 |
</blockquote> |
| 1802 |
</dd> |
| 1803 |
</dl> |
| 1804 |
</section> |
| 1805 |
<section id="svg-images"> |
| 1806 |
<h3><a class="toc-backref" href="#toc-entry-53" role="doc-backlink"><span class="sectnum">3.5 </span>SVG Images</a></h3> |
| 1807 |
<img alt="../../../docs/user/rst/images/biohazard.svg" class="align-left" src="../../../docs/user/rst/images/biohazard.svg" style="width: 48px; height: 48px;" /> |
| 1808 |
<p>Scalable vector graphics (SVG) images are the only standards-compatible |
| 1809 |
way to include vector graphics in HTML documents. However, they are not |
| 1810 |
supported by all backends/output formats (LaTeX, e.g., supports the PDF |
| 1811 |
or Postscript formats for vector graphics instead). Rendering behaviour |
| 1812 |
varies, depending on the SVG image itself, the method used to put the |
| 1813 |
image in the document, and the viewing agent.</p> |
| 1814 |
<figure class="align-center" style="width: 75%"> |
| 1815 |
<img alt="../../../docs/user/rst/images/title-scaling.svg" src="../../../docs/user/rst/images/title-scaling.svg" style="width: 40%;" /> |
| 1816 |
<figcaption> |
| 1817 |
<p>Figure with image occupying 40% of the figure width.</p> |
| 1818 |
<div class="legend"> |
| 1819 |
<p>The <cite>viewBox</cite> attribute in the image file enables scaling |
| 1820 |
also in <span class="docutils literal"><object></span> and <span class="docutils literal"><svg></span> nodes.</p> |
| 1821 |
</div> |
| 1822 |
</figcaption> |
| 1823 |
</figure> |
| 1824 |
<p>All up-to-date HTML browsers support SVG, however not all do this fully |
| 1825 |
and in the same manner. Some older browsers, especially IE < 9, have |
| 1826 |
deficiencies or require plug-ins (i.e. don't support the <span class="docutils literal"><img></span> tag). |
| 1827 |
Older versions of <cite>webkit</cite> based browsers (chromium, safari, midori, |
| 1828 |
konqueror) support the <span class="docutils literal"><img></span> tag but don't display contained bitmap |
| 1829 |
images.</p> |
| 1830 |
<p>The "html4css1" writer includes SVG images as <span class="docutils literal"><object></span> elements, |
| 1831 |
the "html5" writer uses <span class="docutils literal"><svg></span> for embedded images and <span class="docutils literal"><img></span> |
| 1832 |
else. The element type influences several aspects of image behaviour:</p> |
| 1833 |
<ul> |
| 1834 |
<li><p>Due to security/privacy considerations, browsers may block <span class="docutils literal"><object></span> |
| 1835 |
data from 3rd party sources.</p></li> |
| 1836 |
<li><p>If an image is included as <span class="docutils literal"><object></span> or <span class="docutils literal"><svg></span>, |
| 1837 |
it depends on the <cite>viewBox</cite> declaration of the root <span class="docutils literal"><svg></span> element |
| 1838 |
whether it is scaled or clipped/padded. |
| 1839 |
Images in <span class="docutils literal"><img></span> elements are always scaled.</p> |
| 1840 |
<img alt="../../../docs/user/rst/images/biohazard-scaling.svg" class="align-left" src="../../../docs/user/rst/images/biohazard-scaling.svg" style="height: 1.2em;" /> |
| 1841 |
<p>Image with <cite>viewBox</cite>, 1.2 em high, left aligned and <img alt="inline-svg" src="../../../docs/user/rst/images/biohazard-scaling.svg" style="height: 1.2em;" /> inline.</p> |
| 1842 |
<img alt="../../../docs/user/rst/images/biohazard-scaling.svg" class="align-left" src="../../../docs/user/rst/images/biohazard-scaling.svg" style="width: 15mm; height: 5mm;" /> |
| 1843 |
<p>Image with <cite>viewBox</cite>, 5 mm x 15 mm.</p> |
| 1844 |
<img alt="../../../docs/user/rst/images/biohazard.svg" class="align-left" src="../../../docs/user/rst/images/biohazard.svg" style="width: 15mm; height: 5mm;" /> |
| 1845 |
<p>Image without <cite>viewBox</cite>, 5 mm x 15 mm.</p> |
| 1846 |
<img alt="../../../docs/user/rst/images/biohazard-bitmap-scaling.svg" class="align-left" src="../../../docs/user/rst/images/biohazard-bitmap-scaling.svg" style="width: 2em;" /> |
| 1847 |
<p>Image with embedded bitmap and <cite>viewBox</cite>, 2 em wide.</p> |
| 1848 |
<img alt="../../../docs/user/rst/images/biohazard-bitmap.svg" class="align-left" src="../../../docs/user/rst/images/biohazard-bitmap.svg" style="width: 2em;" /> |
| 1849 |
<p>Image with embedded bitmap without <cite>viewBox</cite>.</p> |
| 1850 |
</li> |
| 1851 |
<li><p>SVG images with <cite>viewBox</cite> keep the aspect ratio unless the |
| 1852 |
<cite>preserveAspectRatio</cite> attribute is <span class="docutils literal">"none"</span>. |
| 1853 |
The following two images are 25% wide and 1 em high:</p> |
| 1854 |
<img alt="../../../docs/user/rst/images/title-scaling.svg" class="align-left" src="../../../docs/user/rst/images/title-scaling.svg" style="width: 25%; height: 1em;" /> |
| 1855 |
<p>Image with <cite>viewBox</cite>.</p> |
| 1856 |
<img alt="../../../docs/user/rst/images/title.svg" class="align-left" src="../../../docs/user/rst/images/title.svg" style="width: 25%; height: 1em;" /> |
| 1857 |
<p>Image without <cite>viewBox</cite>.</p> |
| 1858 |
<a class="reference external image-reference" href="http://oreillymedia.github.io/svg-essentials-examples/ch14/animated_clock_js.svg"> |
| 1859 |
<img alt="[animated clock]" class="align-right" src="http://oreillymedia.github.io/svg-essentials-examples/ch14/animated_clock_js.svg" style="height: 3em;" /> |
| 1860 |
</a> |
| 1861 |
</li> |
| 1862 |
<li><p>Hyperlinks and script actions attached to SVG elements are ignored in |
| 1863 |
images included as <span class="docutils literal"><img></span>. Hyperlinks in images included as |
| 1864 |
<span class="docutils literal"><object></span> are opened in the "object frame". Hyperlinks specified in |
| 1865 |
the rST source (with the <span class="docutils literal">:target:</span> directive option) work in |
| 1866 |
<span class="docutils literal"><img></span> and <span class="docutils literal"><svg></span> elements but are ignored in images included as |
| 1867 |
<span class="docutils literal"><object></span> (unless the object is blocked).</p> |
| 1868 |
<a class="reference internal image-reference" href="#svg-images"> |
| 1869 |
<img alt="../input/data/object-with-hyperlink.svg" class="align-left" src="../input/data/object-with-hyperlink.svg" style="width: 2.4em;" /> |
| 1870 |
</a> |
| 1871 |
<a class="reference internal image-reference" href="#svg-images"> |
| 1872 |
<img alt="../input/data/interactive-button.svg" class="align-right" src="../input/data/interactive-button.svg" /> |
| 1873 |
</a> |
| 1874 |
<p>Image with a link attached to the upper rectangle; |
| 1875 |
interactive clock and button aligned to the right.</p> |
| 1876 |
<a class="reference internal image-reference" href="#svg-images"> |
| 1877 |
<svg xmlns="http://www.w3.org/2000/svg" xmlns:xlink="http://www.w3.org/1999/xlink" width="32" height="32" version="1.1" viewBox="0 0 32 32" style="width: 2.4em;" class="align-left"> |
| 1878 |
<a xlink:href="https://docutils.sourceforge.io"> |
| 1879 |
<rect width="20" height="20" style="fill:#73ffce" /> |
| 1880 |
</a> |
| 1881 |
<rect x="12" y="12" width="20" height="20" style="fill:#d3e0f6" /> |
| 1882 |
</svg> |
| 1883 |
</a> |
| 1884 |
<a class="reference internal image-reference" href="#svg-images"> |
| 1885 |
<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 50 22" height="2em" class="align-right"> |
| 1886 |
<script type="text/javascript"> |
| 1887 |
function buttonClick(evt) { |
| 1888 |
alert('Click'); |
| 1889 |
} |
| 1890 |
</script> |
| 1891 |
<g onmouseup="buttonClick(evt)"> |
| 1892 |
<rect x="0" y="0" rx="5" ry="5" width="50" height="22" style="fill: #85ffdb; cursor: pointer;" /> |
| 1893 |
<text x="5" y="16" font-size="12px">Button</text> |
| 1894 |
</g> |
| 1895 |
</svg> |
| 1896 |
</a> |
| 1897 |
<p>Embedded interactive SVG images.</p> |
| 1898 |
</li> |
| 1899 |
</ul> |
| 1900 |
</section> |
| 1901 |
</section> |
| 1902 |
<section id="error-handling"> |
| 1903 |
<h2><a class="toc-backref" href="#toc-entry-54" role="doc-backlink"><span class="sectnum">4 </span>Error Handling</a></h2> |
| 1904 |
<p>Any errors caught during processing will generate system messages.</p> |
| 1905 |
<p>There should be five messages in the following, auto-generated |
| 1906 |
section, "Docutils System Messages":</p> |
| 1907 |
|
| 1908 |
</section> |
| 1909 |
<section class="system-messages"> |
| 1910 |
<h2>Docutils System Messages</h2> |
| 1911 |
<aside class="system-message" id="system-message-1"> |
| 1912 |
<p class="system-message-title">System Message: ERROR/3 (<span class="docutils literal">functional/input/data/standard.rst</span>, line 99); <em><a href="#problematic-1">backlink</a></em></p> |
| 1913 |
<p>Undefined substitution referenced: "problematic".</p> |
| 1914 |
</aside> |
| 1915 |
<aside class="system-message" id="system-message-2"> |
| 1916 |
<p class="system-message-title">System Message: ERROR/3 (<span class="docutils literal">functional/input/data/standard.rst</span>, line 390); <em><a href="#footnote-reference-8">backlink</a></em></p> |
| 1917 |
<p>Unknown target name: "5".</p> |
| 1918 |
</aside> |
| 1919 |
<aside class="system-message" id="system-message-3"> |
| 1920 |
<p class="system-message-title">System Message: ERROR/3 (<span class="docutils literal">functional/input/data/standard.rst</span>, line 399); <em><a href="#citation-reference-3">backlink</a></em></p> |
| 1921 |
<p>Unknown target name: "nonexistent".</p> |
| 1922 |
</aside> |
| 1923 |
<aside class="system-message" id="system-message-4"> |
| 1924 |
<p class="system-message-title">System Message: ERROR/3 (<span class="docutils literal">functional/input/data/standard.rst</span>, line 426); <em><a href="#problematic-2">backlink</a></em></p> |
| 1925 |
<p>Unknown target name: "hyperlink reference without a target".</p> |
| 1926 |
</aside> |
| 1927 |
<aside class="system-message" id="system-message-5"> |
| 1928 |
<p class="system-message-title">System Message: ERROR/3 (<span class="docutils literal">functional/input/data/standard.rst</span>, line 439); <em><a href="#problematic-3">backlink</a></em></p> |
| 1929 |
<p>Duplicate target name, cannot be used as a unique reference: "duplicate target names".</p> |
| 1930 |
</aside> |
| 1931 |
</section> |
| 1932 |
</main> |
| 1933 |
<footer> |
| 1934 |
<p>Document footer</p> |
| 1935 |
<p><a class="reference external image-reference" href="http://www.w3.org/TR/html5/"><img alt="Conforms to HTML 5" height="31" src="http://www.w3.org/html/logo/badge/html5-badge-h-css3-semantics.png" width="88" /></a> <a class="reference external image-reference" href="http://validator.w3.org/check?uri=referer"><img alt="Check validity!" height="31" src="https://www.w3.org/Icons/ValidatorSuite/vs-blue-190.png" width="88" /></a> <a class="reference external image-reference" href="http://jigsaw.w3.org/css-validator/check/referer"><img alt="Valid CSS 2.1!" height="31" src="http://jigsaw.w3.org/css-validator/images/vcss" width="88" /></a></p> |
| 1936 |
</footer> |
| 1937 |
</body> |
| 1938 |
</html> |