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