A new Riff-radio.org site with a static approach.

quickstart.html 20KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470
  1. <!DOCTYPE html>
  2. <html lang="en">
  3. <head>
  4. <meta charset="utf-8">
  5. <meta name="viewport" content="width=device-width, initial-scale=1">
  6. <title>A reStructuredText Primer | Riff</title>
  7. <link href="../assets/css/all-nocdn.css" rel="stylesheet" type="text/css">
  8. <link rel="alternate" type="application/rss+xml" title="RSS" href="../rss.xml">
  9. <link rel="canonical" href="http://media.pagelibre.org/riff/site/pages/quickstart.html">
  10. <link rel="icon" href="../favicon.ico" sizes="16x16">
  11. <!--[if lt IE 9]><script src="../assets/js/html5.js"></script><![endif]--><meta name="author" content="Riff">
  12. <meta property="og:site_name" content="Riff">
  13. <meta property="og:title" content="A reStructuredText Primer">
  14. <meta property="og:url" content="http://media.pagelibre.org/riff/site/pages/quickstart.html">
  15. <meta property="og:description" content="Author:
  16. Richard Jones
  17. Version:
  18. 5801
  19. Copyright:
  20. This document has been placed in the public domain.
  21. Contents
  22. Structure
  23. Text styles
  24. Lists
  25. Preformatting (code samples)
  26. Sections
  27. Document Title / Subti">
  28. <meta property="og:type" content="article">
  29. <meta property="article:published_time" content="2012-03-30T23:00:00-03:00">
  30. </head>
  31. <body>
  32. <a href="#content" class="sr-only sr-only-focusable">Skip to main content</a>
  33. <!-- Menubar -->
  34. <div class="blog-masthead">
  35. <div class="container">
  36. <!-- This keeps the margins nice -->
  37. <nav class="blog-nav" role="navigation"><a href="../index.html" class="blog-nav-item">Accueil</a>
  38. <a href="about.html" class="blog-nav-item">About Riff</a>
  39. <a href="../rss.xml" class="blog-nav-item">RSS feed</a>
  40. </nav>
  41. </div>
  42. <!-- /.container -->
  43. </div>
  44. <!-- End of Menubar -->
  45. <div class="container" id="content" role="main">
  46. <div class="body-content">
  47. <div class="blog-header">
  48. <h1 class="blog-title">
  49. <a href="http://media.pagelibre.org/riff/site/">
  50. <span id="blog-title">Riff</span>
  51. </a>
  52. </h1>
  53. <p class="lead blog-description">Riff la radio rock</p>
  54. </div>
  55. <!--Body content-->
  56. <div class="row">
  57. <div class="col-sm-8 blog-main">
  58. <article class="post-text storypage" itemscope="itemscope" itemtype="http://schema.org/Article"><header><h2 class="p-name entry-title blog-post-title" itemprop="headline name"><a href="#" class="u-url">A reStructuredText Primer</a></h2>
  59. </header><div class="e-content entry-content" itemprop="articleBody text">
  60. <dl class="docinfo simple">
  61. <dt class="author">Author<span class="colon">:</span>
  62. </dt>
  63. <dd class="author"><p>Richard Jones</p></dd>
  64. <dt class="version">Version<span class="colon">:</span>
  65. </dt>
  66. <dd class="version">5801</dd>
  67. <dt class="copyright">Copyright<span class="colon">:</span>
  68. </dt>
  69. <dd class="copyright">This document has been placed in the public domain.</dd>
  70. </dl>
  71. <nav class="contents alert alert-info pull-left" id="contents" role="doc-toc"><p class="topic-title">Contents</p>
  72. <ul class="simple">
  73. <li><p><a class="reference internal" href="quickstart.html#structure" id="toc-entry-1">Structure</a></p></li>
  74. <li><p><a class="reference internal" href="quickstart.html#text-styles" id="toc-entry-2">Text styles</a></p></li>
  75. <li><p><a class="reference internal" href="quickstart.html#lists" id="toc-entry-3">Lists</a></p></li>
  76. <li><p><a class="reference internal" href="quickstart.html#preformatting-code-samples" id="toc-entry-4">Preformatting (code samples)</a></p></li>
  77. <li>
  78. <p><a class="reference internal" href="quickstart.html#sections" id="toc-entry-5">Sections</a></p>
  79. <ul>
  80. <li><p><a class="reference internal" href="quickstart.html#document-title-subtitle" id="toc-entry-6">Document Title / Subtitle</a></p></li>
  81. </ul>
  82. </li>
  83. <li><p><a class="reference internal" href="quickstart.html#images" id="toc-entry-7">Images</a></p></li>
  84. <li><p><a class="reference internal" href="quickstart.html#what-next" id="toc-entry-8">What Next?</a></p></li>
  85. </ul></nav><p>The text below contains links that look like "(<a class="reference external" href="../quickref/">quickref</a>)". These
  86. are relative links that point to the <a class="reference external" href="../quickref/">Quick reStructuredText</a> user
  87. reference. If these links don't work, please refer to the <a class="reference external" href="https://docutils.sourceforge.io/docs/user/rst/quickref.html">master
  88. quick reference</a> document.</p>
  89. <aside class="admonition note"><p class="admonition-title">Note</p>
  90. <p>This document is an informal introduction to
  91. reStructuredText. The <a class="reference internal" href="quickstart.html#what-next">What Next?</a> section below has links to
  92. further resources, including a formal reference.</p>
  93. </aside><section id="structure"><h2><a class="toc-backref" href="quickstart.html#toc-entry-1" role="doc-backlink">Structure</a></h2>
  94. <p>From the outset, let me say that "Structured Text" is probably a bit
  95. of a misnomer. It's more like "Relaxed Text" that uses certain
  96. consistent patterns. These patterns are interpreted by a HTML
  97. converter to produce "Very Structured Text" that can be used by a web
  98. browser.</p>
  99. <p>The most basic pattern recognised is a <strong>paragraph</strong> (<a class="reference external" href="../quickref/#paragraphs">quickref</a>).
  100. That's a chunk of text that is separated by blank lines (one is
  101. enough). Paragraphs must have the same indentation -- that is, line
  102. up at their left edge. Paragraphs that start indented will result in
  103. indented quote paragraphs. For example:</p>
  104. <pre class="literal-block">This is a paragraph. It's quite
  105. short.
  106. This paragraph will result in an indented block of
  107. text, typically used for quoting other text.
  108. This is another one.</pre>
  109. <p>Results in:</p>
  110. <blockquote>
  111. <p>This is a paragraph. It's quite
  112. short.</p>
  113. <blockquote>
  114. <p>This paragraph will result in an indented block of
  115. text, typically used for quoting other text.</p>
  116. </blockquote>
  117. <p>This is another one.</p>
  118. </blockquote>
  119. </section><section id="text-styles"><h2><a class="toc-backref" href="quickstart.html#toc-entry-2" role="doc-backlink">Text styles</a></h2>
  120. <p>(<a class="reference external" href="../quickref/#inline-markup">quickref</a>)</p>
  121. <p>Inside paragraphs and other bodies of text, you may additionally mark
  122. text for <em>italics</em> with "<code class="docutils literal">*italics*</code>" or <strong>bold</strong> with
  123. "<code class="docutils literal">**bold**</code>". This is called "inline markup".</p>
  124. <p>If you want something to appear as a fixed-space literal, use
  125. "<code class="docutils literal">``double <span class="pre">back-quotes``</span></code>". Note that no further fiddling is done
  126. inside the double back-quotes -- so asterisks "<code class="docutils literal">*</code>" etc. are left
  127. alone.</p>
  128. <p>If you find that you want to use one of the "special" characters in
  129. text, it will generally be OK -- reStructuredText is pretty smart.
  130. For example, this lone asterisk * is handled just fine, as is the
  131. asterisk in this equation: 5*6=30. If you actually
  132. want text *surrounded by asterisks* to <strong>not</strong> be italicised, then
  133. you need to indicate that the asterisk is not special. You do this by
  134. placing a backslash just before it, like so "<code class="docutils literal">\*</code>" (<a class="reference external" href="../quickref/#escaping">quickref</a>), or
  135. by enclosing it in double back-quotes (inline literals), like this:</p>
  136. <pre class="literal-block">``*``</pre>
  137. <aside class="admonition tip"><p class="admonition-title">Tip</p>
  138. <p>Think of inline markup as a form of (parentheses) and use it
  139. the same way: immediately before and after the text being marked
  140. up. Inline markup by itself (surrounded by whitespace) or in the
  141. middle of a word won't be recognized. See the <a class="reference external" href="https://docutils.sourceforge.io/docs/ref/rst/restructuredtext.html#inline-markup">markup spec</a> for
  142. full details.</p>
  143. </aside></section><section id="lists"><h2><a class="toc-backref" href="quickstart.html#toc-entry-3" role="doc-backlink">Lists</a></h2>
  144. <p>Lists of items come in three main flavours: <strong>enumerated</strong>,
  145. <strong>bulleted</strong> and <strong>definitions</strong>. In all list cases, you may have as
  146. many paragraphs, sublists, etc. as you want, as long as the left-hand
  147. side of the paragraph or whatever aligns with the first line of text
  148. in the list item.</p>
  149. <p>Lists must always start a new paragraph -- that is, they must appear
  150. after a blank line.</p>
  151. <dl>
  152. <dt>
  153. <strong>enumerated</strong> lists (numbers, letters or roman numerals; <a class="reference external" href="../quickref/#enumerated-lists">quickref</a>)</dt>
  154. <dd>
  155. <p>Start a line off with a number or letter followed by a period ".",
  156. right bracket ")" or surrounded by brackets "( )" -- whatever you're
  157. comfortable with. All of the following forms are recognised:</p>
  158. <pre class="literal-block">1. numbers
  159. A. upper-case letters
  160. and it goes over many lines
  161. with two paragraphs and all!
  162. a. lower-case letters
  163. 3. with a sub-list starting at a different number
  164. 4. make sure the numbers are in the correct sequence though!
  165. I. upper-case roman numerals
  166. i. lower-case roman numerals
  167. (1) numbers again
  168. 1) and again</pre>
  169. <p>Results in (note: the different enumerated list styles are not
  170. always supported by every web browser, so you may not get the full
  171. effect here):</p>
  172. <ol class="arabic simple">
  173. <li><p>numbers</p></li>
  174. </ol>
  175. <ol class="upperalpha">
  176. <li>
  177. <p>upper-case letters
  178. and it goes over many lines</p>
  179. <p>with two paragraphs and all!</p>
  180. </li>
  181. </ol>
  182. <ol class="loweralpha simple">
  183. <li>
  184. <p>lower-case letters</p>
  185. <ol class="arabic simple" start="3">
  186. <li><p>with a sub-list starting at a different number</p></li>
  187. <li><p>make sure the numbers are in the correct sequence though!</p></li>
  188. </ol>
  189. </li>
  190. </ol>
  191. <ol class="upperroman simple">
  192. <li><p>upper-case roman numerals</p></li>
  193. </ol>
  194. <ol class="lowerroman simple">
  195. <li><p>lower-case roman numerals</p></li>
  196. </ol>
  197. <ol class="arabic simple">
  198. <li><p>numbers again</p></li>
  199. </ol>
  200. <ol class="arabic simple">
  201. <li><p>and again</p></li>
  202. </ol>
  203. </dd>
  204. <dt>
  205. <strong>bulleted</strong> lists (<a class="reference external" href="../quickref/#bullet-lists">quickref</a>)</dt>
  206. <dd>
  207. <p>Just like enumerated lists, start the line off with a bullet point
  208. character - either "-", "+" or "*":</p>
  209. <pre class="literal-block">* a bullet point using "*"
  210. - a sub-list using "-"
  211. + yet another sub-list
  212. - another item</pre>
  213. <p>Results in:</p>
  214. <ul class="simple">
  215. <li>
  216. <p>a bullet point using "*"</p>
  217. <ul>
  218. <li>
  219. <p>a sub-list using "-"</p>
  220. <ul>
  221. <li><p>yet another sub-list</p></li>
  222. </ul>
  223. </li>
  224. <li><p>another item</p></li>
  225. </ul>
  226. </li>
  227. </ul>
  228. </dd>
  229. <dt>
  230. <strong>definition</strong> lists (<a class="reference external" href="../quickref/#definition-lists">quickref</a>)</dt>
  231. <dd>
  232. <p>Unlike the other two, the definition lists consist of a term, and
  233. the definition of that term. The format of a definition list is:</p>
  234. <pre class="literal-block">what
  235. Definition lists associate a term with a definition.
  236. *how*
  237. The term is a one-line phrase, and the definition is one or more
  238. paragraphs or body elements, indented relative to the term.
  239. Blank lines are not allowed between term and definition.</pre>
  240. <p>Results in:</p>
  241. <dl class="simple">
  242. <dt>what</dt>
  243. <dd>
  244. <p>Definition lists associate a term with a definition.</p>
  245. </dd>
  246. <dt><em>how</em></dt>
  247. <dd>
  248. <p>The term is a one-line phrase, and the definition is one or more
  249. paragraphs or body elements, indented relative to the term.
  250. Blank lines are not allowed between term and definition.</p>
  251. </dd>
  252. </dl>
  253. </dd>
  254. </dl></section><section id="preformatting-code-samples"><h2><a class="toc-backref" href="quickstart.html#toc-entry-4" role="doc-backlink">Preformatting (code samples)</a></h2>
  255. <p>(<a class="reference external" href="../quickref/#literal-blocks">quickref</a>)</p>
  256. <p>To just include a chunk of preformatted, never-to-be-fiddled-with
  257. text, finish the prior paragraph with "<code class="docutils literal">::</code>". The preformatted
  258. block is finished when the text falls back to the same indentation
  259. level as a paragraph prior to the preformatted block. For example:</p>
  260. <pre class="literal-block">An example::
  261. Whitespace, newlines, blank lines, and all kinds of markup
  262. (like *this* or \this) is preserved by literal blocks.
  263. Lookie here, I've dropped an indentation level
  264. (but not far enough)
  265. no more example</pre>
  266. <p>Results in:</p>
  267. <blockquote>
  268. <p>An example:</p>
  269. <pre class="literal-block"> Whitespace, newlines, blank lines, and all kinds of markup
  270. (like *this* or \this) is preserved by literal blocks.
  271. Lookie here, I've dropped an indentation level
  272. (but not far enough)</pre>
  273. <p>no more example</p>
  274. </blockquote>
  275. <p>Note that if a paragraph consists only of "<code class="docutils literal">::</code>", then it's removed
  276. from the output:</p>
  277. <pre class="literal-block">::
  278. This is preformatted text, and the
  279. last "::" paragraph is removed</pre>
  280. <p>Results in:</p>
  281. <pre class="literal-block">This is preformatted text, and the
  282. last "::" paragraph is removed</pre>
  283. </section><section id="sections"><h2><a class="toc-backref" href="quickstart.html#toc-entry-5" role="doc-backlink">Sections</a></h2>
  284. <p>(<a class="reference external" href="../quickref/#section-structure">quickref</a>)</p>
  285. <p>To break longer text up into sections, you use <strong>section headers</strong>.
  286. These are a single line of text (one or more words) with adornment: an
  287. underline alone, or an underline and an overline together, in dashes
  288. "<code class="docutils literal"><span class="pre">-----</span></code>", equals "<code class="docutils literal"><span class="pre">======</span></code>", tildes "<code class="docutils literal"><span class="pre">~~~~~~</span></code>" or any of the
  289. non-alphanumeric characters <code class="docutils literal">= - ` : ' " ~ ^ _ * + # &lt; &gt;</code> that you
  290. feel comfortable with. An underline-only adornment is distinct from
  291. an overline-and-underline adornment using the same character. The
  292. underline/overline must be at least as long as the title text. Be
  293. consistent, since all sections marked with the same adornment style
  294. are deemed to be at the same level:</p>
  295. <pre class="literal-block">Chapter 1 Title
  296. ===============
  297. Section 1.1 Title
  298. -----------------
  299. Subsection 1.1.1 Title
  300. ~~~~~~~~~~~~~~~~~~~~~~
  301. Section 1.2 Title
  302. -----------------
  303. Chapter 2 Title
  304. ===============</pre>
  305. <p>This results in the following structure, illustrated by simplified
  306. pseudo-XML:</p>
  307. <pre class="literal-block">&lt;section&gt;
  308. &lt;title&gt;
  309. Chapter 1 Title
  310. &lt;section&gt;
  311. &lt;title&gt;
  312. Section 1.1 Title
  313. &lt;section&gt;
  314. &lt;title&gt;
  315. Subsection 1.1.1 Title
  316. &lt;section&gt;
  317. &lt;title&gt;
  318. Section 1.2 Title
  319. &lt;section&gt;
  320. &lt;title&gt;
  321. Chapter 2 Title</pre>
  322. <p>(Pseudo-XML uses indentation for nesting and has no end-tags. It's
  323. not possible to show actual processed output, as in the other
  324. examples, because sections cannot exist inside block quotes. For a
  325. concrete example, compare the section structure of this document's
  326. source text and processed output.)</p>
  327. <p>Note that section headers are available as link targets, just using
  328. their name. To link to the <a class="reference internal" href="quickstart.html#lists">Lists</a> heading, I write "<code class="docutils literal">Lists_</code>". If
  329. the heading has a space in it like <a class="reference internal" href="quickstart.html#text-styles">text styles</a>, we need to quote
  330. the heading "<code class="docutils literal">`text styles`_</code>".</p>
  331. <section id="document-title-subtitle"><h3><a class="toc-backref" href="quickstart.html#toc-entry-6" role="doc-backlink">Document Title / Subtitle</a></h3>
  332. <p>The title of the whole document is distinct from section titles and
  333. may be formatted somewhat differently (e.g. the HTML writer by default
  334. shows it as a centered heading).</p>
  335. <p>To indicate the document title in reStructuredText, use a unique adornment
  336. style at the beginning of the document. To indicate the document subtitle,
  337. use another unique adornment style immediately after the document title. For
  338. example:</p>
  339. <pre class="literal-block">================
  340. Document Title
  341. ================
  342. ----------
  343. Subtitle
  344. ----------
  345. Section Title
  346. =============
  347. ...</pre>
  348. <p>Note that "Document Title" and "Section Title" above both use equals
  349. signs, but are distinct and unrelated styles. The text of
  350. overline-and-underlined titles (but not underlined-only) may be inset
  351. for aesthetics.</p>
  352. </section></section><section id="images"><h2><a class="toc-backref" href="quickstart.html#toc-entry-7" role="doc-backlink">Images</a></h2>
  353. <p>(<a class="reference external" href="../quickref/#directives">quickref</a>)</p>
  354. <p>To include an image in your document, you use the <code class="docutils literal">image</code> <a class="reference external" href="https://docutils.sourceforge.io/docs/ref/rst/directives.html">directive</a>.
  355. For example:</p>
  356. <pre class="literal-block">.. image:: /images/nikola.png</pre>
  357. <p>results in:</p>
  358. <img alt="/images/nikola.png" src="../images/nikola.png"><p>The <code class="docutils literal">/images/nikola.png</code> part indicates the filename of the image
  359. you wish to appear in the document. There's no restriction placed on
  360. the image (format, size etc). If the image is to appear in HTML and
  361. you wish to supply additional information, you may:</p>
  362. <pre class="literal-block">.. image:: /images/nikola.png
  363. :height: 100
  364. :width: 200
  365. :scale: 50
  366. :alt: alternate text</pre>
  367. <p>See the full <a class="reference external" href="https://docutils.sourceforge.io/docs/ref/rst/directives.html#images">image directive documentation</a> for more info.</p>
  368. </section><section id="what-next"><h2><a class="toc-backref" href="quickstart.html#toc-entry-8" role="doc-backlink">What Next?</a></h2>
  369. <p>This primer introduces the most common features of reStructuredText,
  370. but there are a lot more to explore. The <a class="reference external" href="../quickref/">Quick reStructuredText</a>
  371. user reference is a good place to go next. For complete details, the
  372. <a class="reference external" href="https://docutils.sourceforge.io/docs/ref/rst/restructuredtext.html">reStructuredText Markup Specification</a> is the place to go <a class="footnote-reference brackets" href="quickstart.html#footnote-1" id="footnote-reference-1" role="doc-noteref"><span class="fn-bracket">[</span>1<span class="fn-bracket">]</span></a>.</p>
  373. <p>Users who have questions or need assistance with Docutils or
  374. reStructuredText should post a message to the <a class="reference external" href="https://docutils.sourceforge.io/docs/user/mailing-lists.html#docutils-users">Docutils-users</a> mailing
  375. list.</p>
  376. <aside class="footnote-list brackets"><aside class="footnote brackets" id="footnote-1" role="note"><span class="label"><span class="fn-bracket">[</span><a role="doc-backlink" href="quickstart.html#footnote-reference-1">1</a><span class="fn-bracket">]</span></span>
  377. <p>If that relative link doesn't work, try the master document:
  378. <a class="reference external" href="https://docutils.sourceforge.io/docs/ref/rst/restructuredtext.html">https://docutils.sourceforge.io/docs/ref/rst/restructuredtext.html</a>.</p>
  379. </aside></aside></section>
  380. </div>
  381. </article>
  382. </div>
  383. <div class="col-sm-3 col-sm-offset-1 blog-sidebar">
  384. <div class="sidebar-module sidebar-module-inset">
  385. <h4>About</h4>
  386. <div id="shoutcastdiv">
  387. <script type="text/javascript">
  388. refreshdiv();
  389. </script>
  390. </div>
  391. </div>
  392. <div class="sidebar-module">
  393. <h4>Links</h4>
  394. <ol class="list-unstyled">
  395. <li><a href="http://getbootstrap.com/examples/blog/">Bootstrap Blog Theme</a></li>
  396. <li><a href="https://getnikola.com/">Nikola</a></li>
  397. <li><a href="https://twitter.com/mdo">@mdo</a></li>
  398. <li><a href="https://twitter.com/Kwpolska">@Kwpolska</a></li>
  399. <li><a href="https://twitter.com/GetNikola">@GetNikola</a></li>
  400. </ol>
  401. </div>
  402. </div>
  403. <!--End of body content-->
  404. </div>
  405. </div>
  406. </div>
  407. <footer class="blog-footer" id="footer">
  408. Contents © 2023 <a href="mailto:contact@riff-radio.org">Riff</a> - Powered by <a href="https://getnikola.com" rel="nofollow">Nikola</a>
  409. </footer><script src="../assets/js/all-nocdn.js"></script><!-- fancy dates --><script>
  410. moment.locale("en");
  411. fancydates(0, "YYYY-MM-DD HH:mm");
  412. </script><!-- end fancy dates --><script>
  413. baguetteBox.run('div#content', {
  414. ignoreClass: 'islink',
  415. captions: function(element) {
  416. return element.getElementsByTagName('img')[0].alt;
  417. }});
  418. </script><script type="text/javascript" src="../refresh.js"></script>
  419. </body>
  420. </html>