-
Notifications
You must be signed in to change notification settings - Fork 1
/
Copy pathreStructedText.html
1308 lines (1100 loc) · 55.1 KB
/
reStructedText.html
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
372
373
374
375
376
377
378
379
380
381
382
383
384
385
386
387
388
389
390
391
392
393
394
395
396
397
398
399
400
401
402
403
404
405
406
407
408
409
410
411
412
413
414
415
416
417
418
419
420
421
422
423
424
425
426
427
428
429
430
431
432
433
434
435
436
437
438
439
440
441
442
443
444
445
446
447
448
449
450
451
452
453
454
455
456
457
458
459
460
461
462
463
464
465
466
467
468
469
470
471
472
473
474
475
476
477
478
479
480
481
482
483
484
485
486
487
488
489
490
491
492
493
494
495
496
497
498
499
500
501
502
503
504
505
506
507
508
509
510
511
512
513
514
515
516
517
518
519
520
521
522
523
524
525
526
527
528
529
530
531
532
533
534
535
536
537
538
539
540
541
542
543
544
545
546
547
548
549
550
551
552
553
554
555
556
557
558
559
560
561
562
563
564
565
566
567
568
569
570
571
572
573
574
575
576
577
578
579
580
581
582
583
584
585
586
587
588
589
590
591
592
593
594
595
596
597
598
599
600
601
602
603
604
605
606
607
608
609
610
611
612
613
614
615
616
617
618
619
620
621
622
623
624
625
626
627
628
629
630
631
632
633
634
635
636
637
638
639
640
641
642
643
644
645
646
647
648
649
650
651
652
653
654
655
656
657
658
659
660
661
662
663
664
665
666
667
668
669
670
671
672
673
674
675
676
677
678
679
680
681
682
683
684
685
686
687
688
689
690
691
692
693
694
695
696
697
698
699
700
701
702
703
704
705
706
707
708
709
710
711
712
713
714
715
716
717
718
719
720
721
722
723
724
725
726
727
728
729
730
731
732
733
734
735
736
737
738
739
740
741
742
743
744
745
746
747
748
749
750
751
752
753
754
755
756
757
758
759
760
761
762
763
764
765
766
767
768
769
770
771
772
773
774
775
776
777
778
779
780
781
782
783
784
785
786
787
788
789
790
791
792
793
794
795
796
797
798
799
800
801
802
803
804
805
806
807
808
809
810
811
812
813
814
815
816
817
818
819
820
821
822
823
824
825
826
827
828
829
830
831
832
833
834
835
836
837
838
839
840
841
842
843
844
845
846
847
848
849
850
851
852
853
854
855
856
857
858
859
860
861
862
863
864
865
866
867
868
869
870
871
872
873
874
875
876
877
878
879
880
881
882
883
884
885
886
887
888
889
890
891
892
893
894
895
896
897
898
899
900
901
902
903
904
905
906
907
908
909
910
911
912
913
914
915
916
917
918
919
920
921
922
923
924
925
926
927
928
929
930
931
932
933
934
935
936
937
938
939
940
941
942
943
944
945
946
947
948
949
950
951
952
953
954
955
956
957
958
959
960
961
962
963
964
965
966
967
968
969
970
971
972
973
974
975
976
977
978
979
980
981
982
983
984
985
986
987
988
989
990
991
992
993
994
995
996
997
998
999
1000
<!DOCTYPE html>
<html><head>
<title>Quick reStructuredText</title>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8">
<style type="text/css">
a.backref { text-decoration: none ; color: black }
div.line-block { display: block }
div.line-block div.line-block { margin-left: 1.5em }
</style>
</head>
<body>
<h1>Quick <i>re</i><font size="+4"><tt>Structured</tt></font><i>Text</i></h1>
<!-- Caveat: if you're reading the HTML for the examples, -->
<!-- beware that it was hand-generated, not by Docutils/ReST. -->
<p align="right"><em><a href="http://docutils.sourceforge.net/docs/user/rst/quickref.html">http://docutils.sourceforge.net/docs/user/rst/quickref.html</a></em>
<br><em>Being a cheat-sheet for reStructuredText</em>
<br><em>Updated $Date: 2009-07-14 16:05:34 +0200 (Di, 14. Jul 2009) $</em>
</p><blockquote>
<p>Copyright: This document has been placed in the public domain.
</p></blockquote>
<p>The full details of the markup may be found on the
<a href="http://docutils.sourceforge.net/rst.html">reStructuredText</a>
page. This document is just intended as a reminder.
</p><p>Links that look like "(<a href="#details">details</a>)" point
into the HTML version of the full <a href="../../ref/rst/restructuredtext.html">reStructuredText
specification</a> document. These are relative links; if they
don't work, please use the <a href="http://docutils.sourceforge.net/docs/user/rst/quickref.html">master "Quick reStructuredText"</a> document.
</p><h2><a name="contents">Contents</a></h2>
<ul>
<li><a href="#inline-markup">Inline Markup</a></li>
<li><a href="#escaping">Escaping with Backslashes</a></li>
<li><a href="#section-structure">Section Structure</a></li>
<li><a href="#paragraphs">Paragraphs</a></li>
<li><a href="#bullet-lists">Bullet Lists</a></li>
<li><a href="#enumerated-lists">Enumerated Lists</a></li>
<li><a href="#definition-lists">Definition Lists</a></li>
<li><a href="#field-lists">Field Lists</a></li>
<li><a href="#option-lists">Option Lists</a></li>
<li><a href="#literal-blocks">Literal Blocks</a></li>
<li><a href="#line-blocks">Line Blocks</a></li>
<li><a href="#block-quotes">Block Quotes</a></li>
<li><a href="#doctest-blocks">Doctest Blocks</a></li>
<li><a href="#tables">Tables</a></li>
<li><a href="#transitions">Transitions</a></li>
<li><a href="#explicit-markup">Explicit Markup</a>
<ul>
<li><a href="#footnotes">Footnotes</a></li>
<li><a href="#citations">Citations</a></li>
<li><a href="#hyperlink-targets">Hyperlink Targets</a>
<ul>
<li><a href="#external-hyperlink-targets">External Hyperlink Targets</a></li>
<li><a href="#internal-hyperlink-targets">Internal Hyperlink Targets</a></li>
<li><a href="#indirect-hyperlink-targets">Indirect Hyperlink Targets</a></li>
<li><a href="#implicit-hyperlink-targets">Implicit Hyperlink Targets</a></li>
</ul></li>
<li><a href="#directives">Directives</a></li>
<li><a href="#substitution-references-and-definitions">Substitution References and Definitions</a></li>
<li><a href="#comments">Comments</a></li>
</ul></li>
<li><a href="#getting-help">Getting Help</a></li>
</ul>
<h2><a href="#contents" name="inline-markup" class="backref">Inline Markup</a></h2>
<p>(<a href="../../ref/rst/restructuredtext.html#inline-markup">details</a>)
</p><p>Inline markup allows words and phrases within text to have
character styles (like italics and boldface) and functionality
(like hyperlinks).
</p><p></p><table border="1" width="100%" bgcolor="#ffffcc" cellpadding="3">
<thead>
<tr align="left" bgcolor="#99CCFF">
<th>Plain text
</th><th>Typical result
</th><th>Notes
</th></tr></thead>
<tbody>
<tr valign="top">
<td nowrap=""><samp>*emphasis*</samp>
</td><td><em>emphasis</em>
</td><td>Normally rendered as italics.
</td></tr><tr valign="top">
<td nowrap=""><samp>**strong emphasis**</samp>
</td><td><strong>strong emphasis</strong>
</td><td>Normally rendered as boldface.
</td></tr><tr valign="top">
<td nowrap=""><samp>`interpreted text`</samp>
</td><td>(see note at right)
</td><td>The rendering and <em>meaning</em> of interpreted text is
domain- or application-dependent. It can be used for things
like index entries or explicit descriptive markup (like program
identifiers).
</td></tr><tr valign="top">
<td nowrap=""><samp>``inline literal``</samp>
</td><td><code>inline literal</code>
</td><td>Normally rendered as monospaced text. Spaces should be
preserved, but line breaks will not be.
</td></tr><tr valign="top">
<td nowrap=""><samp>reference_</samp>
</td><td><a href="#hyperlink-targets">reference</a>
</td><td>A simple, one-word hyperlink reference. See <a href="#hyperlink-targets">Hyperlink Targets</a>.
</td></tr><tr valign="top">
<td nowrap=""><samp>`phrase reference`_</samp>
</td><td><a href="#hyperlink-targets">phrase reference</a>
</td><td>A hyperlink reference with spaces or punctuation needs to be
quoted with backquotes. See <a href="#hyperlink-targets">Hyperlink Targets</a>.
</td></tr><tr valign="top">
<td nowrap=""><samp>anonymous__</samp>
</td><td><a href="#hyperlink-targets">anonymous</a>
</td><td>With two underscores instead of one, both simple and phrase
references may be anonymous (the reference text is not repeated
at the target). See <a href="#hyperlink-targets">Hyperlink Targets</a>.
</td></tr><tr valign="top">
<td nowrap=""><samp>_`inline internal target`</samp>
</td><td><a name="inline-internal-target">inline internal target</a>
</td><td>A crossreference target within text.
See <a href="#hyperlink-targets">Hyperlink Targets</a>.
</td></tr><tr valign="top">
<td nowrap=""><samp>|substitution reference|</samp>
</td><td>(see note at right)
</td><td>The result is substituted in from the <a href="#substitution-references-and-definitions">substitution
definition</a>. It could be text, an image, a hyperlink, or a
combination of these and others.
</td></tr><tr valign="top">
<td nowrap=""><samp>footnote reference [1]_</samp>
</td><td>footnote reference <sup><a href="#footnotes">1</a></sup>
</td><td>See <a href="#footnotes">Footnotes</a>.
</td></tr><tr valign="top">
<td nowrap=""><samp>citation reference [CIT2002]_</samp>
</td><td>citation reference <a href="#citations">[CIT2002]</a>
</td><td>See <a href="#citations">Citations</a>.
</td></tr><tr valign="top">
<td nowrap=""><samp>http://docutils.sf.net/</samp>
</td><td><a href="http://docutils.sf.net/">http://docutils.sf.net/</a>
</td><td>A standalone hyperlink.
</td></tr></tbody></table>
<p>Asterisk, backquote, vertical bar, and underscore are inline
delimiter characters. Asterisk, backquote, and vertical bar act
like quote marks; matching characters surround the marked-up word
or phrase, whitespace or other quoting is required outside them,
and there can't be whitespace just inside them. If you want to use
inline delimiter characters literally, <a href="#escaping">escape
(with backslash)</a> or quote them (with double backquotes; i.e.
use inline literals).
</p><p>In detail, the reStructuredText specification says that in
inline markup, the following rules apply to start-strings and
end-strings (inline markup delimiters):
</p><ol>
<li>The start-string must start a text block or be
immediately preceded by whitespace or any of
<samp>' " ( [ {</samp> or <samp><</samp>.
</li><li>The start-string must be immediately followed by non-whitespace.
</li><li>The end-string must be immediately preceded by non-whitespace.
</li><li>The end-string must end a text block (end of document or
followed by a blank line) or be immediately followed by whitespace
or any of <samp>' " . , : ; ! ? - ) ] } / \</samp>
or <samp>></samp>.
</li><li>If a start-string is immediately preceded by one of
<samp>' " ( [ {</samp> or <samp><</samp>, it must not be
immediately followed by the corresponding character from
<samp>' " ) ] }</samp> or <samp>></samp>.
</li><li>An end-string must be separated by at least one
character from the start-string.
</li><li>An <a href="#escaping">unescaped</a> backslash preceding a
start-string or end-string will disable markup recognition, except
for the end-string of inline literals.
</li></ol>
<p>Also remember that inline markup may not be nested (well,
except that inline literals can contain any of the other inline
markup delimiter characters, but that doesn't count because
nothing is processed).
</p><h2><a href="#contents" name="escaping" class="backref">Escaping with Backslashes</a></h2>
<p>(<a href="../../ref/rst/restructuredtext.html#escaping-mechanism">details</a>)
</p><p>reStructuredText uses backslashes ("\") to override the special
meaning given to markup characters and get the literal characters
themselves. To get a literal backslash, use an escaped backslash
("\\"). For example:
</p><p></p><table border="1" width="100%" bgcolor="#ffffcc" cellpadding="3">
<thead>
<tr align="left" bgcolor="#99CCFF">
<th width="50%">Raw reStructuredText
</th><th width="50%">Typical result
</th></tr></thead>
<tbody>
<tr valign="top"><td>
<samp>*escape* ``with`` "\"</samp>
</td><td><em>escape</em> <samp>with</samp> ""
</td></tr><tr valign="top"><td>
<samp>\*escape* \``with`` "\\"</samp>
</td><td>*escape* ``with`` "\"
</td></tr></tbody></table>
<p>In Python strings it will, of course, be necessary
to escape any backslash characters so that they actually
<em>reach</em> reStructuredText.
The simplest way to do this is to use raw strings:
</p><p></p><table border="1" width="100%" bgcolor="#ffffcc" cellpadding="3">
<thead>
<tr align="left" bgcolor="#99CCFF">
<th width="50%">Python string
</th><th width="50%">Typical result
</th></tr></thead>
<tbody>
<tr valign="top"><td>
<samp>r"""\*escape* \`with` "\\""""</samp>
</td><td>*escape* `with` "\"
</td></tr><tr valign="top"><td>
<samp> """\\*escape* \\`with` "\\\\""""</samp>
</td><td>*escape* `with` "\"
</td></tr><tr valign="top"><td>
<samp> """\*escape* \`with` "\\""""</samp>
</td><td><em>escape</em> with ""
</td></tr></tbody></table>
<h2><a href="#contents" name="section-structure" class="backref">Section Structure</a></h2>
<p>(<a href="../../ref/rst/restructuredtext.html#sections">details</a>)
</p><p></p><table border="1" width="100%" bgcolor="#ffffcc" cellpadding="3">
<thead>
<tr align="left" bgcolor="#99CCFF">
<th width="50%">Plain text
</th><th width="50%">Typical result
</th></tr></thead>
<tbody>
<tr valign="top">
<td>
<samp>=====</samp>
<br><samp>Title</samp>
<br><samp>=====</samp>
<br><samp>Subtitle</samp>
<br><samp>--------</samp>
<br><samp>Titles are underlined (or over-</samp>
<br><samp>and underlined) with a printing</samp>
<br><samp>nonalphanumeric 7-bit ASCII</samp>
<br><samp>character. Recommended choices</samp>
<br><samp>are "``= - ` : ' " ~ ^ _ * + # < >``".</samp>
<br><samp>The underline/overline must be at</samp>
<br><samp>least as long as the title text.</samp>
<br><samp></samp>
<br><samp>A lone top-level (sub)section</samp>
<br><samp>is lifted up to be the document's</samp>
<br><samp>(sub)title.</samp>
</td><td>
<font size="+2"><strong>Title</strong></font>
<p><font size="+1"><strong>Subtitle</strong></font>
</p><p>Titles are underlined (or over-
and underlined) with a printing
nonalphanumeric 7-bit ASCII
character. Recommended choices
are "<samp>= - ` : ' " ~ ^ _ * + # < ></samp>".
The underline/overline must be at
least as long as the title text.
</p><p>A lone top-level (sub)section is
lifted up to be the document's
(sub)title.
</p></td></tr></tbody></table>
<h2><a href="#contents" name="paragraphs" class="backref">Paragraphs</a></h2>
<p>(<a href="../../ref/rst/restructuredtext.html#paragraphs">details</a>)
</p><p></p><table border="1" width="100%" bgcolor="#ffffcc" cellpadding="3">
<thead>
<tr align="left" bgcolor="#99CCFF">
<th width="50%">Plain text
</th><th width="50%">Typical result
</th></tr></thead>
<tbody>
<tr valign="top">
<td>
<p><samp>This is a paragraph.</samp>
</p><p><samp>Paragraphs line up at their left</samp>
<br><samp>edges, and are normally separated</samp>
<br><samp>by blank lines.</samp>
</p></td><td>
<p>This is a paragraph.
</p><p>Paragraphs line up at their left edges, and are normally
separated by blank lines.
</p></td></tr></tbody></table>
<h2><a href="#contents" name="bullet-lists" class="backref">Bullet Lists</a></h2>
<p>(<a href="../../ref/rst/restructuredtext.html#bullet-lists">details</a>)
</p><p></p><table border="1" width="100%" bgcolor="#ffffcc" cellpadding="3">
<thead>
<tr align="left" bgcolor="#99CCFF">
<th width="50%">Plain text
</th><th width="50%">Typical result
</th></tr></thead>
<tbody>
<tr valign="top">
<td>
<samp>Bullet lists:</samp>
<p><samp>- This is item 1</samp>
<br><samp>- This is item 2</samp>
</p><p><samp>- Bullets are "-", "*" or "+".</samp>
<br><samp> Continuing text must be aligned</samp>
<br><samp> after the bullet and whitespace.</samp>
</p><p><samp>Note that a blank line is required</samp>
<br><samp>before the first item and after the</samp>
<br><samp>last, but is optional between items.</samp>
</p></td><td>Bullet lists:
<ul>
<li>This is item 1
</li><li>This is item 2
</li><li>Bullets are "-", "*" or "+".
Continuing text must be aligned
after the bullet and whitespace.
</li></ul>
<p>Note that a blank line is required before the first
item and after the last, but is optional between items.
</p></td></tr></tbody></table>
<h2><a href="#contents" name="enumerated-lists" class="backref">Enumerated Lists</a></h2>
<p>(<a href="../../ref/rst/restructuredtext.html#enumerated-lists">details</a>)
</p><p></p><table border="1" width="100%" bgcolor="#ffffcc" cellpadding="3">
<thead>
<tr align="left" bgcolor="#99CCFF">
<th width="50%">Plain text
</th><th width="50%">Typical result
</th></tr></thead>
<tbody>
<tr valign="top">
<td>
<samp>Enumerated lists:</samp>
<p><samp>3. This is the first item</samp>
<br><samp>4. This is the second item</samp>
<br><samp>5. Enumerators are arabic numbers,</samp>
<br><samp> single letters, or roman numerals</samp>
<br><samp>6. List items should be sequentially</samp>
<br><samp> numbered, but need not start at 1</samp>
<br><samp> (although not all formatters will</samp>
<br><samp> honour the first index).</samp>
<br><samp>#. This item is auto-enumerated</samp>
</p></td><td>Enumerated lists:
<ol type="1">
<li value="3">This is the first item
</li><li>This is the second item
</li><li>Enumerators are arabic numbers, single letters,
or roman numerals
</li><li>List items should be sequentially numbered,
but need not start at 1 (although not all
formatters will honour the first index).
</li><li>This item is auto-enumerated
</li></ol>
</td></tr></tbody></table>
<h2><a href="#contents" name="definition-lists" class="backref">Definition Lists</a></h2>
<p>(<a href="../../ref/rst/restructuredtext.html#definition-lists">details</a>)
</p><p></p><table border="1" width="100%" bgcolor="#ffffcc" cellpadding="3">
<thead>
<tr align="left" bgcolor="#99CCFF">
<th width="50%">Plain text
</th><th width="50%">Typical result
</th></tr></thead>
<tbody>
<tr valign="top">
<td>
<samp>Definition lists:</samp>
<br>
<br><samp>what</samp>
<br><samp> Definition lists associate a term with</samp>
<br><samp> a definition.</samp>
<br>
<br><samp>how</samp>
<br><samp> The term is a one-line phrase, and the</samp>
<br><samp> definition is one or more paragraphs or</samp>
<br><samp> body elements, indented relative to the</samp>
<br><samp> term. Blank lines are not allowed</samp>
<br><samp> between term and definition.</samp>
</td><td>Definition lists:
<dl>
<dt><strong>what</strong>
</dt><dd>Definition lists associate a term with
a definition.
</dd><dt><strong>how</strong>
</dt><dd>The term is a one-line phrase, and the
definition is one or more paragraphs or
body elements, indented relative to the
term. Blank lines are not allowed
between term and definition.
</dd></dl>
</td></tr></tbody></table>
<h2><a href="#contents" name="field-lists" class="backref">Field Lists</a></h2>
<p>(<a href="../../ref/rst/restructuredtext.html#field-lists">details</a>)
</p><p></p><table border="1" width="100%" bgcolor="#ffffcc" cellpadding="3">
<thead>
<tr align="left" bgcolor="#99CCFF">
<th width="50%">Plain text
</th><th width="50%">Typical result
</th></tr></thead>
<tbody>
<tr valign="top">
<td>
<samp>:Authors:</samp>
<br><samp> Tony J. (Tibs) Ibbs,</samp>
<br><samp> David Goodger</samp>
<p><samp> (and sundry other good-natured folks)</samp>
</p><p><samp>:Version: 1.0 of 2001/08/08</samp>
<br><samp>:Dedication: To my father.</samp>
</p></td><td>
<table>
<tbody><tr valign="top">
<td><strong>Authors:</strong>
</td><td>Tony J. (Tibs) Ibbs,
David Goodger
</td></tr><tr><td></td><td>(and sundry other good-natured folks)
</td></tr><tr><td><strong>Version:</strong></td><td>1.0 of 2001/08/08
</td></tr><tr><td><strong>Dedication:</strong></td><td>To my father.
</td></tr></tbody></table>
</td></tr></tbody></table>
<p>Field lists are used as part of an extension syntax, such as
options for <a href="#directives">directives</a>, or database-like
records meant for further processing. Field lists may also be
used as generic two-column table constructs in documents.
</p><h2><a href="#contents" name="option-lists" class="backref">Option Lists</a></h2>
<p>(<a href="../../ref/rst/restructuredtext.html#option-lists">details</a>)
</p><p></p><table border="1" width="100%" bgcolor="#ffffcc" cellpadding="3">
<thead>
<tr align="left" bgcolor="#99CCFF">
<th width="50%">Plain text
</th><th width="50%">Typical result
</th></tr></thead>
<tbody>
<tr valign="top">
<td>
<p><samp>
-a command-line option "a"
<br>-b file options can have arguments
<br> and long descriptions
<br>--long options can be long also
<br>--input=file long options can also have
<br> arguments
<br>/V DOS/VMS-style options too
</samp>
</p></td><td>
<table border="0" width="100%">
<tbody valign="top">
<tr>
<td width="30%"><samp>-a</samp>
</td><td>command-line option "a"
</td></tr><tr>
<td><samp>-b <i>file</i></samp>
</td><td>options can have arguments and long descriptions
</td></tr><tr>
<td><samp>--long</samp>
</td><td>options can be long also
</td></tr><tr>
<td><samp>--input=<i>file</i></samp>
</td><td>long options can also have arguments
</td></tr><tr>
<td><samp>/V</samp>
</td><td>DOS/VMS-style options too
</td></tr></tbody></table>
</td></tr></tbody></table>
<p>There must be at least two spaces between the option and the
description.
</p><h2><a href="#contents" name="literal-blocks" class="backref">Literal Blocks</a></h2>
<p>(<a href="../../ref/rst/restructuredtext.html#literal-blocks">details</a>)
</p><p></p><table border="1" width="100%" bgcolor="#ffffcc" cellpadding="3">
<thead>
<tr align="left" bgcolor="#99CCFF">
<th width="50%">Plain text
</th><th width="50%">Typical result
</th></tr></thead>
<tbody>
<tr valign="top">
<td>
<samp>A paragraph containing only two colons</samp>
<br><samp>indicates that the following indented</samp>
<br><samp>or quoted text is a literal block.</samp>
<br>
<br><samp>::</samp>
<br>
<br><samp> Whitespace, newlines, blank lines, and</samp>
<br><samp> all kinds of markup (like *this* or</samp>
<br><samp> \this) is preserved by literal blocks.</samp>
<br>
<br><samp> The paragraph containing only '::'</samp>
<br><samp> will be omitted from the result.</samp>
<br>
<br><samp>The ``::`` may be tacked onto the very</samp>
<br><samp>end of any paragraph. The ``::`` will be</samp>
<br><samp>omitted if it is preceded by whitespace.</samp>
<br><samp>The ``::`` will be converted to a single</samp>
<br><samp>colon if preceded by text, like this::</samp>
<br>
<br><samp> It's very convenient to use this form.</samp>
<br>
<br><samp>Literal blocks end when text returns to</samp>
<br><samp>the preceding paragraph's indentation.</samp>
<br><samp>This means that something like this</samp>
<br><samp>is possible::</samp>
<br>
<br><samp> We start here</samp>
<br><samp> and continue here</samp>
<br><samp> and end here.</samp>
<br>
<br><samp>Per-line quoting can also be used on</samp>
<br><samp>unindented literal blocks::</samp>
<br>
<br><samp>> Useful for quotes from email and</samp>
<br><samp>> for Haskell literate programming.</samp>
</td><td>
<p>A paragraph containing only two colons
indicates that the following indented or quoted
text is a literal block.
</p><pre> Whitespace, newlines, blank lines, and
all kinds of markup (like *this* or
\this) is preserved by literal blocks.
The paragraph containing only '::'
will be omitted from the result.</pre>
<p>The <samp>::</samp> may be tacked onto the very
end of any paragraph. The <samp>::</samp> will be
omitted if it is preceded by whitespace.
The <samp>::</samp> will be converted to a single
colon if preceded by text, like this:
</p><pre> It's very convenient to use this form.</pre>
<p>Literal blocks end when text returns to
the preceding paragraph's indentation.
This means that something like this is possible:
</p><pre> We start here
and continue here
and end here.</pre>
<p>Per-line quoting can also be used on
unindented literal blocks:
</p><pre> > Useful for quotes from email and
> for Haskell literate programming.</pre>
</td></tr></tbody></table>
<h2><a href="#contents" name="line-blocks" class="backref">Line Blocks</a></h2>
<p>(<a href="../../ref/rst/restructuredtext.html#line-blocks">details</a>)
</p><p></p><table border="1" width="100%" bgcolor="#ffffcc" cellpadding="3">
<thead>
<tr align="left" bgcolor="#99CCFF">
<th width="50%">Plain text
</th><th width="50%">Typical result
</th></tr></thead>
<tbody>
<tr valign="top">
<td>
<samp>| Line blocks are useful for addresses,</samp>
<br><samp>| verse, and adornment-free lists.</samp>
<br><samp>|</samp>
<br><samp>| Each new line begins with a</samp>
<br><samp>| vertical bar ("|").</samp>
<br><samp>| Line breaks and initial indents</samp>
<br><samp>| are preserved.</samp>
<br><samp>| Continuation lines are wrapped</samp>
<br><samp> portions of long lines; they begin</samp>
<br><samp> with spaces in place of vertical bars.</samp>
</td><td>
<div class="line-block">
<div class="line">Line blocks are useful for addresses,</div>
<div class="line">verse, and adornment-free lists.</div>
<div class="line"><br></div>
<div class="line">Each new line begins with a</div>
<div class="line">vertical bar ("|").</div>
<div class="line-block">
<div class="line">Line breaks and initial indents</div>
<div class="line">are preserved.</div>
</div>
<div class="line">Continuation lines are wrapped portions
of long lines; they begin
with spaces in place of vertical bars.</div>
</div>
</td></tr></tbody></table>
<h2><a href="#contents" name="block-quotes" class="backref">Block Quotes</a></h2>
<p>(<a href="../../ref/rst/restructuredtext.html#block-quotes">details</a>)
</p><p></p><table border="1" width="100%" bgcolor="#ffffcc" cellpadding="3">
<thead>
<tr align="left" bgcolor="#99CCFF">
<th width="50%">Plain text
</th><th width="50%">Typical result
</th></tr></thead>
<tbody>
<tr valign="top">
<td>
<samp>Block quotes are just:</samp>
<p><samp> Indented paragraphs,</samp>
</p><p><samp> and they may nest.</samp>
</p></td><td>
Block quotes are just:
<blockquote>
<p>Indented paragraphs,
</p><blockquote>
<p>and they may nest.
</p></blockquote>
</blockquote>
</td></tr></tbody></table>
<p>Use <a href="#comments">empty comments</a> to separate indentation
contexts, such as block quotes and directive contents.</p>
<h2><a href="#contents" name="doctest-blocks" class="backref">Doctest Blocks</a></h2>
<p>(<a href="../../ref/rst/restructuredtext.html#doctest-blocks">details</a>)
</p><p></p><table border="1" width="100%" bgcolor="#ffffcc" cellpadding="3">
<thead>
<tr align="left" bgcolor="#99CCFF">
<th width="50%">Plain text
</th><th width="50%">Typical result
</th></tr></thead>
<tbody>
<tr valign="top">
<td>
<p><samp>Doctest blocks are interactive
<br>Python sessions. They begin with
<br>"``>>>``" and end with a blank line.</samp>
</p><p><samp>>>> print "This is a doctest block."
<br>This is a doctest block.</samp>
</p></td><td>
<p>Doctest blocks are interactive
Python sessions. They begin with
"<samp>>>></samp>" and end with a blank line.
</p><p><samp>>>> print "This is a doctest block."
<br>This is a doctest block.</samp>
</p></td></tr></tbody></table>
<p>"The <a href="http://www.python.org/doc/current/lib/module-doctest.html">doctest</a>
module searches a module's docstrings for text that looks like an
interactive Python session, then executes all such sessions to
verify they still work exactly as shown." (From the doctest docs.)
</p><h2><a href="#contents" name="tables" class="backref">Tables</a></h2>
<p>(<a href="../../ref/rst/restructuredtext.html#tables">details</a>)
</p><p>There are two syntaxes for tables in reStructuredText. Grid
tables are complete but cumbersome to create. Simple tables are
easy to create but limited (no row spans, etc.).</p>
<p></p><table border="1" width="100%" bgcolor="#ffffcc" cellpadding="3">
<thead>
<tr align="left" bgcolor="#99CCFF">
<th width="50%">Plain text
</th><th width="50%">Typical result
</th></tr></thead>
<tbody>
<tr valign="top">
<td>
<p><samp>Grid table:</samp></p>
<p><samp>+------------+------------+-----------+</samp>
<br><samp>| Header 1 | Header 2 | Header 3 |</samp>
<br><samp>+============+============+===========+</samp>
<br><samp>| body row 1 | column 2 | column 3 |</samp>
<br><samp>+------------+------------+-----------+</samp>
<br><samp>| body row 2 | Cells may span columns.|</samp>
<br><samp>+------------+------------+-----------+</samp>
<br><samp>| body row 3 | Cells may | - Cells |</samp>
<br><samp>+------------+ span rows. | - contain |</samp>
<br><samp>| body row 4 | | - blocks. |</samp>
<br><samp>+------------+------------+-----------+</samp></p>
</td><td>
<p>Grid table:</p>
<table border="1">
<thead valign="bottom">
<tr>
<th>Header 1
</th><th>Header 2
</th><th>Header 3
</th></tr>
</thead>
<tbody valign="top">
<tr>
<td>body row 1
</td><td>column 2
</td><td>column 3
</td></tr>
<tr>
<td>body row 2
</td><td colspan="2">Cells may span columns.
</td></tr>
<tr>
<td>body row 3
</td><td rowspan="2">Cells may<br>span rows.
</td><td rowspan="2">
<ul>
<li>Cells
</li><li>contain
</li><li>blocks.
</li></ul>
</td></tr>
<tr>
<td>body row 4
</td></tr>
</tbody></table>
</td></tr><tr valign="top">
<td>
<p><samp>Simple table:</samp></p>
<p><samp>===== ===== ======</samp>
<br><samp> Inputs Output</samp>
<br><samp>------------ ------</samp>
<br><samp> A B A or B</samp>
<br><samp>===== ===== ======</samp>
<br><samp>False False False</samp>
<br><samp>True False True</samp>
<br><samp>False True True</samp>
<br><samp>True True True</samp>
<br><samp>===== ===== ======</samp></p>
</td><td>
<p>Simple table:</p>
<table border="1">
<colgroup>
<col width="31%">
<col width="31%">
<col width="38%">
</colgroup>
<thead valign="bottom">
<tr>
<th colspan="2">Inputs
</th><th>Output
</th></tr><tr>
<th>A
</th><th>B
</th><th>A or B
</th></tr></thead><tbody valign="top">
<tr>
<td>False
</td><td>False
</td><td>False
</td></tr><tr>
<td>True
</td><td>False
</td><td>True
</td></tr><tr>
<td>False
</td><td>True
</td><td>True
</td></tr><tr>
<td>True
</td><td>True
</td><td>True
</td></tr></tbody></table>
</td></tr></tbody></table>
<h2><a href="#contents" name="transitions" class="backref">Transitions</a></h2>
<p>(<a href="../../ref/rst/restructuredtext.html#transitions">details</a>)
</p><p></p><table border="1" width="100%" bgcolor="#ffffcc" cellpadding="3">
<thead>
<tr align="left" bgcolor="#99CCFF">
<th width="50%">Plain text
</th><th width="50%">Typical result
</th></tr></thead>
<tbody>
<tr valign="top">
<td>
<p><samp>
A transition marker is a horizontal line
<br>of 4 or more repeated punctuation
<br>characters.</samp>
</p><p><samp>------------</samp>
</p><p><samp>A transition should not begin or end a
<br>section or document, nor should two
<br>transitions be immediately adjacent.</samp>
</p></td><td>
<p>A transition marker is a horizontal line
of 4 or more repeated punctuation
characters.</p>
<hr>
<p>A transition should not begin or end a
section or document, nor should two
transitions be immediately adjacent.
</p></td></tr></tbody></table>
<p>Transitions are commonly seen in novels and short fiction, as a
gap spanning one or more lines, marking text divisions or
signaling changes in subject, time, point of view, or emphasis.
</p><h2><a href="#contents" name="explicit-markup" class="backref">Explicit Markup</a></h2>
<p>Explicit markup blocks are used for constructs which float
(footnotes), have no direct paper-document representation
(hyperlink targets, comments), or require specialized processing
(directives). They all begin with two periods and whitespace, the
"explicit markup start".
</p><h3><a href="#contents" name="footnotes" class="backref">Footnotes</a></h3>
<p>(<a href="../../ref/rst/restructuredtext.html#footnotes">details</a>)
</p><p></p><table border="1" width="100%" bgcolor="#ffffcc" cellpadding="3">
<thead>
<tr align="left" bgcolor="#99CCFF">
<th width="50%">Plain text
</th><th width="50%">Typical result
</th></tr></thead>
<tbody>
<tr valign="top">
<td>
<samp>Footnote references, like [5]_.</samp>
<br><samp>Note that footnotes may get</samp>
<br><samp>rearranged, e.g., to the bottom of</samp>
<br><samp>the "page".</samp>
<p><samp>.. [5] A numerical footnote. Note</samp>
<br><samp> there's no colon after the ``]``.</samp>
</p></td><td>
Footnote references, like <sup><a href="#5">5</a></sup>.
Note that footnotes may get rearranged, e.g., to the bottom of
the "page".
<p></p><table>
<tbody><tr><td colspan="2"><hr>
<!-- <tr><td colspan="2">Footnotes: -->
</td></tr><tr><td><a name="5"><strong>[5]</strong></a></td><td> A numerical footnote.
Note there's no colon after the <samp>]</samp>.
</td></tr></tbody></table>
</td></tr><tr valign="top">
<td>
<samp>Autonumbered footnotes are</samp>
<br><samp>possible, like using [#]_ and [#]_.</samp>
<p><samp>.. [#] This is the first one.</samp>
<br><samp>.. [#] This is the second one.</samp>
</p><p><samp>They may be assigned 'autonumber</samp>
<br><samp>labels' - for instance,
<br>[#fourth]_ and [#third]_.</samp>
</p><p><samp>.. [#third] a.k.a. third_</samp>
</p><p><samp>.. [#fourth] a.k.a. fourth_</samp>
</p></td><td>
Autonumbered footnotes are possible, like using <sup><a href="#auto1">1</a></sup> and <sup><a href="#auto2">2</a></sup>.
<p>They may be assigned 'autonumber labels' - for instance,
<sup><a href="#fourth">4</a></sup> and <sup><a href="#third">3</a></sup>.
</p><p></p><table>
<tbody><tr><td colspan="2"><hr>
<!-- <tr><td colspan="2">Footnotes: -->
</td></tr><tr><td><a name="auto1"><strong>[1]</strong></a></td><td> This is the first one.
</td></tr><tr><td><a name="auto2"><strong>[2]</strong></a></td><td> This is the second one.
</td></tr><tr><td><a name="third"><strong>[3]</strong></a></td><td> a.k.a. <a href="#third">third</a>
</td></tr><tr><td><a name="fourth"><strong>[4]</strong></a></td><td> a.k.a. <a href="#fourth">fourth</a>
</td></tr></tbody></table>
</td></tr><tr valign="top">
<td>
<samp>Auto-symbol footnotes are also</samp>
<br><samp>possible, like this: [*]_ and [*]_.</samp>
<p><samp>.. [*] This is the first one.</samp>
<br><samp>.. [*] This is the second one.</samp>
</p></td><td>
Auto-symbol footnotes are also
possible, like this: <sup><a href="#symbol1">*</a></sup>
and <sup><a href="#symbol2">†</a></sup>.
<p></p><table>
<tbody><tr><td colspan="2"><hr>
<!-- <tr><td colspan="2">Footnotes: -->
</td></tr><tr><td><a name="symbol1"><strong>[*]</strong></a></td><td> This is the first symbol footnote
</td></tr><tr><td><a name="symbol2"><strong>[†]</strong></a></td><td> This is the second one.
</td></tr></tbody></table>
</td></tr></tbody></table>
<p>The numbering of auto-numbered footnotes is determined by the
order of the footnotes, not of the references. For auto-numbered
footnote references without autonumber labels
("<samp>[#]_</samp>"), the references and footnotes must be in the
same relative order. Similarly for auto-symbol footnotes
("<samp>[*]_</samp>").
</p><h3><a href="#contents" name="citations" class="backref">Citations</a></h3>
<p>(<a href="../../ref/rst/restructuredtext.html#citations">details</a>)
</p><p></p><table border="1" width="100%" bgcolor="#ffffcc" cellpadding="3">
<thead>
<tr align="left" bgcolor="#99CCFF">
<th width="50%">Plain text
</th><th width="50%">Typical result
</th></tr></thead>
<tbody>
<tr valign="top">
<td>
<samp>Citation references, like [CIT2002]_.</samp>
<br><samp>Note that citations may get</samp>
<br><samp>rearranged, e.g., to the bottom of</samp>
<br><samp>the "page".</samp>
<p><samp>.. [CIT2002] A citation</samp>
<br><samp> (as often used in journals).</samp>
</p><p><samp>Citation labels contain alphanumerics,</samp>
<br><samp>underlines, hyphens and fullstops.</samp>
<br><samp>Case is not significant.</samp>
</p><p><samp>Given a citation like [this]_, one</samp>
<br><samp>can also refer to it like this_.</samp>
</p><p><samp>.. [this] here.</samp>
</p></td><td>
Citation references, like <a href="#cit2002">[CIT2002]</a>.
Note that citations may get rearranged, e.g., to the bottom of
the "page".
<p>Citation labels contain alphanumerics, underlines, hyphens
and fullstops. Case is not significant.