OLD | NEW |
(Empty) | |
| 1 .. _getting_started: |
| 2 |
| 3 #################################################### |
| 4 Examples of ReST markup for devsite (Document title) |
| 5 #################################################### |
| 6 |
| 7 This is an auto-generated table of contents for this document. ``:local:`` and |
| 8 ``:backlinks: none`` are required to make the devsite look consistent; |
| 9 ``:depth:`` level can be controlled. |
| 10 |
| 11 .. contents:: |
| 12 :local: |
| 13 :backlinks: none |
| 14 :depth: 2 |
| 15 |
| 16 Document structure |
| 17 ================== |
| 18 |
| 19 A document starts with a Sphinx target which serves as the document name |
| 20 throughout the tree. It can serve as a link target in other documents that want |
| 21 to link to this one (see the Links section below). |
| 22 |
| 23 It follows with the document title (which doesn't get generated to the HTML body |
| 24 in production mode, but is picked up by the devsite from ``<head><title>``. |
| 25 |
| 26 Basic markup |
| 27 ============ |
| 28 |
| 29 In general, follow the rules from http://sphinx-doc.org/rest.html |
| 30 |
| 31 Some **bold text** and *italic text* and ``fixed-font text``. |
| 32 |
| 33 For pleasant collaborative editing, please use the accepted coding guidelines: |
| 34 wrap at 80 columns, no tabs, etc. |
| 35 |
| 36 Quotes (``<blockquote>``) are created by indenting the paragraph: |
| 37 |
| 38 Most good programmers do programming not because they expect to get paid or |
| 39 get adulation by the public, but because it is fun to program. |
| 40 -- Linus Torvalds |
| 41 |
| 42 Images |
| 43 ====== |
| 44 |
| 45 Please use absolute paths (starting with ``/``) for images: |
| 46 |
| 47 .. image:: /images/NaclBlock.png |
| 48 |
| 49 Links |
| 50 ===== |
| 51 |
| 52 To other documents within the tree |
| 53 ---------------------------------- |
| 54 |
| 55 Internal links to other documents are created :doc:`like this <overview>`. The |
| 56 document name within the angle brackets is relative to the root dir of the |
| 57 devsite doc tree and does not have an extension. |
| 58 |
| 59 Here's a link to a document in a subdirectory: :doc:`the tutorial |
| 60 <devguide/tutorial>`. And a link to a subdirectory index page :doc:`devguide ind
ex <devguide/index>`. |
| 61 |
| 62 To sections inside documents |
| 63 ---------------------------- |
| 64 |
| 65 To internal locations within documents, labels are used. For example, this link |
| 66 goes to the label explicitly placed in this document - |
| 67 :ref:`link_for_section_heading`. This works across documents as well. Label |
| 68 names must be unique in the tree, and can refer to anything (like images). |
| 69 |
| 70 It's also possible to give such cross-references custom names: :ref:`Same |
| 71 Section Heading<link_for_section_heading>`. |
| 72 |
| 73 To external locations |
| 74 --------------------- |
| 75 |
| 76 Plain links can be placed like this: http://google.com and also `like this |
| 77 <http://google.com>`_. |
| 78 |
| 79 Notes and Admonitions |
| 80 ===================== |
| 81 |
| 82 The devsite supports special "notes" that are indented and have a background |
| 83 color. We'll generate them with the ``Note`` directive, providing the class |
| 84 explicitly. The class is one of ``note``, ``caution``, ``warning``, |
| 85 ``special``. |
| 86 |
| 87 .. Note:: |
| 88 :class: note |
| 89 |
| 90 This is a note. |
| 91 |
| 92 Foo bar. |
| 93 |
| 94 Also: |
| 95 |
| 96 .. Note:: |
| 97 :class: caution |
| 98 |
| 99 Caution -- you have been warned. |
| 100 |
| 101 Source code |
| 102 =========== |
| 103 |
| 104 Here's source code that will be pretty-printed on the devsite. Outside |
| 105 production mode, it's just a plain ``<pre>`` that presents pre-formatted code |
| 106 without coloring: |
| 107 |
| 108 .. naclcode:: |
| 109 |
| 110 #include <iostream> |
| 111 |
| 112 int main() { |
| 113 std::cout << "Hello world\n"; |
| 114 return 0; |
| 115 } |
| 116 |
| 117 For some code (like shell samples), we want to disable pretty-printing: |
| 118 |
| 119 .. naclcode:: |
| 120 :prettyprint: 0 |
| 121 |
| 122 $ ls | wc |
| 123 $ echo "hello world" |
| 124 |
| 125 By default ``:prettyprint:`` is ``1``. |
| 126 |
| 127 .. _link_for_section_heading: |
| 128 |
| 129 Section heading |
| 130 =============== |
| 131 |
| 132 Here's a demonstration of heading nesting levels. This is a top-level section in |
| 133 the document. The document title is the first header and it's delimited by hash |
| 134 signes (``#``) from above and below. |
| 135 |
| 136 Subsection heading |
| 137 ------------------ |
| 138 |
| 139 Subsection. |
| 140 |
| 141 Sub-subsection heading |
| 142 ^^^^^^^^^^^^^^^^^^^^^^ |
| 143 |
| 144 That's pretty deep... |
| 145 |
| 146 Sub-sub-subsection heading |
| 147 """""""""""""""""""""""""" |
| 148 |
| 149 It's probably not the best idea to go this far (renders to ``<h5>``). |
| 150 |
| 151 Lists |
| 152 ===== |
| 153 |
| 154 Auto-numbered ordered lists: |
| 155 |
| 156 #. One |
| 157 #. Two |
| 158 #. Three |
| 159 |
| 160 Manually numbered ordered lists: |
| 161 |
| 162 1. One |
| 163 2. Two |
| 164 3. Three |
| 165 |
| 166 Unordered (bullet) lists: |
| 167 |
| 168 * One |
| 169 * Two |
| 170 * Three |
| 171 |
| 172 Lists can be nested and mixed too: |
| 173 |
| 174 * Toplevel |
| 175 |
| 176 1. One |
| 177 2. Two |
| 178 |
| 179 * Back to top level |
| 180 |
| 181 Tables |
| 182 ====== |
| 183 |
| 184 The full scoop on tables is http://sphinx-doc.org/rest.html#tables and the |
| 185 Docutils pages linked from it. |
| 186 |
| 187 "Simple tables" require less markup but are limited: |
| 188 |
| 189 ===== ===== ======= |
| 190 A B A and B |
| 191 ===== ===== ======= |
| 192 False False False |
| 193 True False False |
| 194 False True False |
| 195 True True True |
| 196 ===== ===== ======= |
| 197 |
| 198 "Grid tables" are versatile but require more markup: |
| 199 |
| 200 +------------------------+------------+----------+----------+ |
| 201 | Header row, column 1 | Header 2 | Header 3 | Header 4 | |
| 202 | (header rows optional) | | | | |
| 203 +========================+============+==========+==========+ |
| 204 | body row 1, column 1 | column 2 | column 3 | column 4 | |
| 205 +------------------------+------------+----------+----------+ |
| 206 | body row 2 | ... | ... | | |
| 207 +------------------------+------------+----------+----------+ |
| 208 |
OLD | NEW |