| 1 |
|
| 2 |
************** |
| 3 |
Lists & Tables |
| 4 |
************** |
| 5 |
|
| 6 |
.. contents:: Table of Contents |
| 7 |
|
| 8 |
Lists |
| 9 |
===== |
| 10 |
|
| 11 |
Enumerated Lists |
| 12 |
---------------- |
| 13 |
|
| 14 |
1. Arabic numerals. |
| 15 |
|
| 16 |
a) lower alpha) |
| 17 |
|
| 18 |
(i) (lower roman) |
| 19 |
|
| 20 |
A. upper alpha. |
| 21 |
|
| 22 |
I) upper roman) |
| 23 |
|
| 24 |
2. Lists that don't start at 1: |
| 25 |
|
| 26 |
3. Three |
| 27 |
|
| 28 |
4. Four |
| 29 |
|
| 30 |
C. C |
| 31 |
|
| 32 |
D. D |
| 33 |
|
| 34 |
iii. iii |
| 35 |
|
| 36 |
iv. iv |
| 37 |
|
| 38 |
#. List items may also be auto-enumerated. |
| 39 |
|
| 40 |
Definition Lists |
| 41 |
---------------- |
| 42 |
|
| 43 |
Term |
| 44 |
Definition |
| 45 |
Term : classifier |
| 46 |
Definition paragraph 1. |
| 47 |
|
| 48 |
Definition paragraph 2. |
| 49 |
Term |
| 50 |
Definition |
| 51 |
|
| 52 |
I have no clue why the definition list below is classified as a different style |
| 53 |
of definition list than the one above. |
| 54 |
|
| 55 |
Is it the spaces in the term? |
| 56 |
Maybe it was the multiple line paragraph |
| 57 |
in the line below that caused this? |
| 58 |
|
| 59 |
Is it the paragraph above the list maybe? |
| 60 |
I guess a lot of these lists don't have leading paragraphs? |
| 61 |
|
| 62 |
Is it everything all at once? |
| 63 |
Who knows?! |
| 64 |
|
| 65 |
Option Lists |
| 66 |
------------ |
| 67 |
|
| 68 |
For listing command-line options: |
| 69 |
|
| 70 |
-a command-line option "a" |
| 71 |
-b file options can have arguments |
| 72 |
and long descriptions |
| 73 |
--long options can be long also |
| 74 |
--input=file long options can also have |
| 75 |
arguments |
| 76 |
|
| 77 |
--very-long-option |
| 78 |
The description can also start on the next line. |
| 79 |
|
| 80 |
The description may contain multiple body elements, |
| 81 |
regardless of where it starts. |
| 82 |
|
| 83 |
-x, -y, -z Multiple options are an "option group". |
| 84 |
-v, --verbose Commonly-seen: short & long options. |
| 85 |
-1 file, --one=file, --two file |
| 86 |
Multiple options with arguments. |
| 87 |
/V DOS/VMS-style options too |
| 88 |
|
| 89 |
There must be at least two spaces between the option and the description. |
| 90 |
|
| 91 |
Field list |
| 92 |
---------- |
| 93 |
|
| 94 |
.. bibliographic fields (which also require a transform): |
| 95 |
|
| 96 |
:Author: David Goodger |
| 97 |
:Address: 123 Example Street |
| 98 |
Example, EX Canada |
| 99 |
A1B 2C3 |
| 100 |
:Contact: [email protected] |
| 101 |
:Authors: Me; Myself; I |
| 102 |
:organization: humankind |
| 103 |
:date: $Date: 2012-01-03 19:23:53 +0000 (Tue, 03 Jan 2012) $ |
| 104 |
:status: This is a "work in progress" |
| 105 |
:revision: $Revision: 7302 $ |
| 106 |
:version: 1 |
| 107 |
:copyright: This document has been placed in the public domain. You |
| 108 |
may do with it as you wish. You may copy, modify, |
| 109 |
redistribute, reattribute, sell, buy, rent, lease, |
| 110 |
destroy, or improve it, quote it at length, excerpt, |
| 111 |
incorporate, collate, fold, staple, or mutilate it, or do |
| 112 |
anything else to it that your or anyone else's heart |
| 113 |
desires. |
| 114 |
:field name: This is a generic bibliographic field. |
| 115 |
:field name 2: |
| 116 |
Generic bibliographic fields may contain multiple body elements. |
| 117 |
|
| 118 |
Like this. |
| 119 |
|
| 120 |
:Dedication: |
| 121 |
|
| 122 |
For Docutils users & co-developers. |
| 123 |
|
| 124 |
:abstract: |
| 125 |
|
| 126 |
This document is a demonstration of the reStructuredText markup |
| 127 |
language, containing examples of all basic reStructuredText |
| 128 |
constructs and many advanced constructs. |
| 129 |
|
| 130 |
Bullet Lists |
| 131 |
------------ |
| 132 |
|
| 133 |
.. |
| 134 |
Docutils supports two types of lists, "simple" and "complex". Complex lists |
| 135 |
have item margins, simple lists do not. |
| 136 |
https://docutils.sourceforge.io/sandbox/html4strict/data/simple-lists.html |
| 137 |
|
| 138 |
Simple |
| 139 |
^^^^^^ |
| 140 |
|
| 141 |
- A simple list. |
| 142 |
- There are no margins between list items. |
| 143 |
- Simple lists do not contain multiple paragraphs. That's a complex list. |
| 144 |
- In the case of a nested list |
| 145 |
|
| 146 |
- There are no margins between elements |
| 147 |
|
| 148 |
- Still no margins |
| 149 |
|
| 150 |
- Still no margins |
| 151 |
|
| 152 |
Complex |
| 153 |
^^^^^^^ |
| 154 |
|
| 155 |
- A bullet list |
| 156 |
|
| 157 |
+ Nested bullet list. |
| 158 |
+ Nested item 2. |
| 159 |
|
| 160 |
- Item 2. |
| 161 |
|
| 162 |
Paragraph 2 of item 2. |
| 163 |
|
| 164 |
* Nested bullet list. |
| 165 |
* Nested item 2. |
| 166 |
|
| 167 |
- Third level. |
| 168 |
- Item 2. |
| 169 |
|
| 170 |
* Nested item 3. |
| 171 |
|
| 172 |
- ``inline literall`` |
| 173 |
- ``inline literall`` |
| 174 |
- ``inline literall`` |
| 175 |
- This item has multiple paragraphs. |
| 176 |
|
| 177 |
This item has multiple paragraphs. |
| 178 |
- This item has multiple paragraphs. |
| 179 |
|
| 180 |
This item has multiple paragraphs. |
| 181 |
|
| 182 |
|
| 183 |
Second list level |
| 184 |
^^^^^^^^^^^^^^^^^ |
| 185 |
|
| 186 |
- here is a list in a second-level section. |
| 187 |
- `yahoo <http://www.yahoo.com>`_ |
| 188 |
- `yahoo <http://www.yahoo.com>`_ |
| 189 |
|
| 190 |
- `yahoo <http://www.yahoo.com>`_ |
| 191 |
- here is an inner bullet ``oh`` |
| 192 |
|
| 193 |
- one more ``with an inline literally``. `yahoo <http://www.yahoo.com>`_ |
| 194 |
|
| 195 |
heh heh. child. try to beat this embed: |
| 196 |
|
| 197 |
.. literalinclude:: test_py_module/test.py |
| 198 |
:language: python |
| 199 |
:linenos: |
| 200 |
:lines: 1-10 |
| 201 |
- and another. `yahoo <http://www.yahoo.com>`_ |
| 202 |
- `yahoo <http://www.yahoo.com>`_ |
| 203 |
- ``hi`` |
| 204 |
- how about an admonition? |
| 205 |
|
| 206 |
.. note:: |
| 207 |
This is a note nested in a list. |
| 208 |
|
| 209 |
- and hehe |
| 210 |
|
| 211 |
But deeper down the rabbit hole |
| 212 |
""""""""""""""""""""""""""""""" |
| 213 |
|
| 214 |
- I kept saying that, "deeper down the rabbit hole". `yahoo <http://www.yahoo.com>`_ |
| 215 |
|
| 216 |
- I cackle at night `yahoo <http://www.yahoo.com>`_. |
| 217 |
- I'm so lonely here in GZ ``guangzhou`` |
| 218 |
- A man of python destiny, hopes and dreams. `yahoo <http://www.yahoo.com>`_ |
| 219 |
|
| 220 |
- `yahoo <http://www.yahoo.com>`_ |
| 221 |
|
| 222 |
- `yahoo <http://www.yahoo.com>`_ ``hi`` |
| 223 |
- ``destiny`` |
| 224 |
|
| 225 |
Hlists |
| 226 |
------ |
| 227 |
|
| 228 |
.. hlist:: |
| 229 |
:columns: 2 |
| 230 |
|
| 231 |
- First item |
| 232 |
- Second item |
| 233 |
- Third item |
| 234 |
- Forth item |
| 235 |
- Fifth item |
| 236 |
- Sixths item |
| 237 |
|
| 238 |
.. rubric:: Hlist with images |
| 239 |
|
| 240 |
.. hlist:: |
| 241 |
:columns: 2 |
| 242 |
|
| 243 |
- .. figure:: static/yi_jing_01_chien.jpg |
| 244 |
|
| 245 |
This is a short caption for a figure. |
| 246 |
|
| 247 |
- .. figure:: static/yi_jing_01_chien.jpg |
| 248 |
|
| 249 |
This is a long caption for a figure. Lorem ipsum dolor sit amet, consectetur adipiscing elit. |
| 250 |
Donec porttitor dolor in odio posuere, vitae ornare libero mattis. In lobortis justo vestibulum nibh aliquet, non. |
| 251 |
|
| 252 |
Numbered List |
| 253 |
------------- |
| 254 |
|
| 255 |
#. One, |
| 256 |
#. Two. |
| 257 |
#. Three with long text. Lorem ipsum dolor sit amet, consectetur adipiscing elit. |
| 258 |
Sed feugiat sagittis neque quis eleifend. Duis rutrum lectus sit amet mattis suscipit. |
| 259 |
|
| 260 |
- A) Using bullets and letters. (A) |
| 261 |
- B) Using bullets and letters. (B) |
| 262 |
- C) Using bullets and letters. (C) |
| 263 |
|
| 264 |
Tables |
| 265 |
====== |
| 266 |
|
| 267 |
Grid Tables |
| 268 |
----------- |
| 269 |
|
| 270 |
Here's a grid table followed by a simple table: |
| 271 |
|
| 272 |
+------------------------+------------+----------+----------+ |
| 273 |
| Header row, column 1 | Header 2 | Header 3 | Header 4 | |
| 274 |
| (header rows optional) | | | | |
| 275 |
+========================+============+==========+==========+ |
| 276 |
| body row 1, column 1 | column 2 | column 3 | column 4 | |
| 277 |
+------------------------+------------+----------+----------+ |
| 278 |
| body row 2 | Cells may span columns. | |
| 279 |
+------------------------+------------+---------------------+ |
| 280 |
| body row 3 | Cells may | - Table cells | |
| 281 |
+------------------------+ span rows. | - contain | |
| 282 |
| body row 4 | | - body elements. | |
| 283 |
+------------------------+------------+----------+----------+ |
| 284 |
| body row 5 | Cells may also be | | |
| 285 |
| | empty: ``-->`` | | |
| 286 |
+------------------------+-----------------------+----------+ |
| 287 |
|
| 288 |
===== ===== ====== |
| 289 |
Inputs Output |
| 290 |
------------ ------ |
| 291 |
A B A or B |
| 292 |
===== ===== ====== |
| 293 |
False False False |
| 294 |
True False True |
| 295 |
False True True |
| 296 |
True True True |
| 297 |
===== ===== ====== |
| 298 |
|
| 299 |
Giant Tables |
| 300 |
^^^^^^^^^^^^ |
| 301 |
|
| 302 |
+------------+------------+-----------+------------+------------+-----------+------------+------------+-----------+------------+------------+-----------+ |
| 303 |
| Header 1 | Header 2 | Header 3 | Header 1 | Header 2 | Header 3 | Header 1 | Header 2 | Header 3 | Header 1 | Header 2 | Header 3 | |
| 304 |
+============+============+===========+============+============+===========+============+============+===========+============+============+===========+ |
| 305 |
| body row 1 | column 2 | column 3 | body row 1 | column 2 | column 3 | body row 1 | column 2 | column 3 | body row 1 | column 2 | column 3 | |
| 306 |
+------------+------------+-----------+------------+------------+-----------+------------+------------+-----------+------------+------------+-----------+ |
| 307 |
| body row 1 | column 2 | column 3 | body row 1 | column 2 | column 3 | body row 1 | column 2 | column 3 | body row 1 | column 2 | column 3 | |
| 308 |
+------------+------------+-----------+------------+------------+-----------+------------+------------+-----------+------------+------------+-----------+ |
| 309 |
| body row 1 | column 2 | column 3 | body row 1 | column 2 | column 3 | body row 1 | column 2 | column 3 | body row 1 | column 2 | column 3 | |
| 310 |
+------------+------------+-----------+------------+------------+-----------+------------+------------+-----------+------------+------------+-----------+ |
| 311 |
| body row 1 | column 2 | column 3 | body row 1 | column 2 | column 3 | body row 1 | column 2 | column 3 | body row 1 | column 2 | column 3 | |
| 312 |
+------------+------------+-----------+------------+------------+-----------+------------+------------+-----------+------------+------------+-----------+ |
| 313 |
|
| 314 |
List Tables |
| 315 |
----------- |
| 316 |
|
| 317 |
.. list-table:: List tables can have captions like this one. |
| 318 |
:widths: 10 5 10 50 |
| 319 |
:header-rows: 1 |
| 320 |
:stub-columns: 1 |
| 321 |
|
| 322 |
* - List table |
| 323 |
- Header 1 |
| 324 |
- Header 2 |
| 325 |
- Header 3 long. Lorem ipsum dolor sit amet, consectetur adipiscing elit. Nam sit amet mauris arcu. |
| 326 |
* - Stub Row 1 |
| 327 |
- Row 1 |
| 328 |
- Column 2 |
| 329 |
- Column 3 long. Lorem ipsum dolor sit amet, consectetur adipiscing elit. Nam sit amet mauris arcu. |
| 330 |
* - Stub Row 2 |
| 331 |
- Row 2 |
| 332 |
- Column 2 |
| 333 |
- Column 3 long. Lorem ipsum dolor sit amet, consectetur adipiscing elit. Nam sit amet mauris arcu. |
| 334 |
* - Stub Row 3 |
| 335 |
- Row 3 |
| 336 |
- Column 2 |
| 337 |
- Column 3 long. Lorem ipsum dolor sit amet, consectetur adipiscing elit. Nam sit amet mauris arcu. |
| 338 |
|
| 339 |
.. list-table:: This is a list table with images in it. |
| 340 |
|
| 341 |
* - .. figure:: static/yi_jing_01_chien.jpg |
| 342 |
|
| 343 |
This is a short caption for a figure. |
| 344 |
|
| 345 |
- .. figure:: static/yi_jing_01_chien.jpg |
| 346 |
|
| 347 |
This is a long caption for a figure. Lorem ipsum dolor sit amet, consectetur adipiscing elit. |
| 348 |
Donec porttitor dolor in odio posuere, vitae ornare libero mattis. In lobortis justo vestibulum nibh aliquet, non. |
| 349 |
|
| 350 |
|
| 351 |
Tables with paragraphs |
| 352 |
---------------------- |
| 353 |
|
| 354 |
.. regression test for https://github.com/readthedocs/sphinx_rtd_theme/issues/289 |
| 355 |
|
| 356 |
Test to see that tables behave well with nested paragraphs. |
| 357 |
|
| 358 |
+------------+----------+-------------------------+ |
| 359 |
| Precedence | Operator | Description | |
| 360 |
+============+==========+=========================+ |
| 361 |
| 1 | \:: | Scope resolution | |
| 362 |
+------------+----------+-------------------------+ |
| 363 |
| 2 | ( ) | Function call | |
| 364 |
| | | | |
| 365 |
| | [ ] | Subscript | |
| 366 |
| | | | |
| 367 |
| | . | Member access | |
| 368 |
| | | | |
| 369 |
| | .{ } | Bit-field concatenation | |
| 370 |
+------------+----------+-------------------------+ |
| 371 |
|