rest-devsite-examples.html 7.7 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190
  1. {{+bindTo:partials.standard_nacl_article}}
  2. <section id="examples-of-rest-markup-for-chromesite-document-title">
  3. <h1 id="examples-of-rest-markup-for-chromesite-document-title">Examples of ReST markup for chromesite (Document title)</h1>
  4. <h2 id="document-structure">Document structure</h2>
  5. <p>A document starts with a Sphinx target which serves as the document name
  6. throughout the tree. It can serve as a link target in other documents that want
  7. to link to this one (see the Links section below).</p>
  8. <h2 id="basic-markup">Basic markup</h2>
  9. <p>In general, follow the rules from <a class="reference external" href="http://sphinx-doc.org/rest.html">http://sphinx-doc.org/rest.html</a></p>
  10. <p>Some <strong>bold text</strong> and <em>italic text</em> and <code>fixed-font text</code>. Non marked-up text
  11. can follow these immediately by using a backslash: <strong>pexe</strong>s.</p>
  12. <p>For pleasant collaborative editing, please use the accepted coding guidelines:
  13. wrap at 80 columns, no tabs, etc.</p>
  14. <p>Quotes (<code>&lt;blockquote&gt;</code>) are created by indenting the paragraph:</p>
  15. <blockquote>
  16. <div>Most good programmers do programming not because they expect to get paid or
  17. get adulation by the public, but because it is fun to program.
  18. &#8211; Linus Torvalds</div></blockquote>
  19. <p>Here&#8217;s an en-dash &#8211; and an m-dash &#8212; too.</p>
  20. <h3 id="unicode-samples">Unicode samples</h3>
  21. <p>Copyright sign ©, and uacute Ú.</p>
  22. <h2 id="images">Images</h2>
  23. <p>Please use absolute paths (starting with <code>/</code>) for images:</p>
  24. <img alt="/native-client/images/NaclBlock.png" src="/native-client/images/NaclBlock.png" />
  25. <h2 id="links">Links</h2>
  26. <h3 id="to-other-documents-within-the-tree">To other documents within the tree</h3>
  27. <p>Internal links to other documents are created <a class="reference internal" href="/native-client/overview.html"><em>like this</em></a>. The
  28. document name within the angle brackets is relative to the root dir of the doc
  29. tree and does not have an extension.</p>
  30. <p>Here&#8217;s a link to a document in a subdirectory: <a class="reference internal" href="/native-client/devguide/tutorial/tutorial-part1.html"><em>the tutorial</em></a>. And a link to a subdirectory index page
  31. <a class="reference internal" href="/native-client/devguide/index.html"><em>devguide index</em></a>.</p>
  32. <h3 id="to-sections-inside-documents">To sections inside documents</h3>
  33. <p>To internal locations within documents, labels are used. For example, this link
  34. goes to the label explicitly placed in this document -
  35. <a class="reference internal" href="#link-for-section-heading"><em>Section heading</em></a>. This works across documents as well. Label
  36. names must be unique in the tree, and can refer to anything (like images).</p>
  37. <p>It&#8217;s also possible to give such cross-references custom names: <a class="reference internal" href="#link-for-section-heading"><em>Same
  38. Section Heading</em></a>.</p>
  39. <h3 id="to-external-locations">To external locations</h3>
  40. <p>Plain links can be placed like this: <a class="reference external" href="http://google.com">http://google.com</a> and also <a class="reference external" href="http://google.com">like this</a>.</p>
  41. <h2 id="definition-lists">Definition lists</h2>
  42. <p>Can be used to define a group of related terms. Internal formatting is supported
  43. within the definition. No special formatting needs to be done for the definition
  44. name/title - it&#8217;s handled by the chromesite documentation server.</p>
  45. <dl class="docutils">
  46. <dt>Apple</dt>
  47. <dd>The apple is the pomaceous fruit of the apple tree, species Malus domestica in
  48. the rose family (<strong>Rosaceae</strong>).</dd>
  49. <dt>Fig</dt>
  50. <dd>The common fig (<strong>Ficus carica</strong>) is a species of flowering plant in the genus
  51. Ficus, from the family Moraceae, known as the common fig (or just the fig),
  52. anjeer (Iran, Pakistan), and dumur (Bengali).</dd>
  53. <dt>Pear</dt>
  54. <dd>The pear is any of several tree and shrub species of genus Pyrus, in the
  55. family Rosaceae.</dd>
  56. </dl>
  57. <h2 id="notes-and-admonitions">Notes and Admonitions</h2>
  58. <p>The documentation server supports special &#8220;notes&#8221; that are indented and have a
  59. background color. We&#8217;ll generate them with the <code>Note</code> directive, providing
  60. the class explicitly. The class is one of <code>note</code>, <code>caution</code>, <code>warning</code>,
  61. <code>special</code>.</p>
  62. <aside class="note">
  63. <p>This is a note.</p>
  64. <p>Foo bar.</p>
  65. </aside>
  66. <p>Also:</p>
  67. <aside class="caution">
  68. Caution &#8211; you have been warned.
  69. </aside>
  70. <h2 id="source-code">Source code</h2>
  71. <p>Here&#8217;s source code that will be pretty-printed. It&#8217;s just a plain <code>&lt;pre&gt;</code>
  72. that presents pre-formatted code with coloring:</p>
  73. <pre class="prettyprint">
  74. #include &lt;iostream&gt;
  75. int main() {
  76. char c = 'x';
  77. std::cout &lt;&lt; &quot;Hello world\n&quot;;
  78. return 0;
  79. }
  80. </pre>
  81. <p>For some code (like shell samples), we want to disable pretty-printing:</p>
  82. <pre>
  83. $ ls | wc
  84. $ echo &quot;hello world&quot;
  85. </pre>
  86. <p>By default <code>:prettyprint:</code> is <code>1</code>.</p>
  87. <p>For short inline code, use fixed-formatting like <code>int x = 2;</code>. Note that this
  88. won&#8217;t get syntax-highlighted and may be line-wrapped, so keep it very short.</p>
  89. <h2 id="section-heading"><span id="link-for-section-heading"></span>Section heading</h2>
  90. <p>Here&#8217;s a demonstration of heading nesting levels. This is a top-level section in
  91. the document. The document title is the first header and it&#8217;s delimited by hash
  92. signes (<code>#</code>) from above and below.</p>
  93. <h3 id="subsection-heading">Subsection heading</h3>
  94. <p>Subsection.</p>
  95. <h4 id="sub-subsection-heading">Sub-subsection heading</h4>
  96. <p>That&#8217;s pretty deep...</p>
  97. <h5 id="sub-sub-subsection-heading">Sub-sub-subsection heading</h5>
  98. <p>It&#8217;s probably not the best idea to go this far (renders to <code>&lt;h5&gt;</code>).</p>
  99. <h2 id="lists">Lists</h2>
  100. <p>Auto-numbered ordered lists:</p>
  101. <ol class="arabic simple">
  102. <li>One</li>
  103. <li>Two</li>
  104. <li>Three</li>
  105. </ol>
  106. <p>Manually numbered ordered lists:</p>
  107. <ol class="arabic simple">
  108. <li>One</li>
  109. <li>Two</li>
  110. <li>Three</li>
  111. </ol>
  112. <p>Unordered (bullet) lists:</p>
  113. <ul class="small-gap">
  114. <li>One</li>
  115. <li>Two</li>
  116. <li>Three</li>
  117. </ul>
  118. <p>Lists can be nested and mixed too:</p>
  119. <ul class="small-gap">
  120. <li><p class="first">Toplevel</p>
  121. <ol class="arabic simple">
  122. <li>One</li>
  123. <li>Two</li>
  124. </ol>
  125. </li>
  126. <li>Back to top level</li>
  127. </ul>
  128. <h2 id="tables">Tables</h2>
  129. <p>The full scoop on tables is <a class="reference external" href="http://sphinx-doc.org/rest.html#tables">http://sphinx-doc.org/rest.html#tables</a> and the
  130. Docutils pages linked from it.</p>
  131. <p>&#8220;Simple tables&#8221; require less markup but are limited:</p>
  132. <table border="1" class="docutils">
  133. <colgroup>
  134. </colgroup>
  135. <thead valign="bottom">
  136. <tr class="row-odd"><th class="head">A</th>
  137. <th class="head">B</th>
  138. <th class="head">A and B</th>
  139. </tr>
  140. </thead>
  141. <tbody valign="top">
  142. <tr class="row-even"><td>False</td>
  143. <td>False</td>
  144. <td>False</td>
  145. </tr>
  146. <tr class="row-odd"><td>True</td>
  147. <td>False</td>
  148. <td>False</td>
  149. </tr>
  150. <tr class="row-even"><td>False</td>
  151. <td>True</td>
  152. <td>False</td>
  153. </tr>
  154. <tr class="row-odd"><td>True</td>
  155. <td>True</td>
  156. <td>True</td>
  157. </tr>
  158. </tbody>
  159. </table>
  160. <p>&#8220;Grid tables&#8221; are versatile but require more markup:</p>
  161. <table border="1" class="docutils">
  162. <colgroup>
  163. </colgroup>
  164. <thead valign="bottom">
  165. <tr class="row-odd"><th class="head">Header row, column 1
  166. (header rows optional)</th>
  167. <th class="head">Header 2</th>
  168. <th class="head">Header 3</th>
  169. <th class="head">Header 4</th>
  170. </tr>
  171. </thead>
  172. <tbody valign="top">
  173. <tr class="row-even"><td>body row 1, column 1</td>
  174. <td>column 2</td>
  175. <td>column 3</td>
  176. <td>column 4</td>
  177. </tr>
  178. <tr class="row-odd"><td>body row 2</td>
  179. <td>...</td>
  180. <td>...</td>
  181. <td>&nbsp;</td>
  182. </tr>
  183. </tbody>
  184. </table>
  185. </section>
  186. {{/partials.standard_nacl_article}}