| Server IP : 82.148.16.210 / Your IP : 216.73.216.32 Web Server : nginx/1.29.5 System : Linux mail.sarafai.ru 6.1.0-43-amd64 #1 SMP PREEMPT_DYNAMIC Debian 6.1.162-1 (2026-02-08) x86_64 User : www-data ( 33) PHP Version : 7.4.33 Disable Function : pcntl_alarm,pcntl_fork,pcntl_waitpid,pcntl_wait,pcntl_wifexited,pcntl_wifstopped,pcntl_wifsignaled,pcntl_wifcontinued,pcntl_wexitstatus,pcntl_wtermsig,pcntl_wstopsig,pcntl_signal,pcntl_signal_get_handler,pcntl_signal_dispatch,pcntl_get_last_error,pcntl_strerror,pcntl_sigprocmask,pcntl_sigwaitinfo,pcntl_sigtimedwait,pcntl_exec,pcntl_getpriority,pcntl_setpriority,pcntl_async_signals,pcntl_unshare, MySQL : OFF | cURL : ON | WGET : ON | Perl : ON | Python : ON | Sudo : ON | Pkexec : OFF Directory : /proc/thread-self/root/usr/share/doc/python3-docutils/docs/user/rst/ |
Upload File : |
<?xml version="1.0" encoding="utf-8" ?> <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd"> <html xmlns="http://www.w3.org/1999/xhtml" xml:lang="en" lang="en"> <head> <meta http-equiv="Content-Type" content="text/html; charset=utf-8" /> <meta name="generator" content="Docutils 0.19: https://docutils.sourceforge.io/" /> <title>The reStructuredText Cheat Sheet: Syntax Reminders</title> <meta name="author" content="David Goodger <goodger@python.org>" /> <meta name="date" content="2022-01-20" /> <link rel="stylesheet" href="../../../css/html4css1.css" type="text/css" /> </head> <body> <div class="document" id="the-restructuredtext-cheat-sheet-syntax-reminders"> <h1 class="title">The <a class="reference external" href="https://docutils.sourceforge.io/rst.html">reStructuredText</a> Cheat Sheet: Syntax Reminders</h1> <table class="docinfo" frame="void" rules="none"> <col class="docinfo-name" /> <col class="docinfo-content" /> <tbody valign="top"> <tr class="info field"><th class="docinfo-name">Info:</th><td class="field-body">See <<a class="reference external" href="https://docutils.sourceforge.io/rst.html">https://docutils.sourceforge.io/rst.html</a>> for introductory docs.</td> </tr> <tr><th class="docinfo-name">Author:</th> <td>David Goodger <<a class="reference external" href="mailto:goodger@python.org">goodger@python.org</a>></td></tr> <tr><th class="docinfo-name">Date:</th> <td>2022-01-20</td></tr> <tr><th class="docinfo-name">Revision:</th> <td>8956</td></tr> <tr class="description field"><th class="docinfo-name">Description:</th><td class="field-body">This is a "docinfo block", or bibliographic field list</td> </tr> </tbody> </table> <div class="admonition note"> <p class="first admonition-title">Note</p> <p class="last">If you are reading this as HTML, please read <a class="reference external" href="cheatsheet.txt">cheatsheet.txt</a> instead to see the input syntax examples!</p> </div> <div class="section" id="section-structure"> <h1>Section Structure</h1> <p>Section titles are underlined or overlined & underlined.</p> </div> <div class="section" id="body-elements"> <h1>Body Elements</h1> <p>Grid table:</p> <table border="1" class="docutils"> <colgroup> <col width="48%" /> <col width="52%" /> </colgroup> <tbody valign="top"> <tr><td><p class="first">Paragraphs are flush-left, separated by blank lines.</p> <blockquote class="last"> Block quotes are indented.</blockquote> </td> <td rowspan="2"><p class="first">Literal block, preceded by "::":</p> <pre class="literal-block"> Indented </pre> <p>or:</p> <pre class="last literal-block"> > Quoted </pre> </td> </tr> <tr><td><pre class="first last doctest-block"> >>> print 'Doctest block' Doctest block </pre> </td> </tr> <tr><td colspan="2"><div class="first last line-block"> <div class="line">Line blocks preserve line breaks & indents. [new in 0.3.6]</div> <div class="line-block"> <div class="line">Useful for addresses, verse, and adornment-free lists; long lines can be wrapped with continuation lines.</div> </div> </div> </td> </tr> </tbody> </table> <p>Simple tables:</p> <table border="1" class="docutils"> <colgroup> <col width="21%" /> <col width="79%" /> </colgroup> <thead valign="bottom"> <tr><th class="head">List Type</th> <th class="head">Examples (syntax in the <a class="reference external" href="cheatsheet.txt">text source</a>)</th> </tr> </thead> <tbody valign="top"> <tr><td>Bullet list</td> <td><ul class="first last simple"> <li>items begin with "-", "+", or "*"</li> </ul> </td> </tr> <tr><td>Enumerated list</td> <td><ol class="first last arabic simple"> <li>items use any variation of "1.", "A)", and "(i)"</li> <li>also auto-enumerated</li> </ol> </td> </tr> <tr><td>Definition list</td> <td><dl class="first last docutils"> <dt>Term is flush-left <span class="classifier-delimiter">:</span> <span class="classifier">optional classifier</span></dt> <dd>Definition is indented, no blank line between</dd> </dl> </td> </tr> <tr><td>Field list</td> <td><table class="first last docutils field-list" frame="void" rules="none"> <col class="field-name" /> <col class="field-body" /> <tbody valign="top"> <tr class="field"><th class="field-name">field name:</th><td class="field-body">field body</td> </tr> </tbody> </table> </td> </tr> <tr><td>Option list</td> <td><table class="first last docutils option-list" frame="void" rules="none"> <col class="option" /> <col class="description" /> <tbody valign="top"> <tr><td class="option-group"> <kbd><span class="option">-o</span></kbd></td> <td>at least 2 spaces between option & description</td></tr> </tbody> </table> </td> </tr> </tbody> </table> <table border="1" class="docutils"> <colgroup> <col width="19%" /> <col width="81%" /> </colgroup> <thead valign="bottom"> <tr><th class="head">Explicit Markup</th> <th class="head">Examples (visible in the <a class="reference external" href="cheatsheet.txt">text source</a>)</th> </tr> </thead> <tbody valign="top"> <tr><td>Footnote</td> <td><table class="first last docutils footnote" frame="void" id="footnote-1" rules="none"> <colgroup><col class="label" /><col /></colgroup> <tbody valign="top"> <tr><td class="label"><a class="fn-backref" href="#footnote-reference-1">[1]</a></td><td>Manually numbered or [#] auto-numbered (even [#labelled]) or [*] auto-symbol</td></tr> </tbody> </table> </td> </tr> <tr><td>Citation</td> <td><table class="first last docutils citation" frame="void" id="cit2002" rules="none"> <colgroup><col class="label" /><col /></colgroup> <tbody valign="top"> <tr><td class="label"><a class="fn-backref" href="#citation-reference-1">[CIT2002]</a></td><td>A citation.</td></tr> </tbody> </table> </td> </tr> <tr><td>Hyperlink Target</td> <td></td> </tr> <tr id="internal-target"><td>Anonymous Target</td> <td></td> </tr> <tr><td>Directive ("::")</td> <td><img alt="images/biohazard.png" class="first last" src="images/biohazard.png" /> </td> </tr> <tr><td>Substitution Def</td> <td></td> </tr> <tr><td>Comment</td> <td><!-- is anything else --> </td> </tr> <tr><td>Empty Comment</td> <td>(".." on a line by itself, with blank lines before & after, used to separate indentation contexts)</td> </tr> </tbody> </table> </div> <div class="section" id="inline-markup"> <h1>Inline Markup</h1> <p><em>emphasis</em>; <strong>strong emphasis</strong>; <cite>interpreted text</cite>; <em>interpreted text with role</em>; <tt class="docutils literal">inline literal text</tt>; standalone hyperlink, <a class="reference external" href="https://docutils.sourceforge.io">https://docutils.sourceforge.io</a>; named reference, <a class="reference external" href="https://docutils.sourceforge.io/rst.html">reStructuredText</a>; <a class="reference external" href="https://docutils.sourceforge.io/docs/ref/rst/restructuredtext.html">anonymous reference</a>; footnote reference, <a class="footnote-reference" href="#footnote-1" id="footnote-reference-1">[1]</a>; citation reference, <a class="citation-reference" href="#cit2002" id="citation-reference-1">[CIT2002]</a>; like an inline directive; <span class="target" id="inline-internal-target">inline internal target</span>.</p> </div> <div class="section" id="directive-quick-reference"> <h1>Directive Quick Reference</h1> <p>See <<a class="reference external" href="https://docutils.sourceforge.io/docs/ref/rst/directives.html">https://docutils.sourceforge.io/docs/ref/rst/directives.html</a>> for full info.</p> <table border="1" class="docutils"> <colgroup> <col width="21%" /> <col width="79%" /> </colgroup> <thead valign="bottom"> <tr><th class="head">Directive Name</th> <th class="head">Description (Docutils version added to, in [brackets])</th> </tr> </thead> <tbody valign="top"> <tr><td>attention</td> <td>Specific admonition; also "caution", "danger", "error", "hint", "important", "note", "tip", "warning"</td> </tr> <tr><td>admonition</td> <td>Generic titled admonition: <tt class="docutils literal">.. admonition:: By The Way</tt></td> </tr> <tr><td>image</td> <td><tt class="docutils literal">.. image:: picture.png</tt>; many options possible</td> </tr> <tr><td>figure</td> <td>Like "image", but with optional caption and legend</td> </tr> <tr><td>topic</td> <td><tt class="docutils literal">.. topic:: Title</tt>; like a mini section</td> </tr> <tr><td>sidebar</td> <td><tt class="docutils literal">.. sidebar:: Title</tt>; like a mini parallel document</td> </tr> <tr><td>parsed-literal</td> <td>A literal block with parsed inline markup</td> </tr> <tr><td>rubric</td> <td><tt class="docutils literal">.. rubric:: Informal Heading</tt></td> </tr> <tr><td>epigraph</td> <td>Block quote with class="epigraph"</td> </tr> <tr><td>highlights</td> <td>Block quote with class="highlights"</td> </tr> <tr><td>pull-quote</td> <td>Block quote with class="pull-quote"</td> </tr> <tr><td>compound</td> <td>Compound paragraphs [0.3.6]</td> </tr> <tr><td>container</td> <td>Generic block-level container element [0.3.10]</td> </tr> <tr><td>table</td> <td>Create a titled table [0.3.1]</td> </tr> <tr><td>list-table</td> <td>Create a table from a uniform two-level bullet list [0.3.8]</td> </tr> <tr><td>csv-table</td> <td>Create a table from CSV data [0.3.4]</td> </tr> <tr><td>contents</td> <td>Generate a table of contents</td> </tr> <tr><td>sectnum</td> <td>Automatically number sections, subsections, etc.</td> </tr> <tr><td>header, footer</td> <td>Create document decorations [0.3.8]</td> </tr> <tr><td>target-notes</td> <td>Create an explicit footnote for each external target</td> </tr> <tr><td>math</td> <td>Mathematical notation (input in LaTeX format)</td> </tr> <tr><td>meta</td> <td>Document metadata</td> </tr> <tr><td>include</td> <td>Read an external reST file as if it were inline</td> </tr> <tr><td>raw</td> <td>Non-reST data passed untouched to the Writer</td> </tr> <tr><td>replace</td> <td>Replacement text for substitution definitions</td> </tr> <tr><td>unicode</td> <td>Unicode character code conversion for substitution defs</td> </tr> <tr><td>date</td> <td>Generates today's date; for substitution defs</td> </tr> <tr><td>class</td> <td>Set a "class" attribute on the next element</td> </tr> <tr><td>role</td> <td>Create a custom interpreted text role [0.3.2]</td> </tr> <tr><td>default-role</td> <td>Set the default interpreted text role [0.3.10]</td> </tr> <tr><td>title</td> <td>Set the metadata document title [0.3.10]</td> </tr> </tbody> </table> </div> <div class="section" id="interpreted-text-role-quick-reference"> <h1>Interpreted Text Role Quick Reference</h1> <p>See <<a class="reference external" href="https://docutils.sourceforge.io/docs/ref/rst/roles.html">https://docutils.sourceforge.io/docs/ref/rst/roles.html</a>> for full info.</p> <table border="1" class="docutils"> <colgroup> <col width="21%" /> <col width="79%" /> </colgroup> <thead valign="bottom"> <tr><th class="head">Role Name</th> <th class="head">Description</th> </tr> </thead> <tbody valign="top"> <tr><td>emphasis</td> <td>Equivalent to <em>emphasis</em></td> </tr> <tr><td>literal</td> <td>Equivalent to <tt class="docutils literal">literal</tt> but processes backslash escapes</td> </tr> <tr><td>math</td> <td>Mathematical notation (input in LaTeX format)</td> </tr> <tr><td>PEP</td> <td>Reference to a numbered Python Enhancement Proposal</td> </tr> <tr><td>RFC</td> <td>Reference to a numbered Internet Request For Comments</td> </tr> <tr><td>raw</td> <td>For non-reST data; cannot be used directly (see docs) [0.3.6]</td> </tr> <tr><td>strong</td> <td>Equivalent to <strong>strong</strong></td> </tr> <tr><td>sub</td> <td>Subscript</td> </tr> <tr><td>sup</td> <td>Superscript</td> </tr> <tr><td>title</td> <td>Title reference (book, etc.); standard default role</td> </tr> </tbody> </table> </div> </div> </body> </html>