1
============================
2
The Docutils Document Tree
3
============================
5
A Guide to the Docutils DTD
6
***************************
9
:Contact: goodger@users.sourceforge.net
10
:Revision: $Revision: 3963 $
11
:Date: $Date: 2005-10-28 18:12:56 +0200 (Fri, 28 Oct 2005) $
12
:Copyright: This document has been placed in the public domain.
15
.. contents:: :depth: 1
18
This document describes the XML data structure of Docutils_ documents:
19
the relationships and semantics of elements and attributes. The
20
Docutils document structure is formally defined by the `Docutils
21
Generic DTD`_ XML document type definition, docutils.dtd_, which is
22
the definitive source for details of element structural relationships.
24
This document does not discuss implementation details. Those can be
25
found in internal documentation (docstrings) for the
26
``docutils.nodes`` module, where the document tree data structure is
27
implemented in a class library.
29
The reader is assumed to have some familiarity with XML or SGML, and
30
an understanding of the data structure meaning of "tree". For a list
31
of introductory articles, see `Introducing the Extensible Markup
34
The reStructuredText_ markup is used for illustrative examples
35
throughout this document. For a gentle introduction, see `A
36
ReStructuredText Primer`_. For complete technical details, see the
37
`reStructuredText Markup Specification`_.
40
.. _Docutils: http://docutils.sourceforge.net/
41
.. _Docutils Generic DTD:
43
.. _docutils.dtd: docutils.dtd
44
.. _Introducing the Extensible Markup Language (XML):
45
http://xml.coverpages.org/xmlIntro.html
46
.. _reStructuredText: http://docutils.sourceforge.net/rst.html
47
.. _A ReStructuredText Primer: ../user/rst/quickstart.html
48
.. _reStructuredText Markup Specification: rst/restructuredtext.html
57
Below is a simplified diagram of the hierarchy of elements in the
58
Docutils document tree structure. An element may contain any other
59
elements immediately below it in the diagram. Notes are written in
60
square brackets. Element types in parentheses indicate recursive or
61
one-to-many relationships; sections may contain (sub)sections, tables
62
contain further body elements, etc. ::
64
+--------------------------------------------------------------------+
65
| document [may begin with a title, subtitle, decoration, docinfo] |
66
| +--------------------------------------+
67
| | sections [each begins with a title] |
68
+-----------------------------+-------------------------+------------+
69
| [body elements:] | (sections) |
70
| | - literal | - lists | | - hyperlink +------------+
71
| | blocks | - tables | | targets |
72
| para- | - doctest | - block | foot- | - sub. defs |
73
| graphs | blocks | quotes | notes | - comments |
74
+---------+-----------+----------+-------+--------------+
75
| [text]+ | [text] | (body elements) | [text] |
76
| (inline +-----------+------------------+--------------+
80
The Docutils document model uses a simple, recursive model for section
81
structure. A document_ node may contain body elements and section_
82
elements. Sections in turn may contain body elements and sections.
83
The level (depth) of a section element is determined from its physical
84
nesting level; unlike other document models (``<h1>`` in HTML_,
85
``<sect1>`` in DocBook_, ``<div1>`` in XMLSpec_) the level is not
86
incorporated into the element name.
88
The Docutils document model uses strict element content models. Every
89
element has a unique structure and semantics, but elements may be
90
classified into general categories (below). Only elements which are
91
meant to directly contain text data have a mixed content model, where
92
text data and inline elements may be intermixed. This is unlike the
93
much looser HTML_ document model, where paragraphs and text data may
94
occur at the same level.
100
Structural elements may only contain child elements; they do not
101
directly contain text data. Structural elements may contain body
102
elements or further structural elements. Structural elements can only
103
be child elements of other structural elements.
105
Category members: document_, section_, topic_, sidebar_
108
Structural Subelements
109
----------------------
111
Structural subelements are child elements of structural elements.
112
Simple structuctural subelements (title_, subtitle_) contain text
113
data; the others are compound and do not directly contain text data.
115
Category members: title_, subtitle_, decoration_, docinfo_,
119
Bibliographic Elements
120
``````````````````````
122
The docinfo_ element is an optional child of document_. It groups
123
bibliographic elements together. All bibliographic elements except
124
authors_ and field_ contain text data. authors_ contains further
125
bibliographic elements (most notably author_). field_ contains
126
field_name_ and field_body_ body subelements.
128
Category members: address_, author_, authors_, contact_, copyright_,
129
date_, field_, organization_, revision_, status_, version_
135
The decoration_ element is also an optional child of document_. It
136
groups together elements used to generate page headers and footers.
138
Category members: footer_, header_
144
Body elements are contained within structural elements and compound
145
body elements. There are two subcategories of body elements: simple
148
Category members: admonition_, attention_, block_quote_, bullet_list_,
149
caution_, citation_, comment_, compound_, container_, danger_,
150
definition_list_, doctest_block_, enumerated_list_, error_,
151
field_list_, figure_, footnote_, hint_, image_, important_,
152
line_block_, literal_block_, note_, option_list_, paragraph_,
153
pending_, raw_, rubric_, substitution_definition_, system_message_,
154
table_, target_, tip_, warning_
160
Simple body elements are empty or directly contain text data. Those
161
that contain text data may also contain inline elements. Such
162
elements therefore have a "mixed content model".
164
Category members: comment_, doctest_block_, image_, literal_block_,
165
paragraph_, pending_, raw_, rubric_, substitution_definition_, target_
168
Compound Body Elements
169
----------------------
171
Compound body elements contain local substructure (body subelements)
172
and further body elements. They do not directly contain text data.
174
Category members: admonition_, attention_, block_quote_, bullet_list_,
175
caution_, citation_, compound_, container_, danger_, definition_list_,
176
enumerated_list_, error_, field_list_, figure_, footnote_, hint_,
177
important_, line_block, note_, option_list_, system_message_, table_,
184
Compound body elements contain specific subelements (e.g. bullet_list_
185
contains list_item_). Subelements may themselves be compound elements
186
(containing further child elements, like field_) or simple data
187
elements (containing text data, like field_name_). These subelements
188
always occur within specific parent elements, never at the body
189
element level (beside paragraphs, etc.).
191
Category members (simple): attribution_, caption_, classifier_,
192
colspec_, field_name_, label_, line_, option_argument_,
193
option_string_, term_
195
Category members (compound): definition_, definition_list_item_,
196
description_, entry_, field_, field_body_, legend_, list_item_,
197
option_, option_group_, option_list_item_, row_, tbody_, tgroup_,
204
Inline elements directly contain text data, and may also contain
205
further inline elements. Inline elements are contained within simple
206
body elements. Most inline elements have a "mixed content model".
208
Category members: abbreviation_, acronym_, citation_reference_,
209
emphasis_, footnote_reference_, generated_, image_, inline_, literal_,
210
problematic_, reference_, strong_, subscript_,
211
substitution_reference_, superscript_, target_, title_reference_, raw_
214
.. _HTML: http://www.w3.org/MarkUp/
215
.. _DocBook: http://docbook.org/tdg/en/html/docbook.html
216
.. _XMLSpec: http://www.w3.org/XML/1998/06/xmlspec-report.htm
223
.. contents:: :local:
226
Each element in the DTD (document type definition) is described in its
227
own section below. Each section contains an introduction plus the
228
following subsections:
230
* Details (of element relationships and semantics):
232
- Category: One or more references to the element categories in
233
`Element Hierarchy`_ above. Some elements belong to more than one
236
- Parents: A list of elements which may contain the element.
238
- Children: A list of elements which may occur within the element.
240
- Analogues: Describes analogous elements in well-known document
241
models such as HTML_ or DocBook_. Lists similarities and
244
- Processing: Lists formatting or rendering recommendations for the
249
The formal XML content model from the `Docutils DTD`_, followed by:
251
- Attributes: Describes (or refers to descriptions of) the possible
252
values and semantics of each attribute.
254
- Parameter Entities: Lists the parameter entities which directly or
255
indirectly include the element.
257
* Examples: reStructuredText_ examples are shown along with
258
fragments of the document trees resulting from parsing.
259
_`Pseudo-XML` is used for the results of parsing and processing.
260
Pseudo-XML is a representation of XML where nesting is indicated by
261
indentation and end-tags are not shown. Some of the precision of
262
real XML is given up in exchange for easier readability. For
263
example, the following are equivalent:
268
<section ids="a-title" names="a title">
269
<title>A Title</title>
270
<paragraph>A paragraph.</paragraph>
277
<section ids="a-title" names="a title">
285
Many of the element reference sections below are marked "_`to be
286
completed`". Please help complete this document by contributing to
305
The ``address`` element holds the surface mailing address information
306
for the author (individual or group) of the document, or a third-party
307
contact address. Its structure is identical to that of the
308
literal_block_ element: whitespace is significant, especially
316
`Bibliographic Elements`_
319
The following elements may contain ``address``: docinfo_, authors_
322
``address`` elements contain text data plus `inline elements`_.
325
``address`` is analogous to the DocBook "address" element.
328
As with the literal_block_ element, newlines and other whitespace
329
is significant and must be preserved. However, a monospaced
330
typeface need not be used.
343
The ``address`` element contains the `common attributes`_ (ids_,
344
names_, dupnames_, source_, and classes_), plus `xml:space`_.
347
The `%bibliographic.elements;`_ parameter entity directly includes
354
reStructuredText_ source::
359
:Address: 123 Example Ave.
362
Complete pseudo-XML_ result after parsing and applying transforms::
364
<document ids="document-title" names="document title">
372
See docinfo_ for a more complete example, including processing
379
This element is a generic, titled admonition. Also see the specific
380
admonition elements Docutils offers (in alphabetical order): caution_,
381
danger_, error_, hint_, important_, note_, tip_, warning_.
388
`Compound Body Elements`_
391
All elements employing the `%body.elements;`_ or
392
`%structure.model;`_ parameter entities in their content models
393
may contain ``admonition``.
396
``admonition`` elements begin with a title_ and may contain one or
397
more `body elements`_.
400
``admonition`` has no direct analogues in common DTDs. It can be
401
emulated with primitives and type effects.
404
Rendered distinctly (inset and/or in a box, etc.).
412
(title_, (`%body.elements;`_)+)
415
The ``admonition`` element contains only the `common attributes`_:
416
ids_, names_, dupnames_, source_, and classes_.
419
The `%body.elements;`_ parameter entity directly includes
420
``admonition``. The `%structure.model;`_ parameter entity
421
indirectly includes ``admonition``.
427
reStructuredText source::
429
.. admonition:: And, by the way...
431
You can make up your own admonition too.
433
Pseudo-XML_ fragment from simple parsing::
435
<admonition class="admonition-and-by-the-way">
439
You can make up your own admonition too.
445
The ``attention`` element is an admonition, a distinctive and
446
self-contained notice. Also see the other admonition elements
447
Docutils offers (in alphabetical order): caution_, danger_, error_,
448
hint_, important_, note_, tip_, warning_, and the generic admonition_.
455
`Compound Body Elements`_
458
All elements employing the `%body.elements;`_ or
459
`%structure.model;`_ parameter entities in their content models
460
may contain ``attention``.
463
``attention`` elements contain one or more `body elements`_.
466
``attention`` has no direct analogues in common DTDs. It can be
467
emulated with primitives and type effects.
470
Rendered distinctly (inset and/or in a box, etc.), with the
471
generated title "Attention!" (or similar).
479
(`%body.elements;`_)+
482
The ``attention`` element contains only the `common attributes`_:
483
ids_, names_, dupnames_, source_, and classes_.
486
The `%body.elements;`_ parameter entity directly includes
487
``attention``. The `%structure.model;`_ parameter entity
488
indirectly includes ``attention``.
494
reStructuredText source::
496
.. Attention:: All your base are belong to us.
498
Pseudo-XML_ fragment from simple parsing::
502
All your base are belong to us.
514
The ``author`` element holds the name of the author of the document.
521
`Bibliographic Elements`_
524
The following elements may contain ``author``: docinfo_, authors_
527
``author`` elements may contain text data plus `inline elements`_.
530
``author`` is analogous to the DocBook "author" element.
544
The ``author`` element contains only the `common attributes`_:
545
ids_, names_, dupnames_, source_, and classes_.
548
The `%bibliographic.elements;`_ parameter entity directly includes
555
reStructuredText_ source::
560
:Author: J. Random Hacker
562
Complete pseudo-XML_ result after parsing and applying transforms::
564
<document ids="document-title" names="document title">
571
See docinfo_ for a more complete example, including processing
578
The ``authors`` element is a container for author information for
579
documents with multiple authors.
586
`Bibliographic Elements`_
589
Only the docinfo_ element contains ``authors``.
592
``authors`` elements may contain the following elements: author_,
593
organization_, address_, contact_
596
``authors`` is analogous to the DocBook "authors" element.
607
((author_, organization_?, address_?, contact_?)+)
610
The ``authors`` element contains only the `common attributes`_:
611
ids_, names_, dupnames_, source_, and classes_.
614
The `%bibliographic.elements;`_ parameter entity directly includes
621
reStructuredText_ source::
626
:Authors: J. Random Hacker; Jane Doe
628
Complete pseudo-XML_ result after parsing and applying transforms::
630
<document ids="document-title" names="document title">
640
In reStructuredText, multiple author's names are separated with
641
semicolons (";") or commas (","); semicolons take precedence. There
642
is currently no way to represent the author's organization, address,
643
or contact in a reStructuredText "Authors" field.
645
See docinfo_ for a more complete example, including processing
652
The ``block_quote`` element is used for quotations set off from the
653
main text (standalone).
660
`Compound Body Elements`_
663
All elements employing the `%body.elements;`_ or
664
`%structure.model;`_ parameter entities in their content models
665
may contain ``block_quote``.
668
``block_quote`` elements contain `body elements`_ followed by an
669
optional attribution_ element.
672
``block_quote`` is analogous to the "blockquote" element in both
676
``block_quote`` elements serve to set their contents off from the
677
main text, typically with indentation and/or other decoration.
685
((`%body.elements;`_)+, attribution_?)
688
The ``block_quote`` element contains only the `common
689
attributes`_: ids_, names_, dupnames_, source_, and classes_.
692
The `%body.elements;`_ parameter entity directly includes
693
``block_quote``. The `%structure.model;`_ parameter entity
694
indirectly includes ``block_quote``.
700
reStructuredText source::
702
As a great paleontologist once said,
704
This theory, that is mine, is mine.
708
Pseudo-XML_ fragment from simple parsing::
711
As a great paleontologist once said,
714
This theory, that is mine, is mine.
722
The ``bullet_list`` element contains list_item_ elements which are
723
uniformly marked with bullets. Bullets are typically simple dingbats
724
(symbols) such as circles and squares.
731
`Compound Body Elements`_
734
All elements employing the `%body.elements;`_ or
735
`%structure.model;`_ parameter entities in their content models
736
may contain ``bullet_list``.
739
``bullet_list`` elements contain one or more list_item_ elements.
742
``bullet_list`` is analogous to the HTML "ul" element and to the
743
DocBook "itemizedlist" element. HTML's "ul" is short for
744
"unordered list", which we consider to be a misnomer. "Unordered"
745
implies that the list items may be randomly rearranged without
746
affecting the meaning of the list. Bullet lists *are* often
747
ordered; the ordering is simply left implicit.
750
Each list item should begin a new vertical block, prefaced by a
762
The ``bullet_list`` element contains the `common attributes`_
763
(ids_, names_, dupnames_, source_, and classes_), plus bullet_.
765
``bullet`` is used to record the style of bullet from the input
766
data. In documents processed from reStructuredText_, it contains
767
one of "-", "+", or "*". It may be ignored in processing.
770
The `%body.elements;`_ parameter entity directly includes
771
``bullet_list``. The `%structure.model;`_ parameter entity
772
indirectly includes ``bullet_list``.
778
reStructuredText_ source::
780
- Item 1, paragraph 1.
786
Pseudo-XML_ fragment from simple parsing::
788
<bullet_list bullet="-">
798
See list_item_ for another example.
810
The ``caution`` element is an admonition, a distinctive and
811
self-contained notice. Also see the other admonition elements
812
Docutils offers (in alphabetical order): attention_, danger_, error_,
813
hint_, important_, note_, tip_, warning_, and the generic admonition_.
820
`Compound Body Elements`_
823
All elements employing the `%body.elements;`_ or
824
`%structure.model;`_ parameter entities in their content models
825
may contain ``caution``.
828
``caution`` elements contain one or more `body elements`_.
831
``caution`` is analogous to the DocBook "caution" element.
834
Rendered distinctly (inset and/or in a box, etc.), with the
835
generated title "Caution" (or similar).
843
(`%body.elements;`_)+
846
The ``caution`` element contains only the `common attributes`_:
847
ids_, names_, dupnames_, source_, and classes_.
850
The `%body.elements;`_ parameter entity directly includes
851
``caution``. The `%structure.model;`_ parameter entity
852
indirectly includes ``caution``.
858
reStructuredText source::
860
.. Caution:: Don't take any wooden nickels.
862
Pseudo-XML_ fragment from simple parsing::
866
Don't take any wooden nickels.
875
``citation_reference``
876
======================
884
The ``classifier`` element contains the classification or type of the
885
term_ being defined in a definition_list_. For example, it can be
886
used to indicate the type of a variable.
893
`Body Subelements`_ (simple)
896
Only the definition_list_item_ element contains ``classifier``.
899
``classifier`` elements may contain text data plus `inline elements`_.
902
``classifier`` has no direct analogues in common DTDs. It can be
903
emulated with primitives or type effects.
906
See definition_list_item_.
917
The ``classifier`` element contains only the `common attributes`_:
918
ids_, names_, dupnames_, source_, and classes_.
924
Here is a hypothetical data dictionary. reStructuredText_ source::
929
Temporary index variable.
931
Pseudo-XML_ fragment from simple parsing::
934
<definition_list_item>
942
<definition_list_item>
949
Temporary index variable.
973
The ``contact`` element holds contact information for the author
974
(individual or group) of the document, or a third-party contact. It
975
is typically used for an email or web address.
982
`Bibliographic Elements`_
985
The following elements may contain ``contact``: docinfo_, authors_
988
``contact`` elements may contain text data plus `inline
992
``contact`` is analogous to the DocBook "email" element. The HTML
993
"address" element serves a similar purpose.
1007
The ``contact`` element contains only the `common attributes`_:
1008
ids_, names_, dupnames_, source_, and classes_.
1010
:Parameter Entities:
1011
The `%bibliographic.elements;`_ parameter entity directly includes
1018
reStructuredText_ source::
1023
:Contact: jrh@example.com
1025
Complete pseudo-XML_ result after parsing and applying transforms::
1027
<document ids="document-title" names="document title">
1032
<reference refuri="mailto:jrh@example.com">
1035
See docinfo_ for a more complete example, including processing
1048
The ``copyright`` element contains the document's copyright statement.
1055
`Bibliographic Elements`_
1058
Only the docinfo_ element contains ``copyright``.
1061
``copyright`` elements may contain text data plus `inline
1065
``copyright`` is analogous to the DocBook "copyright" element.
1079
The ``copyright`` element contains only the `common attributes`_:
1080
ids_, names_, dupnames_, source_, and classes_.
1082
:Parameter Entities:
1083
The `%bibliographic.elements;`_ parameter entity directly includes
1090
reStructuredText_ source::
1095
:Copyright: This document has been placed in the public domain.
1097
Complete pseudo-XML_ result after parsing and applying transforms::
1099
<document ids="document-title" names="document title">
1104
This document has been placed in the public domain.
1106
See docinfo_ for a more complete example, including processing
1113
The ``danger`` element is an admonition, a distinctive and
1114
self-contained notice. Also see the other admonition elements
1115
Docutils offers (in alphabetical order): attention_, caution_, error_,
1116
hint_, important_, note_, tip_, warning_, and the generic admonition_.
1123
`Compound Body Elements`_
1126
All elements employing the `%body.elements;`_ or
1127
`%structure.model;`_ parameter entities in their content models
1128
may contain ``danger``.
1131
``danger`` elements contain one or more `body elements`_.
1134
``danger`` has no direct analogues in common DTDs. It can be
1135
emulated with primitives and type effects.
1138
Rendered distinctly (inset and/or in a box, etc.), with the
1139
generated title "!DANGER!" (or similar).
1147
(`%body.elements;`_)+
1150
The ``danger`` element contains only the `common attributes`_:
1151
ids_, names_, dupnames_, source_, and classes_.
1153
:Parameter Entities:
1154
The `%body.elements;`_ parameter entity directly includes
1155
``danger``. The `%structure.model;`_ parameter entity
1156
indirectly includes ``danger``.
1162
reStructuredText source::
1164
.. DANGER:: Mad scientist at work!
1166
Pseudo-XML_ fragment from simple parsing::
1170
Mad scientist at work!
1176
The ``date`` element contains the date of publication, release, or
1177
last modification of the document.
1184
`Bibliographic Elements`_
1187
Only the docinfo_ element contains ``date``.
1190
``date`` elements may contain text data plus `inline elements`_.
1193
``date`` is analogous to the DocBook "date" element.
1196
Often used with the RCS/CVS keyword "Date". See docinfo_.
1207
The ``date`` element contains only the `common attributes`_:
1208
ids_, names_, dupnames_, source_, and classes_.
1210
:Parameter Entities:
1211
The `%bibliographic.elements;`_ parameter entity directly includes
1218
reStructuredText_ source::
1225
Complete pseudo-XML_ result after parsing and applying transforms::
1227
<document ids="document-title" names="document title">
1234
See docinfo_ for a more complete example, including processing
1241
The ``decoration`` element is a container for header_ and footer_
1242
elements and potential future extensions. These elements are used for
1243
notes, time/datestamp, processing information, etc.
1250
`Structural Subelements`_
1253
Only the document_ element contains ``decoration``.
1256
``decoration`` elements may contain `decorative elements`_.
1259
There are no direct analogies to ``decoration`` in HTML or in
1260
DocBook. Equivalents are typically constructed from primitives
1261
and/or generated by the processing system.
1264
See the individual `decorative elements`_.
1272
(header_?, footer_?)
1274
Although the content model doesn't specifically require contents, no
1275
empty ``decoration`` elements are ever created.
1278
The ``decoration`` element contains only the `common attributes`_:
1279
ids_, names_, dupnames_, source_, and classes_.
1285
reStructuredText_ source::
1289
Complete pseudo-XML_ result after parsing and applying transforms,
1290
assuming that the datestamp command-line option or configuration
1291
setting has been supplied::
1297
Generated on: 2002-08-20.
1305
The ``definition`` element is a container for the body elements used
1306
to define a term_ in a definition_list_.
1313
`Body Subelements`_ (compound)
1316
Only definition_list_item_ elements contain ``definition``.
1319
``definition`` elements may contain `body elements`_.
1322
``definition`` is analogous to the HTML "dd" element and to the
1323
DocBook "listitem" element (inside a "variablelistentry" element).
1326
See definition_list_item_.
1334
(`%body.elements;`_)+
1337
The ``definition`` element contains only the `common attributes`_:
1338
ids_, names_, dupnames_, source_, and classes_.
1344
See the examples for the definition_list_, definition_list_item_, and
1345
classifier_ elements.
1351
The ``definition_list`` element contains a list of terms and their
1352
definitions. It can be used for glossaries or dictionaries, to
1353
describe or classify things, for dialogues, or to itemize subtopics
1354
(such as in this reference).
1361
`Compound Body Elements`_
1364
All elements employing the `%body.elements;`_ or
1365
`%structure.model;`_ parameter entities in their content models
1366
may contain ``definition_list``.
1369
``definition_list`` elements contain one or more
1370
definition_list_item_ elements.
1373
``definition_list`` is analogous to the HTML "dl" element and to
1374
the DocBook "variablelist" element.
1377
See definition_list_item_.
1385
(definition_list_item_ +)
1388
The ``definition_list`` element contains only the `common
1389
attributes`_: ids_, names_, dupnames_, source_, and classes_.
1391
:Parameter Entities:
1392
The `%body.elements;`_ parameter entity directly includes
1393
``definition_list``. The `%structure.model;`_ parameter entity
1394
indirectly includes ``definition_list``.
1400
reStructuredText_ source::
1406
The ' : ' indicates a classifier in
1407
definition list item terms only.
1409
Pseudo-XML_ fragment from simple parsing::
1412
<definition_list_item>
1418
<definition_list_item>
1425
The ' : ' indicates a classifier in
1426
definition list item terms only.
1428
See definition_list_item_ and classifier_ for further examples.
1431
``definition_list_item``
1432
========================
1434
The ``definition_list_item`` element contains a single
1435
term_/definition_ pair (with optional classifier_).
1442
`Body Subelements`_ (compound)
1445
Only the definition_list_ element contains
1446
``definition_list_item``.
1449
``definition_list_item`` elements each contain a single term_,
1450
an optional classifier_, and a definition_.
1453
``definition_list_item`` is analogous to the DocBook
1454
"variablelistentry" element.
1457
The optional classifier_ can be rendered differently from the
1458
term_. They should be separated visually, typically by spaces
1459
plus a colon or dash.
1467
(term_, classifier_?, definition_)
1470
The ``definition_list_item`` element contains only the `common
1471
attributes`_: ids_, names_, dupnames_, source_, and classes_.
1477
reStructuredText_ source::
1479
Tyrannosaurus Rex : carnivore
1480
Big and scary; the "Tyrant King".
1482
Brontosaurus : herbivore
1483
All brontosauruses are thin at one end,
1484
much much thicker in the middle
1485
and then thin again at the far end.
1489
Pseudo-XML_ fragment from simple parsing::
1492
<definition_list_item>
1499
Big and scary; the "Tyrant King".
1500
<definition_list_item>
1507
All brontosauruses are thin at one end,
1508
much much thicker in the middle
1509
and then thin again at the far end.
1513
See definition_list_ and classifier_ for further examples.
1519
The ``description`` element contains body elements, describing the
1520
purpose or effect of a command-line option or group of options.
1530
Only the option_list_item_ element contains ``description``.
1533
``description`` elements may contain `body elements`_.
1536
``description`` has no direct analogues in common DTDs.
1547
(`%body.elements;`_)+
1550
The ``description`` element contains only the `common attributes`_:
1551
ids_, names_, dupnames_, source_, and classes_.
1557
See the examples for the option_list_ element.
1563
The ``docinfo`` element is a container for document bibliographic
1564
data, or meta-data (data about the document). It corresponds to the
1565
front matter of a book, such as the title page and copyright page.
1572
`Structural Subelements`_
1575
Only the document_ element contains ``docinfo``.
1578
``docinfo`` elements contain `bibliographic elements`_.
1581
``docinfo`` is analogous to DocBook "info" elements ("bookinfo"
1582
etc.). There are no directly analogous HTML elements; the "meta"
1583
element carries some of the same information, albeit invisibly.
1586
The ``docinfo`` element may be rendered as a two-column table or
1587
in other styles. It may even be invisible or omitted from the
1588
processed output. Meta-data may be extracted from ``docinfo``
1589
children; for example, HTML ``<meta>`` tags may be constructed.
1591
When Docutils_ transforms a reStructuredText_ field_list_ into a
1592
``docinfo`` element (see the examples below), RCS/CVS keywords are
1593
normally stripped from simple (one paragraph) field bodies. For
1594
complete details, please see `RCS Keywords`_ in the
1595
`reStructuredText Markup Specification`_.
1597
.. _RCS Keywords: rst/restructuredtext.html#rcs-keywords
1605
(`%bibliographic.elements;`_)+
1608
The ``docinfo`` element contains only the `common attributes`_:
1609
ids_, names_, dupnames_, source_, and classes_.
1615
Docinfo is represented in reStructuredText_ by a field_list_ in a
1616
bibliographic context: the first non-comment element of a document_,
1617
after any document title_/subtitle_. The field list is transformed
1618
into a ``docinfo`` element and its children by a transform. Source::
1623
:Author: J. Random Hacker
1624
:Contact: jrh@example.com
1626
:Status: Work In Progress
1628
:Filename: $RCSfile$
1629
:Copyright: This document has been placed in the public domain.
1631
Complete pseudo-XML_ result after parsing and applying transforms::
1633
<document ids="docinfo-example" names="docinfo example">
1640
<reference refuri="mailto:jrh@example.com">
1655
This document has been placed in the public domain.
1657
Note that "Filename" is a non-standard ``docinfo`` field, so becomes a
1658
generic ``field`` element. Also note that the "RCSfile" keyword
1659
syntax has been stripped from the "Filename" data.
1661
See field_list_ for an example in a non-bibliographic context. Also
1662
see the individual examples for the various `bibliographic elements`_.
1668
The ``doctest_block`` element is a Python-specific variant of
1669
literal_block_. It is a block of text where line breaks and
1670
whitespace are significant and must be preserved. ``doctest_block``
1671
elements are used for interactive Python interpreter sessions, which
1672
are distinguished by their input prompt: ``>>>``. They are meant to
1673
illustrate usage by example, and provide an elegant and powerful
1674
testing environment via the `doctest module`_ in the Python standard
1678
http://www.python.org/doc/current/lib/module-doctest.html
1685
`Simple Body Elements`_
1688
All elements employing the `%body.elements;`_ or
1689
`%structure.model;`_ parameter entities in their content models
1690
may contain ``doctest_block``.
1693
``doctest_block`` elements may contain text data plus `inline
1697
``doctest_block`` is analogous to the HTML "pre" element and to
1698
the DocBook "programlisting" and "screen" elements.
1701
As with literal_block_, ``doctest_block`` elements are typically
1702
rendered in a monospaced typeface. It is crucial that all
1703
whitespace and line breaks are preserved in the rendered form.
1714
The ``doctest_block`` element contains the `common attributes`_
1715
(ids_, names_, dupnames_, source_, and classes_), plus `xml:space`_.
1717
:Parameter Entities:
1718
The `%body.elements;`_ parameter entity directly includes
1719
``doctest_block``. The `%structure.model;`_ parameter entity
1720
indirectly includes ``doctest_block``.
1726
reStructuredText source::
1728
This is an ordinary paragraph.
1730
>>> print 'this is a Doctest block'
1731
this is a Doctest block
1733
Pseudo-XML_ fragment from simple parsing::
1736
This is an ordinary paragraph.
1737
<doctest_block xml:space="preserve">
1738
>>> print 'this is a Doctest block'
1739
this is a Doctest block
1745
The ``document`` element is the root (topmost) element of the Docutils
1746
document tree. ``document`` is the direct or indirect ancestor of
1747
every other element in the tree. It encloses the entire document
1748
tree. It is the starting point for a document.
1755
`Structural Elements`_
1758
The ``document`` element has no parents.
1761
``document`` elements may contain `structural subelements`_,
1762
`structural elements`_, and `body elements`_.
1765
``document`` is analogous to the HTML "html" element and to
1766
several DocBook elements such as "book".
1774
( (title_, subtitle_?)?,
1776
(docinfo_, transition_?)?,
1777
`%structure.model;`_ )
1779
Depending on the source of the data and the stage of processing, the
1780
"document" may not initially contain a "title". A document title is
1781
not directly representable in reStructuredText_. Instead, a lone
1782
top-level section may have its title promoted to become the document
1783
title_, and similarly for a lone second-level (sub)section's title to
1784
become the document subtitle_.
1786
The contents of "decoration_" may be specified in a document,
1787
constructed programmatically, or both. The "docinfo_" may be
1788
transformed from an initial field_list_.
1790
See the `%structure.model;`_ parameter entity for details of the body
1794
The ``document`` element contains the `common attributes`_ (ids_,
1795
names_, dupnames_, source_, and classes_), plus an optional title__
1796
attribute which stores the document title metadata.
1798
__ `title (attribute)`_
1804
reStructuredText_ source::
1811
Complete pseudo-XML_ result from simple parsing::
1814
<section ids="a-title" names="a title">
1820
After applying transforms, the section title is promoted to become the
1823
<document ids="a-title" names="a title">
1845
The ``enumerated_list`` element contains list_item_ elements which are
1846
uniformly marked with enumerator labels.
1853
`Compound Body Elements`_
1856
All elements employing the `%body.elements;`_ or
1857
`%structure.model;`_ parameter entities in their content models
1858
may contain ``enumerated_list``.
1861
``enumerated_list`` elements contain one or more list_item_
1865
``enumerated_list`` is analogous to the HTML "ol" element and to
1866
the DocBook "orderedlist" element.
1869
Each list item should begin a new vertical block, prefaced by a
1870
enumeration marker (such as "1.").
1881
The ``enumerated_list`` element contains the `common attributes`_
1882
(ids_, names_, dupnames_, source_, and classes_), plus enumtype_,
1883
prefix_, suffix_, and start_.
1885
``enumtype`` is used to record the intended enumeration sequence,
1886
one of "arabic" (1, 2, 3, ...), "loweralpha" (a, b, c, ..., z),
1887
"upperalpha" (A, B, C, ..., Z), "lowerroman" (i, ii, iii, iv, ...,
1888
mmmmcmxcix [4999]), or "upperroman" (I, II, III, IV, ...,
1891
``prefix`` stores the formatting characters used before the
1892
enumerator. In documents originating from reStructuredText_ data,
1893
it will contain either "" (empty string) or "(" (left
1894
parenthesis). It may or may not affect processing.
1896
``suffix`` stores the formatting characters used after the
1897
enumerator. In documents originating from reStructuredText_ data,
1898
it will contain either "." (period) or ")" (right parenthesis).
1899
Depending on the capabilities of the output format, this attribute
1900
may or may not affect processing.
1902
``start`` contains the ordinal value of the first item in the
1903
list, in decimal. For lists beginning at value 1 ("1", "a", "A",
1904
"i", or "I"), this attribute may be omitted.
1906
:Parameter Entities:
1907
The `%body.elements;`_ parameter entity directly includes
1908
``enumerated_list``. The `%structure.model;`_ parameter entity
1909
indirectly includes ``enumerated_list``.
1915
reStructuredText_ source::
1925
Pseudo-XML_ fragment from simple parsing::
1927
<enumerated_list enumtype="arabic" prefix="" suffix=".">
1931
<enumerated_list enumtype="upperalpha" prefix="(" suffix=")">
1945
See list_item_ for another example.
1951
The ``error`` element is an admonition, a distinctive and
1952
self-contained notice. Also see the other admonition elements
1953
Docutils offers (in alphabetical order): attention_, caution_,
1954
danger_, hint_, important_, note_, tip_, warning_, and the generic
1962
`Compound Body Elements`_
1965
All elements employing the `%body.elements;`_ or
1966
`%structure.model;`_ parameter entities in their content models
1967
may contain ``error``.
1970
``error`` elements contain one or more `body elements`_.
1973
``error`` has no direct analogues in common DTDs. It can be
1974
emulated with primitives and type effects.
1977
Rendered distinctly (inset and/or in a box, etc.), with the
1978
generated title "Error" (or similar).
1986
(`%body.elements;`_)+
1989
The ``error`` element contains only the `common attributes`_: ids_,
1990
names_, dupnames_, source_, and classes_.
1992
:Parameter Entities:
1993
The `%body.elements;`_ parameter entity directly includes
1994
``error``. The `%structure.model;`_ parameter entity indirectly
2001
reStructuredText source::
2003
.. Error:: Does not compute.
2005
Pseudo-XML_ fragment from simple parsing::
2015
The ``field`` element contains a pair of field_name_ and field_body_
2026
The following elements may contain ``field``: docinfo_,
2030
Each ``field`` element contains one field_name_ and one
2031
field_body_ element.
2034
``field`` has no direct analogues in common DTDs.
2045
(field_name_, field_body_)
2048
The ``field`` element contains only the `common attributes`_:
2049
ids_, names_, dupnames_, source_, and classes_.
2051
:Parameter Entities:
2052
The `%bibliographic.elements;`_ parameter entity directly includes
2059
See the examples for the field_list_ and docinfo_ elements.
2065
The ``field_body`` element contains body elements. It is analogous to
2066
a database field's data.
2076
Only the field_ element contains ``field_body``.
2079
``field_body`` elements may contain `body elements`_.
2082
``field_body`` has no direct analogues in common DTDs.
2093
(`%body.elements;`_)*
2096
The ``field_body`` element contains only the `common attributes`_:
2097
ids_, names_, dupnames_, source_, and classes_.
2103
See the examples for the field_list_ and docinfo_ elements.
2109
The ``field_list`` element contains two-column table-like structures
2110
resembling database records (label & data pairs). Field lists are
2111
often meant for further processing. In reStructuredText_, field lists
2112
are used to represent bibliographic fields (contents of the docinfo_
2113
element) and directive options.
2120
`Compound Body Elements`_
2123
All elements employing the `%body.elements;`_ or
2124
`%structure.model;`_ parameter entities in their content models
2125
may contain ``field_list``.
2128
``field_list`` elements contain one or more field_ elements.
2131
``field_list`` has no direct analogues in common DTDs. It can be
2132
emulated with primitives such as tables.
2135
A ``field_list`` is typically rendered as a two-column list, where
2136
the first column contains "labels" (usually with a colon suffix).
2137
However, field lists are often used for extension syntax or
2138
special processing. Such structures do not survive as field lists
2150
The ``field_list`` element contains only the `common attributes`_:
2151
ids_, names_, dupnames_, source_, and classes_.
2153
:Parameter Entities:
2154
The `%body.elements;`_ parameter entity directly includes
2155
``field_list``. The `%structure.model;`_ parameter entity
2156
indirectly includes ``field_list``.
2162
reStructuredText_ source::
2167
:Parameter i: integer
2169
Pseudo-XML_ fragment from simple parsing::
2201
The ``field_name`` element contains text; it is analogous to a
2202
database field's name.
2209
`Body Subelements`_ (simple)
2212
Only the field_ element contains ``field_name``.
2215
``field_name`` elements may contain text data plus `inline elements`_.
2218
``field_name`` has no direct analogues in common DTDs.
2232
The ``field_name`` element contains only the `common attributes`_:
2233
ids_, names_, dupnames_, source_, and classes_.
2239
See the examples for the field_list_ and docinfo_ elements.
2251
The ``footer`` element is a container element whose contents are meant
2252
to appear at the bottom of a web page, or repeated at the bottom of
2253
every printed page. The ``footer`` element may contain processing
2254
information (datestamp, a link to Docutils_, etc.) as well as custom
2262
`Decorative Elements`_
2265
Only the decoration_ element contains ``footer``.
2268
``footer`` elements may contain `body elements`_.
2271
There are no direct analogies to ``footer`` in HTML or DocBook.
2272
Equivalents are typically constructed from primitives and/or
2273
generated by the processing system.
2281
(`%body.elements;`_)+
2284
The ``footer`` element contains only the `common attributes`_:
2285
ids_, names_, dupnames_, source_, and classes_.
2291
reStructuredText_ source::
2295
Complete pseudo-XML_ result after parsing and applying transforms,
2296
assuming that the datestamp command-line option or configuration
2297
setting has been supplied::
2303
Generated on: 2002-08-20.
2314
``footnote_reference``
2315
======================
2323
Docutils wraps ``generated`` elements around text that is inserted
2324
(generated) by Docutils; i.e., text that was not in the document, like
2325
section numbers inserted by the "sectnum" directive.
2333
The ``header`` element is a container element whose contents are meant
2334
to appear at the top of a web page, or at the top of every printed
2342
`Decorative Elements`_
2345
Only the decoration_ element contains ``header``.
2348
``header`` elements may contain `body elements`_.
2351
There are no direct analogies to ``header`` in HTML or DocBook.
2352
Equivalents are typically constructed from primitives and/or
2353
generated by the processing system.
2361
(`%body.elements;`_)+
2364
The ``header`` element contains only the `common attributes`_:
2365
ids_, names_, dupnames_, source_, and classes_.
2371
reStructuredText source fragment::
2373
.. header:: This space for rent.
2375
Pseudo-XML_ fragment from simple parsing::
2381
This space for rent.
2387
The ``hint`` element is an admonition, a distinctive and
2388
self-contained notice. Also see the other admonition elements
2389
Docutils offers (in alphabetical order): attention_, caution_,
2390
danger_, error_, important_, note_, tip_, warning_, and the generic
2398
`Compound Body Elements`_
2401
All elements employing the `%body.elements;`_ or
2402
`%structure.model;`_ parameter entities in their content models
2403
may contain ``hint``.
2406
``hint`` elements contain one or more `body elements`_.
2409
``hint`` has no direct analogues in common DTDs. It can be
2410
emulated with primitives and type effects.
2413
Rendered distinctly (inset and/or in a box, etc.), with the
2414
generated title "Hint" (or similar).
2422
(`%body.elements;`_)+
2425
The ``hint`` element contains only the `common attributes`_: ids_,
2426
names_, dupnames_, source_, and classes_.
2428
:Parameter Entities:
2429
The `%body.elements;`_ parameter entity directly includes
2430
``hint``. The `%structure.model;`_ parameter entity indirectly
2437
reStructuredText source::
2439
.. Hint:: It's bigger than a bread box.
2441
Pseudo-XML_ fragment from simple parsing::
2445
It's bigger than a bread box.
2457
The ``important`` element is an admonition, a distinctive and
2458
self-contained notice. Also see the other admonition elements
2459
Docutils offers (in alphabetical order): attention_, caution_,
2460
danger_, error_, hint_, note_, tip_, warning_, and the generic
2468
`Compound Body Elements`_
2471
All elements employing the `%body.elements;`_ or
2472
`%structure.model;`_ parameter entities in their content models
2473
may contain ``important``.
2476
``important`` elements contain one or more `body elements`_.
2479
``important`` is analogous to the DocBook "important" element.
2482
Rendered distinctly (inset and/or in a box, etc.), with the
2483
generated title "Important" (or similar).
2491
(`%body.elements;`_)+
2494
The ``important`` element contains only the `common attributes`_:
2495
ids_, names_, dupnames_, source_, and classes_.
2497
:Parameter Entities:
2498
The `%body.elements;`_ parameter entity directly includes
2499
``important``. The `%structure.model;`_ parameter entity
2500
indirectly includes ``important``.
2506
reStructuredText source::
2510
* Wash behind your ears.
2511
* Clean up your room.
2512
* Back up your data.
2515
Pseudo-XML_ fragment from simple parsing::
2521
Wash behind your ears.
2554
The ``line`` element contains a single line of text, part of a
2562
`Body Subelements`_ (simple)
2565
Only the `line_block`_ element contains ``line``.
2568
``line`` elements may contain text data plus `inline elements`_.
2571
``line`` has no direct analogues in common DTDs. It can be
2572
emulated with primitives or type effects.
2586
The ``line`` element contains the `common attributes`_ (ids_,
2587
names_, dupnames_, source_, and classes_), plus `xml:space`_.
2599
The ``line_block`` element contains a sequence of lines and nested
2600
line blocks. Line breaks (implied between elements) and leading
2601
whitespace (indicated by nesting) is significant and must be
2602
preserved. ``line_block`` elements are commonly used for verse and
2603
addresses. See `literal_block`_ for an alternative useful for program
2604
listings and interactive computer sessions.
2611
`Compound Body Elements`_
2614
All elements employing the `%body.elements;`_ or
2615
`%structure.model;`_ parameter entities in their content models
2616
may contain ``line_block``.
2619
``line_block`` elements may contain line_ elements and nested
2620
``line_block`` elements.
2623
``line_block`` is analogous to the DocBook "literallayout" element
2624
and to the HTML "pre" element (with modifications to typeface
2628
Unline ``literal_block``, ``line_block`` elements are typically
2629
rendered in an ordinary text typeface. It is crucial that leading
2630
whitespace and line breaks are preserved in the rendered form.
2638
(line_ | line_block_)+
2641
The ``line_block`` element contains the `common attributes`_ (ids_,
2642
names_, dupnames_, source_, and classes_), plus `xml:space`_.
2644
:Parameter Entities:
2645
The `%body.elements;`_ parameter entity directly includes
2646
``line_block``. The `%structure.model;`_ parameter entity
2647
indirectly includes ``line_block``.
2653
reStructuredText uses a directive to indicate a ``line_block``.
2656
Take it away, Eric the Orchestra Leader!
2658
| A one, two, a one two three four
2660
| Half a bee, philosophically,
2661
| must, *ipso facto*, half not be.
2662
| But half the bee has got to be,
2663
| *vis a vis* its entity. D'you see?
2665
| But can a bee be said to be
2666
| or not to be an entire bee,
2667
| when half the bee is not a bee,
2668
| due to some ancient injury?
2672
Pseudo-XML_ fragment from simple parsing::
2675
Take it away, Eric the Orchestra Leader!
2678
A one, two, a one two three four
2681
Half a bee, philosophically,
2689
But half the bee has got to be,
2694
its entity. D'you see?
2697
But can a bee be said to be
2700
or not to be an entire bee,
2703
when half the bee is not a bee,
2706
due to some ancient injury?
2715
The ``list_item`` element is a container for the elements of a list
2723
`Body Subelements`_ (compound)
2726
The bullet_list_ and enumerated_list_ elements contain
2730
``list_item`` elements may contain `body elements`_.
2733
``list_item`` is analogous to the HTML "li" element and to the
2734
DocBook "listitem" element.
2737
See bullet_list_ or enumerated_list_.
2745
(`%body.elements;`_)*
2748
The ``list_item`` element contains only the `common attributes`_:
2749
ids_, names_, dupnames_, source_, and classes_.
2755
reStructuredText_ source::
2757
1. Outer list, item 1.
2759
* Inner list, item 1.
2760
* Inner list, item 2.
2762
2. Outer list, item 2.
2764
Pseudo-XML_ fragment from simple parsing::
2766
<enumerated_list enumtype="arabic" prefix="" suffix=".">
2770
<bullet_list bullet="*">
2781
See bullet_list_ or enumerated_list_ for further examples.
2793
The ``literal_block`` element contains a block of text where line
2794
breaks and whitespace are significant and must be preserved.
2795
``literal_block`` elements are commonly used for program listings and
2796
interactive computer sessions. See `line_block`_ for an alternative
2797
useful for verse and addresses.
2804
`Simple Body Elements`_
2807
All elements employing the `%body.elements;`_ or
2808
`%structure.model;`_ parameter entities in their content models
2809
may contain ``literal_block``.
2812
``literal_block`` elements may contain text data plus `inline
2816
``literal_block`` is analogous to the HTML "pre" element and to
2817
the DocBook "programlisting" and "screen" elements.
2820
``literal_block`` elements are typically rendered in a monospaced
2821
typeface. It is crucial that all whitespace and line breaks are
2822
preserved in the rendered form.
2833
The ``literal_block`` element contains the `common attributes`_
2834
(ids_, names_, dupnames_, source_, and classes_), plus `xml:space`_.
2836
:Parameter Entities:
2837
The `%body.elements;`_ parameter entity directly includes
2838
``literal_block``. The `%structure.model;`_ parameter entity
2839
indirectly includes ``literal_block``.
2845
reStructuredText source::
2847
Here is a literal block::
2850
text = 'is left as-is'
2851
spaces_and_linebreaks = 'are preserved'
2852
markup_processing = None
2854
Pseudo-XML_ fragment from simple parsing::
2857
Here is a literal block:
2858
<literal_block xml:space="preserve">
2860
text = 'is left as-is'
2861
spaces_and_linebreaks = 'are preserved'
2862
markup_processing = None
2868
The ``note`` element is an admonition, a distinctive and
2869
self-contained notice. Also see the other admonition elements
2870
Docutils offers (in alphabetical order): attention_, caution_,
2871
danger_, error_, hint_, important_, tip_, warning_, and the generic
2879
`Compound Body Elements`_
2882
All elements employing the `%body.elements;`_ or
2883
`%structure.model;`_ parameter entities in their content models
2884
may contain ``note``.
2887
``note`` elements contain one or more `body elements`_.
2890
``note`` is analogous to the DocBook "note" element.
2893
Rendered distinctly (inset and/or in a box, etc.), with the
2894
generated title "Note" (or similar).
2902
(`%body.elements;`_)+
2905
The ``note`` element contains only the `common attributes`_: ids_,
2906
names_, dupnames_, source_, and classes_.
2908
:Parameter Entities:
2909
The `%body.elements;`_ parameter entity directly includes
2910
``note``. The `%structure.model;`_ parameter entity indirectly
2917
reStructuredText source::
2919
.. Note:: Admonitions can be handy to break up a
2920
long boring technical document.
2922
Pseudo-XML_ fragment from simple parsing::
2926
Admonitions can be handy to break up a
2927
long boring technical document.
2932
The ``option`` element groups an option string together with zero or
2933
more option argument placeholders. Note that reStructuredText_
2934
currently supports only one argument per option.
2944
Only the option_group_ element contains ``option``.
2947
Each ``option`` element contains one option_string_ and zero or
2948
more option_argument_ elements.
2951
``option`` has no direct analogues in common DTDs.
2962
(option_string_, option_argument_ \*)
2965
The ``option`` element contains only the `common attributes`_:
2966
ids_, names_, dupnames_, source_, and classes_.
2972
See the examples for the option_list_ element.
2978
The ``option_argument`` element contains placeholder text for option
2989
Only the option_ element contains ``option_argument``.
2992
``option_argument`` elements contain text data only.
2995
``option_argument`` has no direct analogues in common DTDs.
2998
The value of the "delimiter" attribute is prefixed to the
2999
``option_argument``, separating it from its option_string_ or a
3000
preceding ``option_argument``. The ``option_argument`` text is
3001
typically rendered in a monospaced typeface, possibly italicized
3002
or otherwise altered to indicate its placeholder nature.
3013
The ``option_argument`` element contains the `common attributes`_ (ids_,
3014
names_, dupnames_, source_, and classes_), plus delimiter_.
3016
``delimiter`` contains the text preceding the ``option_argument``:
3017
either the text separating it from the option_string_ (typically
3018
either "=" or " ") or the text between option arguments (typically
3025
See the examples for the option_list_ element.
3031
The ``option_group`` element groups together one or more option_
3032
elements, all synonyms.
3042
Only the option_list_item_ element contains ``option_group``.
3045
``option_group`` elements contain one or more option_ elements.
3047
``option_group`` is an empty element and has no children.
3049
Each ``option_group`` element contains one _ and
3053
``option_group`` has no direct analogues in common DTDs.
3056
Typically option_ elements within an ``option_group`` are joined
3057
together in a comma-separated list.
3065
(option_group_, description_)
3068
The ``option_group`` element contains only the `common attributes`_:
3069
ids_, names_, dupnames_, source_, and classes_.
3075
See the examples for the option_list_ element.
3081
Each ``option_list`` element contains a two-column list of
3082
command-line options and descriptions, documenting a program's
3090
`Compound Body Elements`_
3093
All elements employing the `%body.elements;`_ or
3094
`%structure.model;`_ parameter entities in their content models
3095
may contain ``option_list``.
3098
``option_list`` elements contain one or more option_list_item_
3102
``option_list`` has no direct analogues in common DTDs. It can be
3103
emulated with primitives such as tables.
3106
An ``option_list`` is typically rendered as a two-column list,
3107
where the first column contains option strings and arguments, and
3108
the second column contains descriptions.
3116
(option_list_item_ +)
3119
The ``option_list`` element contains only the `common attributes`_:
3120
ids_, names_, dupnames_, source_, and classes_.
3122
:Parameter Entities:
3123
The `%body.elements;`_ parameter entity directly includes
3124
``option_list``. The `%structure.model;`_ parameter entity
3125
indirectly includes ``option_list``.
3131
reStructuredText_ source::
3133
-a command-line option "a"
3134
-1 file, --one=file, --two file
3135
Multiple options with arguments.
3137
Pseudo-XML_ fragment from simple parsing::
3147
command-line option "a"
3153
<option_argument delimiter=" ">
3158
<option_argument delimiter="=">
3163
<option_argument delimiter=" ">
3167
Multiple options with arguments.
3170
``option_list_item``
3171
====================
3173
The ``option_list_item`` element is a container for a pair of
3174
option_group_ and description_ elements.
3184
Only the option_list_ element contains ``option_list_item``.
3187
Each ``option_list_item`` element contains one option_group_ and
3188
one description_ element.
3191
``option_list_item`` has no direct analogues in common DTDs.
3202
(option_group_, description_)
3205
The ``option_list_item`` element contains only the `common attributes`_:
3206
ids_, names_, dupnames_, source_, and classes_.
3212
See the examples for the option_list_ element.
3218
The ``option_string`` element contains the text of a command-line
3229
Only the option_ element contains ``option_string``.
3232
``option_string`` elements contain text data only.
3235
``option_string`` has no direct analogues in common DTDs.
3238
The ``option_string`` text is typically rendered in a monospaced
3250
The ``option_string`` element contains only the `common attributes`_:
3251
ids_, names_, dupnames_, source_, and classes_.
3257
See the examples for the option_list_ element.
3263
The ``organization`` element contains the name of document author's
3264
organization, or the organization responsible for the document.
3271
`Bibliographic Elements`_
3274
Only the docinfo_ element contains ``organization``.
3277
``organization`` elements may contain text data plus `inline
3281
``organization`` is analogous to the DocBook "orgname",
3282
"corpname", or "publishername" elements.
3296
The ``organization`` element contains only the `common attributes`_:
3297
ids_, names_, dupnames_, source_, and classes_.
3299
:Parameter Entities:
3300
The `%bibliographic.elements;`_ parameter entity directly includes
3307
reStructuredText_ source::
3312
:Organization: Humankind
3314
Complete pseudo-XML_ result after parsing and applying transforms::
3316
<document ids="document-title" names="document title">
3323
See docinfo_ for a more complete example, including processing
3330
The ``paragraph`` element contains the text and inline elements of a
3331
single paragraph, a fundamental building block of documents.
3338
`Simple Body Elements`_
3341
All elements employing the `%body.elements;`_ or
3342
`%structure.model;`_ parameter entities in their content models
3343
may contain ``paragraph``.
3346
``paragraph`` elements may contain text data plus `inline
3350
``paragraph`` is analogous to the HTML "p" element and to the
3351
DocBook "para" elements.
3362
The ``paragraph`` element contains only the `common attributes`_:
3363
ids_, names_, dupnames_, source_, and classes_.
3365
:Parameter Entities:
3366
The `%body.elements;`_ parameter entity directly includes
3367
``paragraph``. The `%structure.model;`_ parameter entity
3368
indirectly includes ``paragraph``.
3374
reStructuredText_ source::
3378
Pseudo-XML_ fragment from simple parsing::
3411
The ``revision`` element contains the revision number of the document.
3412
It can be used alone or in conjunction with version_.
3419
`Bibliographic Elements`_
3422
Only the docinfo_ element contains ``revision``.
3425
``revision`` elements may contain text data plus `inline
3429
``revision`` is analogous to but simpler than the DocBook
3430
"revision" element. It closely matches the DocBook "revnumber"
3431
element, but in a simpler context.
3434
Often used with the RCS/CVS keyword "Revision". See docinfo_.
3445
The ``revision`` element contains only the `common attributes`_:
3446
ids_, names_, dupnames_, source_, and classes_.
3448
:Parameter Entities:
3449
The `%bibliographic.elements;`_ parameter entity directly includes
3456
reStructuredText_ source::
3464
Complete pseudo-XML_ result after parsing and applying transforms::
3466
<document ids="document-title" names="document title">
3475
See docinfo_ for a more complete example, including processing
3488
rubric n. 1. a title, heading, or the like, in a manuscript,
3489
book, statute, etc., written or printed in red or otherwise
3490
distinguished from the rest of the text. ...
3492
-- Random House Webster's College Dictionary, 1991
3494
A rubric is like an informal heading that doesn't correspond to the
3495
document's structure.
3503
The ``section`` element is the main unit of hierarchy for Docutils
3504
documents. Docutils ``section`` elements are a recursive structure; a
3505
``section`` may contain other ``section`` elements, without limit.
3506
Paragraphs and other body elements may occur before a ``section``, but
3514
`Structural Elements`_
3517
The following elements may contain ``section``: document_,
3521
``section`` elements begin with a title_, and may contain `body
3522
elements`_ as well as transition_, topic_, and sidebar_ elements.
3525
``section`` is analogous to DocBook recursive "section" elements,
3526
and to HTML "div" elements combined with "h1" etc. title elements.
3535
`%structure.model;`_)
3537
See the `%structure.model;`_ parameter entity for details of the body
3541
The ``section`` element contains only the `common attributes`_:
3542
ids_, names_, dupnames_, source_, and classes_.
3544
:Parameter Entities:
3545
The `%section.elements;`_ parameter entity directly includes
3546
``section``. The `%structure.model;`_ parameter entity indirectly
3547
includes ``section``.
3553
reStructuredText_ source::
3571
Complete pseudo-XML_ result after parsing::
3574
<section ids="title-1" names="title 1">
3579
<section ids="title-2" names="title 2">
3584
<section ids="title-3" names="title 3">
3589
<section ids="title-4" names="title 4">
3599
Sidebars are like miniature, parallel documents that occur inside
3600
other documents, providing related or reference material. A
3601
``sidebar`` is typically offset by a border and "floats" to the side
3602
of the page; the document's main text may flow around it. Sidebars
3603
can also be likened to super-footnotes; their content is outside of
3604
the flow of the document's main text.
3606
The ``sidebar`` element is a nonrecursive section_-like construct
3607
which may occur at the top level of a section_ wherever a body element
3608
(list, table, etc.) is allowed. In other words, ``sidebar`` elements
3609
cannot nest inside body elements, so you can't have a ``sidebar``
3610
inside a ``table`` or a ``list``, or inside another ``sidebar`` (or
3618
`Structural Elements`_
3621
The following elements may contain ``sidebar``: document_,
3625
``sidebar`` elements begin with a title_ and an optional subtitle_
3626
and contain `body elements`_ and topic_ elements.
3629
``sidebar`` is analogous to the DocBook "sidebar" element.
3632
A ``sidebar`` element should be set off from the rest of the
3633
document somehow, typically with a border. Sidebars typically
3634
"float" to the side of the page and the document's main text flows
3643
(title_, subtitle_?,
3644
(`%body.elements;`_ | topic_)+)
3647
The ``sidebar`` element contains only the `common attributes`_:
3648
ids_, names_, dupnames_, source_, and classes_.
3650
:Parameter Entities:
3651
The `%structure.model;`_ parameter entity directly includes
3658
The `"sidebar" directive`_ is used to create a ``sidebar`` element.
3659
reStructuredText_ source::
3662
:subtitle: If Desired
3666
Pseudo-XML_ fragment from simple parsing::
3676
.. _"sidebar" directive: rst/directives.html#sidebar
3682
The ``status`` element contains a status statement for the document,
3683
such as "Draft", "Final", "Work In Progress", etc.
3690
`Bibliographic Elements`_
3693
Only the docinfo_ element contains ``status``.
3696
``status`` elements may contain text data plus `inline elements`_.
3699
``status`` is analogous to the DocBook "status" element.
3713
The ``status`` element contains only the `common attributes`_:
3714
ids_, names_, dupnames_, source_, and classes_.
3716
:Parameter Entities:
3717
The `%bibliographic.elements;`_ parameter entity directly includes
3724
reStructuredText_ source::
3729
:Status: Work In Progress
3731
Complete pseudo-XML_ result after parsing and applying transforms::
3733
<document ids="document-title" names="document title">
3740
See docinfo_ for a more complete example, including processing
3756
``substitution_definition``
3757
===========================
3762
``substitution_reference``
3763
==========================
3771
The ``subtitle`` element stores the subtitle of a document_.
3778
`Structural Subelements`_
3781
The document_ and sidebar_ elements may contain ``subtitle``.
3784
``subtitle`` elements may contain text data plus `inline
3788
``subtitle`` is analogous to HTML header elements ("h2" etc.) and
3789
to the DocBook "subtitle" element.
3792
A document's subtitle is usually rendered smaller than its title_.
3803
The ``subtitle`` element contains only the `common attributes`_:
3804
ids_, names_, dupnames_, source_, and classes_.
3810
reStructuredText_ source::
3821
Complete pseudo-XML_ result after parsing and applying transforms::
3823
<document ids="title" names="title">
3826
<subtitle ids="subtitle" names="subtitle">
3831
Note how two section levels have collapsed, promoting their titles to
3832
become the document's title and subtitle. Since there is only one
3833
structural element (document), the subsection's ``ids`` and ``names``
3834
attributes are stored in the ``subtitle`` element.
3870
The ``term`` element contains a word or phrase being defined in a
3878
`Body Subelements`_ (simple)
3881
Only the definition_list_item_ element contains ``term``.
3884
``term`` elements may contain text data plus `inline elements`_.
3887
``term`` is analogous to the HTML "dt" element and to the DocBook
3891
See definition_list_item_.
3902
The ``term`` element contains only the `common attributes`_:
3903
ids_, names_, dupnames_, source_, and classes_.
3909
See the examples for the definition_list_, definition_list_item_, and
3910
classifier_ elements.
3928
The ``tip`` element is an admonition, a distinctive and self-contained
3929
notice. Also see the other admonition elements Docutils offers (in
3930
alphabetical order): attention_, caution_, danger_, error_, hint_,
3931
important_, note_, warning_, and the generic admonition_.
3938
`Compound Body Elements`_
3941
All elements employing the `%body.elements;`_ or
3942
`%structure.model;`_ parameter entities in their content models
3943
may contain ``tip``.
3946
``tip`` elements contain one or more `body elements`_.
3949
``tip`` is analogous to the DocBook "tip" element.
3952
Rendered distinctly (inset and/or in a box, etc.), with the
3953
generated title "Tip" (or similar).
3961
(`%body.elements;`_)+
3964
The ``tip`` element contains only the `common attributes`_: ids_,
3965
names_, dupnames_, source_, and classes_.
3967
:Parameter Entities:
3968
The `%body.elements;`_ parameter entity directly includes ``tip``.
3969
The `%structure.model;`_ parameter entity indirectly includes
3976
reStructuredText source::
3978
.. Tip:: 15% if the service is good.
3980
Pseudo-XML_ fragment from simple parsing::
3984
15% if the service is good.
3992
The ``title`` element stores the title of a document_, section_,
3993
topic_, sidebar_, or generic admonition_.
4000
`Structural Subelements`_
4003
The following elements may contain ``title``: document_, section_,
4004
topic_, sidebar_, admonition_
4007
``title`` elements may contain text data plus `inline elements`_.
4010
``title`` is analogous to HTML "title" and header ("h1" etc.)
4011
elements, and to the DocBook "title" element.
4022
The ``title`` element contains the `common attributes`_ (ids_,
4023
names_, dupnames_, source_, and classes_), plus refid_ and auto_.
4025
``refid`` is used as a backlink to a table of contents entry.
4027
``auto`` is used to indicate (with value "1") that the ``title``
4028
has been numbered automatically.
4034
reStructuredText_ source::
4041
Pseudo-XML_ fragment from simple parsing::
4043
<section ids="a-title" names="a title">
4059
The ``topic`` element is a nonrecursive section_-like construct which
4060
may occur at the top level of a section_ wherever a body element
4061
(list, table, etc.) is allowed. In other words, ``topic`` elements
4062
cannot nest inside body elements, so you can't have a ``topic`` inside
4063
a ``table`` or a ``list``, or inside another ``topic``.
4070
`Structural Elements`_
4073
The following elements may contain ``topic``: document_, section_,
4077
``topic`` elements begin with a title_ and may contain `body
4081
``topic`` is analogous to the DocBook "simplesect" element.
4084
A ``topic`` element should be set off from the rest of the
4085
document somehow, such as with indentation or a border.
4094
(`%body.elements;`_)+)
4097
The ``topic`` element contains only the `common attributes`_:
4098
ids_, names_, dupnames_, source_, and classes_.
4100
:Parameter Entities:
4101
The `%structure.model;`_ parameter entity directly includes
4108
The `"topic" directive`_ is used to create a ``topic`` element.
4109
reStructuredText_ source::
4115
Pseudo-XML_ fragment from simple parsing::
4123
.. _"topic" directive: rst/directives.html#topic
4129
The ``transition`` element is commonly seen in novels and short
4130
fiction, as a gap spanning one or more lines, with or without a type
4131
ornament such as a row of asterisks. Transitions separate body
4132
elements and sections, dividing a section into untitled divisions. A
4133
transition may not begin or end a section [#]_ or document, nor may
4134
two transitions be immediately adjacent.
4136
See `Doctree Representation of Transitions`__ in `A Record of
4137
reStructuredText Syntax Alternatives`__.
4139
.. [#] In reStructuredText markup, a transition may appear to fall at
4140
the end of a section immediately before another section. A
4141
transform recognizes this case and moves the transition so it
4142
separates the sections.
4144
__ ../dev/rst/alternatives.html#doctree-representation-of-transitions
4145
__ ../dev/rst/alternatives.html
4152
`Structural Subelements`_
4155
The following elements may contain ``transition``: document_,
4159
``transition`` is an empty element and has no children.
4162
``transition`` is analogous to the HTML "hr" element.
4165
The ``transition`` element is typically rendered as vertical
4166
whitespace (more than that separating paragraphs), with or without
4167
a horizontal line or row of asterisks. In novels, transitions are
4168
often represented as a row of three well-spaced asterisks with
4169
vertical space above and below.
4179
The ``transition`` element has no content; it is a "point element".
4182
The ``transition`` element contains only the `common attributes`_:
4183
ids_, names_, dupnames_, source_, and classes_.
4185
:Parameter Entities:
4186
The `%structure.model;`_ parameter entity directly includes
4193
reStructuredText_ source::
4201
Complete pseudo-XML_ result after parsing::
4214
The ``version`` element contains the version number of the document.
4215
It can be used alone or in conjunction with revision_.
4222
`Bibliographic Elements`_
4225
Only the docinfo_ element contains ``version``.
4228
``version`` elements may contain text data plus `inline
4232
``version`` may be considered analogous to the DocBook "revision",
4233
"revnumber", or "biblioid" elements.
4236
Sometimes used with the RCS/CVS keyword "Revision". See docinfo_
4248
The ``version`` element contains only the `common attributes`_:
4249
ids_, names_, dupnames_, source_, and classes_.
4251
:Parameter Entities:
4252
The `%bibliographic.elements;`_ parameter entity directly includes
4259
reStructuredText_ source::
4266
Complete pseudo-XML_ result after parsing and applying transforms::
4268
<document ids="document-title" names="document title">
4275
See docinfo_ for a more complete example, including processing
4282
The ``warning`` element is an admonition, a distinctive and
4283
self-contained notice. Also see the other admonition elements
4284
Docutils offers (in alphabetical order): attention_, caution_,
4285
danger_, error_, hint_, important_, note_, tip_.
4292
`Compound Body Elements`_
4295
All elements employing the `%body.elements;`_ or
4296
`%structure.model;`_ parameter entities in their content models
4297
may contain ``warning``.
4300
``warning`` elements contain one or more `body elements`_.
4303
``warning`` is analogous to the DocBook "warning" element.
4306
Rendered distinctly (inset and/or in a box, etc.), with the
4307
generated title "Warning" (or similar).
4315
(`%body.elements;`_)+
4318
The ``warning`` element contains only the `common attributes`_:
4319
ids_, names_, dupnames_, source_, and classes_.
4321
:Parameter Entities:
4322
The `%body.elements;`_ parameter entity directly includes
4323
``warning``. The `%structure.model;`_ parameter entity indirectly
4324
includes ``warning``.
4330
reStructuredText source::
4332
.. WARNING:: Reader discretion is strongly advised.
4334
Pseudo-XML_ fragment from simple parsing::
4338
Reader discretion is strongly advised.
4341
---------------------
4343
---------------------
4345
.. contents:: :local:
4348
_`Common Attributes`: Through the `%basic.atts;`_ parameter entity,
4349
all elements contain the following attributes: ids_, names_, dupnames_,
4350
source_, and classes_.
4357
Character data. ``CDATA`` attributes may contain arbitrary text.
4360
Like a ``NMTOKEN``, but it must begin with a letter (a "name
4361
production"). Identical ``ID`` values must not appear more than
4362
once in a document; i.e., ID values must uniquely identify their
4366
A reference to an ``ID`` value (a name production) of another
4370
One or more space-separated ``ID`` references (name productions).
4373
A "name token". One or more of letters, digits, ".", "-", and
4377
One or more space-separated ``NMTOKEN`` names.
4380
No if zero ("0"), yes if any other value. This is a parameter
4381
entity which resolves to a ``NMTOKEN`` attribute type.
4384
This emphasizes that the attribute value must be a number. This
4385
is a parameter entity which resolves to a ``NMTOKEN`` attribute
4389
The attribute value may be one of a specified list of values.
4395
`Attribute type`_: ``%yesorno;``. Default value: none (implies no).
4397
The ``anonymous`` attribute is used for unnamed hyperlinks in the
4398
target_ and reference_ elements (via the `%anonymous.att;`_ parameter
4405
`Attribute type`_: ``CDATA``. Default value: none.
4407
The ``auto`` attribute is used to indicate automatically-numbered
4408
footnote_, footnote_reference_ and title_ elements (via the
4409
`%auto.att;`_ parameter entity).
4415
`Attribute type`_: ``IDREFS``. Default value: none.
4417
The ``backrefs`` attribute contains a space-separated list of ids_
4418
references, used for backlinks from footnote_, citation_, and
4419
system_message_ elements (via the `%backrefs.att;`_ parameter entity).
4425
`Attribute type`_: ``CDATA``. Default value: none.
4427
The ``bullet`` attribute is used in the bullet_list_ element.
4433
`Attribute type`_: ``NMTOKENS``. Default value: none.
4435
The ``classes`` attribute is a list containing one or more names used
4436
to classify an element. The purpose of the attribute is to indicate
4437
an "is-a" variant relationship, to allow an extensible way of defining
4438
sub-classes of existing elements. It can be used to carry context
4439
forward between a Docutils Reader and Writer, when a custom structure
4440
is reduced to a standardized document tree. One common use is in
4441
conjunction with stylesheets, to add selection criteria. It should
4442
not be used to carry formatting instructions or arbitrary content.
4444
The ``classes`` attribute's contents should be ignorable. Writers that
4445
are not familiar with the variant expressed should be able to ignore
4448
``classes`` is one of the `common attributes`_, shared by all Docutils
4455
`Attribute type`_: ``CDATA``. Default value: none.
4457
The ``delimiter`` attribute is used in the option_argument_ element.
4463
`Attribute type`_: ``CDATA``. Default value: none.
4465
The ``dupnames`` attribute is a list containing the names of an
4466
element when there has been a naming conflict. The contents of the
4467
``dupnames`` attribute would have been transferred from the `names`_
4468
attribute. An element may have at most one of the ``names`` or
4469
``dupnames`` attributes, but not both. ``dupnames`` is one of the
4470
`common attributes`_, shared by all Docutils elements.
4476
`Attribute type`_: enumeration, one of "arabic", "loweralpha",
4477
"upperalpha", "lowerroman", or "upperroman". Default value: none.
4479
The ``enumtype`` attribute is used in the enumerated_list_ element.
4485
`Attribute type`_: ``NMTOKENS``. Default value: none.
4487
The ``ids`` attribute is a list containing one or more unique
4488
identifier keys. ``ids`` is one of the `common attributes`_, shared
4489
by all Docutils elements.
4495
`Attribute type`_: ``CDATA``. Default value: none.
4497
The ``names`` attribute is a list containing the names of an element,
4498
typically originating from the element's title or content. Each name
4499
in ``names`` must be unique; if there are name conflicts (two or more
4500
elements want to the same name), the contents will be transferred to
4501
the `dupnames`_ attribute on the duplicate elements. An element may
4502
have at most one of the ``names`` or ``dupnames`` attributes, but not
4503
both. ``names`` is one of the `common attributes`_, shared by all
4510
`Attribute type`_: ``CDATA``. Default value: none.
4512
The ``prefix`` attribute is used in the enumerated_list_ element.
4518
`Attribute type`_: ``IDREF``. Default value: none.
4520
The ``refid`` attribute contains references to `ids`_ attributes in
4521
other elements. It is used by the target_, reference_,
4522
footnote_reference_, citation_reference_, title_ and problematic_
4523
elements (via the `%refid.att;`_ and `%reference.atts;`_ parameter
4530
`Attribute type`_: ``NMTOKENS``. Default value: none.
4532
The ``refname`` attribute contains an internal reference to the
4533
`names`_ attribute of another element. On a `target`_ element,
4534
``refname`` indicates an indirect target which may resolve to either
4535
an internal or external reference. ``refname`` is used by the
4536
target_, reference_, footnote_reference_, citation_reference_, and
4537
substitution_reference_ elements (via the `%refname.att;`_ and
4538
`%reference.atts;`_ parameter entities).
4544
`Attribute type`_: ``CDATA``. Default value: none.
4546
The ``refuri`` attribute contains an external reference to a URI/URL.
4547
It is used by the target_, reference_, footnote_reference_, and
4548
citation_reference_ elements (via the `%reference.atts;`_ parameter
4555
`Attribute type`_: ``CDATA``. Default value: none.
4557
The ``source`` attribute is used to store the path or URL to the
4558
source text that was used to produce the document tree. It is one of
4559
the `common attributes`_, shared by all Docutils elements.
4565
`Attribute type`_: ``%number;``. Default value: none.
4567
The ``start`` attribute is used in the enumerated_list_ element.
4573
`Attribute type`_: ``CDATA``. Default value: none.
4575
The ``suffix`` attribute is used in the enumerated_list_ element.
4581
`Attribute type`_: one of "default" or "preserve". Default value:
4584
The ``xml:space`` attribute is a standard XML attribute for
4585
whitespace-preserving elements. It is used by the literal_block_,
4586
line_block_, doctest_block_, comment_, and raw_ elements (via the
4587
`%fixedspace.att;`_ parameter entity). It is a fixed attribute, meant
4588
to communicate to an XML parser that the element contains significant
4589
whitespace. The attribute value should not be set in a document
4593
.. _title (attribute):
4598
`Attribute type`_: ``CDATA``. Default value: none.
4600
The ``title`` attribute stores the title metadata of a document. This
4601
title is typically not part of the rendered document. It may for
4602
example be used in HTML's ``title`` element.
4605
----------------------------
4606
Parameter Entity Reference
4607
----------------------------
4609
.. contents:: :local:
4612
Parameter entities are used to simplify the DTD (to share definitions
4613
and reduce duplication) and to allow the DTD to be customized by
4614
wrapper DTDs (external client DTDs that use or import the Docutils
4615
DTD). Parameter entities may be overridden by wrapper DTDs, replacing
4616
the definitions below with custom definitions. Parameter entities
4617
whose names begin with "additional" are meant to allow easy extension
4624
The ``%anonymous.att;`` parameter entity contains the anonymous_
4625
attribute, used for unnamed hyperlinks.
4631
anonymous_ %yesorno; #IMPLIED
4633
The reference_ and target_ elements directly employ the
4634
``%anonymous.att;`` parameter entity in their attribute lists.
4640
The ``%auto.att;`` parameter entity contains the auto_ attribute, used
4641
to indicate an automatically-numbered footnote or title.
4647
auto_ CDATA #IMPLIED
4649
The footnote_, footnote_reference_, and title_ elements directly
4650
employ the ``%auto.att;`` parameter entity in their attribute lists.
4656
The ``%backrefs.att;`` parameter entity contains the backrefs_
4657
attribute, a space-separated list of id references, for backlinks.
4663
backrefs_ IDREFS #IMPLIED
4665
The citation_, footnote_, and system_message_ elements directly employ
4666
the ``%backrefs.att;`` parameter entity in their attribute lists.
4672
The ``%basic.atts;`` parameter entity lists attributes common to all
4673
Docutils elements. See `Common Attributes`_.
4679
ids_ NMTOKENS #IMPLIED
4680
names_ CDATA #IMPLIED
4681
dupnames_ CDATA #IMPLIED
4682
source_ CDATA #IMPLIED
4683
classes_ NMTOKENS #IMPLIED
4684
%additional.basic.atts;
4686
The ``%additional.basic.atts;`` parameter entity can be used by
4687
wrapper DTDs to extend ``%basic.atts;``.
4690
``%bibliographic.elements;``
4691
============================
4693
The ``%bibliographic.elements;`` parameter entity contains an OR-list of all
4694
`bibliographic elements`_.
4700
author_ | authors_ | organization_ | contact_ | address_
4701
| version_ | revision_ | status_ | date_ | copyright_
4703
%additional.bibliographic.elements;
4705
The ``%additional.bibliographic.elements;`` parameter entity can be used by
4706
wrapper DTDs to extend ``%bibliographic.elements;``.
4708
Only the docinfo_ element directly employs the
4709
``%bibliographic.elements;`` parameter entity in its content model.
4715
The ``%body.elements;`` parameter entity contains an OR-list of all
4716
`body elements`_. ``%body.elements;`` is itself contained within the
4717
`%structure.model;`_ parameter entity.
4723
paragraph_ | compound_ | container_ | literal_block_ | doctest_block_
4724
| line_block_ | block_quote_
4725
| table_ | figure_ | image_ | footnote_ | citation_ | rubric_
4726
| bullet_list_ | enumerated_list_ | definition_list_ | field_list_
4728
| attention_ | caution_ | danger_ | error_ | hint_ | important_ | note_
4729
| tip_ | warning_ | admonition_
4730
| reference_ | target_ | substitution_definition_ | comment_ | pending_
4731
| system_message_ | raw_
4732
%additional.body.elements;
4734
The ``%additional.body.elements;`` parameter entity can be used by
4735
wrapper DTDs to extend ``%body.elements;``.
4737
The ``%body.elements;`` parameter entity is directly employed in the
4738
content models of the following elements: admonition_, attention_,
4739
block_quote_, caution_, citation_, compound_, danger_, definition_,
4740
description_, entry_, error_, field_body_, footer_, footnote_,
4741
header_, hint_, important_, legend_, list_item_, note_, sidebar_,
4742
system_message_, tip_, topic_, warning_
4744
Via `%structure.model;`_, the ``%body.elements;`` parameter entity is
4745
indirectly employed in the content models of the document_ and
4749
``%fixedspace.att;``
4750
====================
4752
The ``%fixedspace.att;`` parameter entity contains the `xml:space`_
4753
attribute, a standard XML attribute for whitespace-preserving
4760
`xml:space`_ (default | preserve) #FIXED 'preserve'
4762
The ``%fixedspace.att;`` parameter entity is directly employed in the
4763
attribute lists of the following elements: address_, comment_,
4764
doctest_block_, line_block_, literal_block_, raw_
4767
``%inline.elements;``
4768
=====================
4770
The ``%inline.elements;`` parameter entity contains an OR-list of all
4777
emphasis_ | strong_ | literal_
4778
| reference_ | footnote_reference_ | citation_reference_
4779
| substitution_reference_ | title_reference_
4780
| abbreviation_ | acronym_ | subscript_ | superscript_
4781
| inline_ | problematic_ | generated_
4782
| target_ | image_ | raw_
4783
%additional.inline.elements;
4785
The ``%additional.inline.elements;`` parameter entity can be used by
4786
wrapper DTDs to extend ``%inline.elements;``.
4788
Via `%text.model;`_, the ``%inline.elements;`` parameter entity is
4789
indirectly employed in the content models of the following elements:
4790
abbreviation_, acronym_, address_, attribution_, author_, caption_,
4791
classifier_, contact_, copyright_, date_, doctest_block_, emphasis_,
4792
generated_, inline_, line_block_, literal_block_, organization_,
4793
paragraph_, problematic_, raw_, reference_, revision_, rubric_,
4794
status_, strong_, subscript_, substitution_definition_,
4795
substitution_reference_, subtitle_, superscript_, target_, term_,
4796
title_, title_reference_, version_
4799
``%reference.atts;``
4800
====================
4802
The ``%reference.atts;`` parameter entity groups together the refuri_,
4803
refid_, and refname_ attributes.
4812
%additional.reference.atts;
4814
The ``%additional.reference.atts;`` parameter entity can be used by
4815
wrapper DTDs to extend ``%additional.reference.atts;``.
4817
The citation_reference_, footnote_reference_, reference_, and target_
4818
elements directly employ the ``%reference.att;`` parameter entity in
4819
their attribute lists.
4825
The ``%refid.att;`` parameter entity contains the refid_ attribute, an
4826
internal reference to the `ids`_ attribute of another element.
4832
refid_ CDATA #IMPLIED
4834
The title_ and problematic_ elements directly employ the
4835
``%refid.att;`` parameter entity in their attribute lists.
4837
Via `%reference.atts;`_, the ``%refid.att;`` parameter entity is
4838
indirectly employed in the attribute lists of the citation_reference_,
4839
footnote_reference_, reference_, and target_ elements.
4845
The ``%refname.att;`` parameter entity contains the refname_
4846
attribute, an internal reference to the `names`_ attribute of another
4847
element. On a `target`_ element, ``refname`` indicates an indirect
4848
target which may resolve to either an internal or external
4855
refname_ NMTOKENS #IMPLIED
4857
The substitution_reference_ element directly employs the
4858
``%refname.att;`` parameter entity in its attribute list.
4860
Via `%reference.atts;`_, the ``%refname.att;`` parameter entity is
4861
indirectly employed in the attribute lists of the citation_reference_,
4862
footnote_reference_, reference_, and target_ elements.
4868
The ``%refuri.att;`` parameter entity contains the refuri_ attribute,
4869
an external reference to a URI/URL.
4875
refuri_ CDATA #IMPLIED
4877
Via `%reference.atts;`_, the ``%refuri.att;`` parameter entity is
4878
indirectly employed in the attribute lists of the citation_reference_,
4879
footnote_reference_, reference_, and target_ elements.
4882
``%section.elements;``
4883
======================
4885
The ``%section.elements;`` parameter entity contains an OR-list of all
4886
section_-equivalent elements. ``%section.elements;`` is itself
4887
contained within the `%structure.model;`_ parameter entity.
4894
%additional.section.elements;
4896
The ``%additional.section.elements;`` parameter entity can be used
4897
by wrapper DTDs to extend ``%section.elements;``.
4899
Via `%structure.model;`_, the ``%section.elements;`` parameter entity
4900
is indirectly employed in the content models of the document_ and
4904
``%structure.model;``
4905
=====================
4907
The ``%structure.model;`` parameter entity encapsulates the
4908
hierarchical structure of a document and of its constituent parts.
4909
See the discussion of the `element hierarchy`_ above.
4915
( ( (`%body.elements;`_ | topic_ | sidebar_)+, transition_? )*,
4916
( (`%section.elements;`_), (transition_?, (`%section.elements;`_) )* )? )
4918
Each document_ or section_ contains zero or more body elements,
4919
topics, and/or sidebars, optionally interspersed with single
4920
transitions, followed by zero or more sections (whose contents are
4921
recursively the same as this model) optionally interspersed with
4924
The following restrictions are imposed by this model:
4926
* Transitions must be separated by other elements (body elements,
4927
sections, etc.). In other words, a transition may not be
4928
immediately adjacent to another transition.
4930
* A transition may not occur at the beginning of a document or
4933
An additional restriction, which cannot be expressed in the language
4934
of DTDs, is imposed by software:
4936
* A transition may not occur at the end of a document or section.
4938
The `%structure.model;`_ parameter entity is directly employed in the
4939
content models of the document_ and section_ elements.
4945
The ``%text.model;`` parameter entity is used by many elements to
4946
represent text data mixed with `inline elements`_.
4952
(#PCDATA | `%inline.elements;`_)*
4954
The ``%text.model;`` parameter entity is directly employed in the
4955
content models of the following elements: abbreviation_, acronym_,
4956
address_, author_, caption_, classifier_, contact_, copyright_, date_,
4957
doctest_block_, emphasis_, field_name_, generated_, line_block_,
4958
literal_block_, organization_, paragraph_, problematic_, raw_,
4959
reference_, revision_, status_, strong_, substitution_definition_,
4960
substitution_reference_, subtitle_, target_, term_, title_, version_
4967
indent-tabs-mode: nil
4968
sentence-end-double-space: t