~ubuntu-branches/ubuntu/dapper/python-docutils/dapper

« back to all changes in this revision

Viewing changes to docs/ref/doctree.txt

  • Committer: Bazaar Package Importer
  • Author(s): Matthias Klose
  • Date: 2005-12-13 13:47:41 UTC
  • mfrom: (1.1.2 upstream)
  • Revision ID: james.westby@ubuntu.com-20051213134741-fhuh5tq3n346q1oj
Tags: 0.3.9-0.1ubuntu1
Synchronize with Debian unstable.

Show diffs side-by-side

added added

removed removed

Lines of Context:
7
7
 
8
8
:Author: David Goodger
9
9
:Contact: goodger@users.sourceforge.net
10
 
:Revision: $Revision: 1.46 $
11
 
:Date: $Date: 2004/11/26 09:27:54 $
 
10
:Revision: $Revision: 3282 $
 
11
:Date: $Date: 2005-05-02 05:59:11 +0200 (Mon, 02 May 2005) $
12
12
:Copyright: This document has been placed in the public domain.
13
13
 
14
14
 
62
62
contain further body elements, etc. ::
63
63
 
64
64
  +--------------------------------------------------------------------+
65
 
  | document  [may begin with a title, subtitle, docinfo, decoration]  |
 
65
  | document  [may begin with a title, subtitle, decoration, docinfo]  |
66
66
  |                             +--------------------------------------+
67
67
  |                             | sections  [each begins with a title] |
68
68
  +-----------------------------+-------------------------+------------+
112
112
Simple structuctural subelements (title_, subtitle_) contain text
113
113
data; the others are compound and do not directly contain text data.
114
114
 
115
 
Category members: title_, subtitle_, docinfo_, decoration_,
 
115
Category members: title_, subtitle_, decoration_, docinfo_,
116
116
transition_
117
117
 
118
118
 
146
146
and compound.
147
147
 
148
148
Category members: admonition_, attention_, block_quote_, bullet_list_,
149
 
caution_, citation_, comment_, danger_, definition_list_,
 
149
caution_, citation_, comment_, compound_, danger_, definition_list_,
150
150
doctest_block_, enumerated_list_, error_, field_list_, figure_,
151
151
footnote_, hint_, image_, important_, line_block_, literal_block_,
152
152
note_, option_list_, paragraph_, pending_, raw_, rubric_,
161
161
that contain text data may also contain inline elements.  Such
162
162
elements therefore have a "mixed content model".
163
163
 
164
 
Category members: comment_, doctest_block_, image_, line_block_,
165
 
literal_block_, paragraph_, pending_, raw_, rubric_,
166
 
substitution_definition_, target_
 
164
Category members: comment_, doctest_block_, image_, literal_block_,
 
165
paragraph_, pending_, raw_, rubric_, substitution_definition_, target_
167
166
 
168
167
 
169
168
Compound Body Elements
173
172
and further body elements.  They do not directly contain text data.
174
173
 
175
174
Category members: admonition_, attention_, block_quote_, bullet_list_,
176
 
caution_, citation_, danger_, definition_list_, enumerated_list_,
177
 
error_, field_list_, figure_, footnote_, hint_, important_, note_,
178
 
option_list_, system_message_, table_, tip_, warning_
 
175
caution_, citation_, compound_, danger_, definition_list_,
 
176
enumerated_list_, error_, field_list_, figure_, footnote_, hint_,
 
177
important_, line_block, note_, option_list_, system_message_, table_,
 
178
tip_, warning_
179
179
 
180
180
 
181
181
Body Subelements
189
189
element level (beside paragraphs, etc.).
190
190
 
191
191
Category members (simple): attribution_, caption_, classifier_,
192
 
colspec_, field_name_, label_, option_argument_, option_string_, term_
 
192
colspec_, field_name_, label_, line_, option_argument_,
 
193
option_string_, term_
193
194
 
194
195
Category members (compound): definition_, definition_list_item_,
195
196
description_, entry_, field_, field_body_, legend_, list_item_,
264
265
  - Real XML::
265
266
 
266
267
        <document>
267
 
        <section id="a-title" name="a title">
 
268
        <section ids="a-title" names="a title">
268
269
        <title>A Title</title>
269
270
        <paragraph>A paragraph.</paragraph>
270
271
        </section>
273
274
  - Pseudo-XML::
274
275
 
275
276
        <document>
276
 
            <section id="a-title" name="a title">
 
277
            <section ids="a-title" names="a title">
277
278
                <title>
278
279
                    A Title
279
280
                <paragraph>
304
305
The ``address`` element holds the surface mailing address information
305
306
for the author (individual or group) of the document, or a third-party
306
307
contact address.  Its structure is identical to that of the
307
 
line_block_ element: whitespace is significant, especially newlines.
 
308
literal_block_ element: whitespace is significant, especially
 
309
newlines.
308
310
 
309
311
 
310
312
Details
323
325
    ``address`` is analogous to the DocBook "address" element.
324
326
 
325
327
:Processing:
326
 
    As with the line_block_ element, newlines and other whitespace is
327
 
    significant and must be preserved.  However, a monospaced typeface
328
 
    need not be used.
 
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.
329
331
 
330
332
    See also docinfo_.
331
333
 
359
361
 
360
362
Complete pseudo-XML_ result after parsing and applying transforms::
361
363
 
362
 
    <document id="document-title" name="document title">
 
364
    <document ids="document-title" names="document title">
363
365
        <title>
364
366
            Document Title
365
367
        <docinfo>
559
561
 
560
562
Complete pseudo-XML_ result after parsing and applying transforms::
561
563
 
562
 
    <document id="document-title" name="document title">
 
564
    <document ids="document-title" names="document title">
563
565
        <title>
564
566
            Document Title
565
567
        <docinfo>
625
627
 
626
628
Complete pseudo-XML_ result after parsing and applying transforms::
627
629
 
628
 
    <document id="document-title" name="document title">
 
630
    <document ids="document-title" names="document title">
629
631
        <title>
630
632
            Document Title
631
633
        <docinfo>
959
961
`To be completed`_.
960
962
 
961
963
 
 
964
``compound``
 
965
============
 
966
 
 
967
`To be completed`_.
 
968
 
 
969
 
962
970
``contact``
963
971
===========
964
972
 
1016
1024
 
1017
1025
Complete pseudo-XML_ result after parsing and applying transforms::
1018
1026
 
1019
 
    <document id="document-title" name="document title">
 
1027
    <document ids="document-title" names="document title">
1020
1028
        <title>
1021
1029
            Document Title
1022
1030
        <docinfo>
1082
1090
 
1083
1091
Complete pseudo-XML_ result after parsing and applying transforms::
1084
1092
 
1085
 
    <document id="document-title" name="document title">
 
1093
    <document ids="document-title" names="document title">
1086
1094
        <title>
1087
1095
            Document Title
1088
1096
        <docinfo>
1210
1218
 
1211
1219
Complete pseudo-XML_ result after parsing and applying transforms::
1212
1220
 
1213
 
    <document id="document-title" name="document title">
 
1221
    <document ids="document-title" names="document title">
1214
1222
        <title>
1215
1223
            Document Title
1216
1224
        <docinfo>
1226
1234
 
1227
1235
The ``decoration`` element is a container for header_ and footer_
1228
1236
elements and potential future extensions.  These elements are used for
1229
 
page navigation, notes, time/datestamp, etc.  Currently only the
1230
 
footer_ element is implemented, populated with processing information
1231
 
(datestamp, a link to Docutils_, etc.).
 
1237
notes, time/datestamp, processing information, etc.
1232
1238
 
1233
1239
 
1234
1240
Details
1251
1257
:Processing:
1252
1258
    See the individual `decorative elements`_.
1253
1259
 
 
1260
 
1254
1261
Content Model
1255
1262
-------------
1256
1263
 
1612
1619
    :Date: 2002-08-18
1613
1620
    :Status: Work In Progress
1614
1621
    :Version: 1
1615
 
    :Filename: $RCSfile: doctree.txt,v $
 
1622
    :Filename: $RCSfile$
1616
1623
    :Copyright: This document has been placed in the public domain.
1617
1624
 
1618
1625
Complete pseudo-XML_ result after parsing and applying transforms::
1619
1626
 
1620
 
    <document id="docinfo-example" name="docinfo example">
 
1627
    <document ids="docinfo-example" names="docinfo example">
1621
1628
        <title>
1622
1629
            Docinfo Example
1623
1630
        <docinfo>
1758
1765
 
1759
1766
.. parsed-literal::
1760
1767
 
1761
 
    ((title_,
1762
 
      subtitle_?)?,
1763
 
     docinfo_?,
1764
 
     decoration_?,
1765
 
     `%structure.model;`_)
 
1768
    ( (title_, subtitle_?)?,
 
1769
      decoration_?,
 
1770
      (docinfo_, transition_?)?,
 
1771
      `%structure.model;`_ )
1766
1772
 
1767
1773
Depending on the source of the data and the stage of processing, the
1768
1774
"document" may not initially contain a "title".  A document title is
1769
1775
not directly representable in reStructuredText_.  Instead, a lone
1770
1776
top-level section may have its title promoted to become the document
1771
1777
title_, and similarly for a lone second-level (sub)section's title to
1772
 
become the document subtitle_.  The "docinfo_" may be transformed from
1773
 
an initial field_list_, and "decoration_" is usually constructed
1774
 
programmatically.
 
1778
become the document subtitle_.
 
1779
 
 
1780
The contents of "decoration_" may be specified in a document,
 
1781
constructed programmatically, or both.  The "docinfo_" may be
 
1782
transformed from an initial field_list_.
1775
1783
 
1776
1784
See the `%structure.model;`_ parameter entity for details of the body
1777
1785
of a ``document``.
1794
1802
Complete pseudo-XML_ result from simple parsing::
1795
1803
 
1796
1804
    <document>
1797
 
        <section id="a-title" name="a title">
 
1805
        <section ids="a-title" names="a title">
1798
1806
            <title>
1799
1807
                A Title
1800
1808
            <paragraph>
1803
1811
After applying transforms, the section title is promoted to become the
1804
1812
document title::
1805
1813
 
1806
 
    <document id="a-title" name="a title">
 
1814
    <document ids="a-title" names="a title">
1807
1815
        <title>
1808
1816
            A Title
1809
1817
        <paragraph>
2233
2241
 
2234
2242
The ``footer`` element is a container element whose contents are meant
2235
2243
to appear at the bottom of a web page, or repeated at the bottom of
2236
 
every printed page.  Currently the ``footer`` element may contain
2237
 
processing information (datestamp, a link to Docutils_, etc.).
 
2244
every printed page.  The ``footer`` element may contain processing
 
2245
information (datestamp, a link to Docutils_, etc.) as well as custom
 
2246
content.
2238
2247
 
2239
2248
 
2240
2249
Details
2314
2323
 
2315
2324
The ``header`` element is a container element whose contents are meant
2316
2325
to appear at the top of a web page, or at the top of every printed
2317
 
page.  Docutils does not yet make use of the ``header`` element.
 
2326
page.
2318
2327
 
2319
2328
 
2320
2329
Details
2350
2359
Examples
2351
2360
--------
2352
2361
 
2353
 
None.
 
2362
reStructuredText source fragment::
 
2363
 
 
2364
    .. header:: This space for rent.
 
2365
 
 
2366
Pseudo-XML_ fragment from simple parsing::
 
2367
 
 
2368
    <document>
 
2369
        <decoration>
 
2370
            <header>
 
2371
                <paragraph>
 
2372
                    This space for rent.
2354
2373
 
2355
2374
 
2356
2375
``hint``
2520
2539
`To be completed`_.
2521
2540
 
2522
2541
 
 
2542
``line``
 
2543
========
 
2544
 
 
2545
The ``line`` element contains a single line of text, part of a
 
2546
`line_block`_.
 
2547
 
 
2548
 
 
2549
Details
 
2550
-------
 
2551
 
 
2552
:Category:
 
2553
    `Body Subelements`_ (simple)
 
2554
 
 
2555
:Parents:
 
2556
    Only the `line_block`_ element contains ``line``.
 
2557
 
 
2558
:Children:
 
2559
    ``line`` elements may contain text data plus `inline elements`_.
 
2560
 
 
2561
:Analogues:
 
2562
    ``line`` has no direct analogues in common DTDs.  It can be
 
2563
    emulated with primitives or type effects.
 
2564
 
 
2565
:Processing:
 
2566
    See `line_block`_.
 
2567
 
 
2568
 
 
2569
Content Model
 
2570
-------------
 
2571
 
 
2572
.. parsed-literal::
 
2573
 
 
2574
   `%text.model;`_
 
2575
 
 
2576
:Attributes:
 
2577
    The ``line`` element contains the `common attributes`_ (id_,
 
2578
    name_, dupname_, source_, and class_), plus `xml:space`_.
 
2579
 
 
2580
 
 
2581
Examples
 
2582
--------
 
2583
 
 
2584
See `line_block`_.
 
2585
 
 
2586
 
2523
2587
``line_block``
2524
2588
==============
2525
2589
 
2526
 
The ``line_block`` element contains a block of text where line breaks
2527
 
and whitespace are significant and must be preserved.  ``line_block``
2528
 
elements are commonly used for verse and addresses.  See `line_block`_
2529
 
for an alternative useful for program listings and interactive
2530
 
computer sessions.
 
2590
The ``line_block`` element contains a sequence of lines and nested
 
2591
line blocks.  Line breaks (implied between elements) and leading
 
2592
whitespace (indicated by nesting) is significant and must be
 
2593
preserved.  ``line_block`` elements are commonly used for verse and
 
2594
addresses.  See `literal_block`_ for an alternative useful for program
 
2595
listings and interactive computer sessions.
2531
2596
 
2532
2597
 
2533
2598
Details
2534
2599
-------
2535
2600
 
2536
2601
:Category:
2537
 
    `Simple Body Elements`_
 
2602
    `Compound Body Elements`_
2538
2603
 
2539
2604
:Parents:
2540
2605
    All elements employing the `%body.elements;`_ or
2542
2607
    may contain ``line_block``.
2543
2608
 
2544
2609
:Children:
2545
 
    ``line_block`` elements may contain text data plus `inline
2546
 
    elements`_.
 
2610
    ``line_block`` elements may contain line_ elements and nested
 
2611
    ``line_block`` elements.
2547
2612
 
2548
2613
:Analogues:
2549
2614
    ``line_block`` is analogous to the DocBook "literallayout" element
2552
2617
 
2553
2618
:Processing:
2554
2619
    Unline ``literal_block``, ``line_block`` elements are typically
2555
 
    rendered in an ordinary text typeface.  It is crucial that all
 
2620
    rendered in an ordinary text typeface.  It is crucial that leading
2556
2621
    whitespace and line breaks are preserved in the rendered form.
2557
2622
 
2558
2623
 
2561
2626
 
2562
2627
.. parsed-literal::
2563
2628
 
2564
 
   `%text.model;`_
 
2629
   (line_ | line_block_)+
2565
2630
 
2566
2631
:Attributes:
2567
2632
    The ``line_block`` element contains the `common attributes`_ (id_,
2581
2646
 
2582
2647
    Take it away, Eric the Orchestra Leader!
2583
2648
 
2584
 
    .. line-block::
2585
 
 
2586
 
       A one, two, a one two three four
2587
 
 
2588
 
       Half a bee, philosophically,
2589
 
           must, *ipso facto*, half not be.
2590
 
       But half the bee has got to be,
2591
 
           *vis a vis* its entity.  D'you see?
2592
 
 
2593
 
       But can a bee be said to be
2594
 
           or not to be an entire bee,
2595
 
               when half the bee is not a bee,
2596
 
                   due to some ancient injury?
2597
 
 
2598
 
       Singing...
 
2649
    | A one, two, a one two three four
 
2650
    |
 
2651
    | Half a bee, philosophically,
 
2652
    |     must, *ipso facto*, half not be.
 
2653
    | But half the bee has got to be,
 
2654
    |     *vis a vis* its entity.  D'you see?
 
2655
    |
 
2656
    | But can a bee be said to be
 
2657
    |     or not to be an entire bee,
 
2658
    |         when half the bee is not a bee,
 
2659
    |             due to some ancient injury?
 
2660
    |
 
2661
    | Singing...
2599
2662
 
2600
2663
Pseudo-XML_ fragment from simple parsing::
2601
2664
 
2602
2665
    <paragraph>
2603
2666
        Take it away, Eric the Orchestra Leader!
2604
 
    <line_block xml:space="preserve">
2605
 
        A one, two, a one two three four
2606
 
 
2607
 
        Half a bee, philosophically,
2608
 
            must, <emphasis>ipso facto</emphasis>, half not be.
2609
 
        But half the bee has got to be,
2610
 
            <emphasis>vis a vis</emphasis>its entity.  D'you see?
2611
 
 
2612
 
        But can a bee be said to be
2613
 
            or not to be an entire bee,
2614
 
                when half the bee is not a bee,
2615
 
                    due to some ancient injury?
2616
 
 
2617
 
        Singing...
 
2667
    <line_block>
 
2668
        <line>
 
2669
            A one, two, a one two three four
 
2670
        <line>
 
2671
        <line>
 
2672
            Half a bee, philosophically,
 
2673
        <line_block>
 
2674
            <line>
 
2675
                must, 
 
2676
                <emphasis>
 
2677
                    ipso facto
 
2678
                , half not be.
 
2679
        <line>
 
2680
            But half the bee has got to be,
 
2681
        <line_block>
 
2682
            <line>
 
2683
                <emphasis>
 
2684
                    vis a vis
 
2685
                 its entity.  D'you see?
 
2686
            <line>
 
2687
        <line>
 
2688
            But can a bee be said to be
 
2689
        <line_block>
 
2690
            <line>
 
2691
                or not to be an entire bee,
 
2692
            <line_block>
 
2693
                <line>
 
2694
                    when half the bee is not a bee,
 
2695
                <line_block>
 
2696
                    <line>
 
2697
                        due to some ancient injury?
 
2698
                    <line>
 
2699
        <line>
 
2700
            Singing...
2618
2701
 
2619
2702
 
2620
2703
``list_item``
3221
3304
 
3222
3305
Complete pseudo-XML_ result after parsing and applying transforms::
3223
3306
 
3224
 
    <document id="document-title" name="document title">
 
3307
    <document ids="document-title" names="document title">
3225
3308
        <title>
3226
3309
            Document Title
3227
3310
        <docinfo>
3371
3454
 
3372
3455
Complete pseudo-XML_ result after parsing and applying transforms::
3373
3456
 
3374
 
    <document id="document-title" name="document title">
 
3457
    <document ids="document-title" names="document title">
3375
3458
        <title>
3376
3459
            Document Title
3377
3460
        <docinfo>
3479
3562
Complete pseudo-XML_ result after parsing::
3480
3563
 
3481
3564
    <document>
3482
 
        <section id="title-1" name="title 1">
 
3565
        <section ids="title-1" names="title 1">
3483
3566
            <title>
3484
3567
                Title 1
3485
3568
            <paragraph>
3486
3569
                Paragraph 1.
3487
 
            <section id="title-2" name="title 2">
 
3570
            <section ids="title-2" names="title 2">
3488
3571
                <title>
3489
3572
                    Title 2
3490
3573
                <paragraph>
3491
3574
                    Paragraph 2.
3492
 
        <section id="title-3" name="title 3">
 
3575
        <section ids="title-3" names="title 3">
3493
3576
            <title>
3494
3577
                Title 3
3495
3578
            <paragraph>
3496
3579
                Paragraph 3.
3497
 
            <section id="title-4" name="title 4">
 
3580
            <section ids="title-4" names="title 4">
3498
3581
                <title>
3499
3582
                    Title 4
3500
3583
                <paragraph>
3531
3614
 
3532
3615
:Children:
3533
3616
    ``sidebar`` elements begin with a title_ and an optional subtitle_
3534
 
    and contain `body elements`_.
 
3617
    and contain `body elements`_ and topic_ elements.
3535
3618
 
3536
3619
:Analogues:
3537
3620
    ``sidebar`` is analogous to the DocBook "sidebar" element.
3549
3632
.. parsed-literal::
3550
3633
 
3551
3634
    (title_, subtitle_?,
3552
 
     (`%body.elements;`_)+)
 
3635
     (`%body.elements;`_ | topic_)+)
3553
3636
 
3554
3637
:Attributes:
3555
3638
    The ``sidebar`` element contains only the `common attributes`_:
3638
3721
 
3639
3722
Complete pseudo-XML_ result after parsing and applying transforms::
3640
3723
 
3641
 
    <document id="document-title" name="document title">
 
3724
    <document ids="document-title" names="document title">
3642
3725
        <title>
3643
3726
            Document Title
3644
3727
        <docinfo>
3728
3811
 
3729
3812
Complete pseudo-XML_ result after parsing and applying transforms::
3730
3813
 
3731
 
    <document id="title" name="title">
 
3814
    <document ids="title" names="title">
3732
3815
        <title>
3733
3816
            Title
3734
 
        <subtitle id="subtitle" name="subtitle">
 
3817
        <subtitle ids="subtitle" names="subtitle">
3735
3818
            Subtitle
3736
3819
        <paragraph>
3737
3820
            A paragraph.
3946
4029
 
3947
4030
Pseudo-XML_ fragment from simple parsing::
3948
4031
 
3949
 
    <section id="a-title" name="a title">
 
4032
    <section ids="a-title" names="a title">
3950
4033
        <title>
3951
4034
            A Title
3952
4035
        <paragraph>
3966
4049
may occur at the top level of a section_ wherever a body element
3967
4050
(list, table, etc.) is allowed.  In other words, ``topic`` elements
3968
4051
cannot nest inside body elements, so you can't have a ``topic`` inside
3969
 
a ``table`` or a ``list``, or inside another ``topic`` (or sidebar_).
 
4052
a ``table`` or a ``list``, or inside another ``topic``.
3970
4053
 
3971
4054
 
3972
4055
Details
3976
4059
    `Structural Elements`_
3977
4060
 
3978
4061
:Parents:
3979
 
    The following elements may contain ``topic``: document_, section_
 
4062
    The following elements may contain ``topic``: document_, section_,
 
4063
    sidebar_
3980
4064
 
3981
4065
:Children:
3982
4066
    ``topic`` elements begin with a title_ and may contain `body
4170
4254
 
4171
4255
Complete pseudo-XML_ result after parsing and applying transforms::
4172
4256
 
4173
 
    <document id="document-title" name="document title">
 
4257
    <document ids="document-title" names="document title">
4174
4258
        <title>
4175
4259
            Document Title
4176
4260
        <docinfo>
4611
4695
 
4612
4696
.. parsed-literal::
4613
4697
 
4614
 
    paragraph_ | literal_block_ | doctest_block_ | line_block_
4615
 
    | block_quote_ | table_ | figure_ | image_ | footnote_ | citation_
4616
 
    | rubric_
 
4698
    paragraph_ | compound_ | literal_block_ | doctest_block_
 
4699
    | line_block_ | block_quote_
 
4700
    | table_ | figure_ | image_ | footnote_ | citation_ | rubric_
4617
4701
    | bullet_list_ | enumerated_list_ | definition_list_ | field_list_
4618
4702
    | option_list_
4619
 
    | attention_ | caution_ | danger_ | error_ | hint_ | important_
4620
 
    | note_ | tip_ | warning_ | admonition_
4621
 
    | target_ | substitution_definition_ | comment_ | pending_
 
4703
    | attention_ | caution_ | danger_ | error_ | hint_ | important_ | note_
 
4704
    | tip_ | warning_ | admonition_
 
4705
    | reference_ | target_ | substitution_definition_ | comment_ | pending_
4622
4706
    | system_message_ | raw_
4623
4707
    %additional.body.elements;
4624
4708
 
4627
4711
 
4628
4712
The ``%body.elements;`` parameter entity is directly employed in the
4629
4713
content models of the following elements: admonition_, attention_,
4630
 
block_quote_, caution_, citation_, danger_, definition_, description_,
4631
 
entry_, error_, field_body_, footer_, footnote_, header_, hint_,
4632
 
important_, legend_, list_item_, note_, sidebar_, system_message_,
4633
 
tip_, topic_, warning_
 
4714
block_quote_, caution_, citation_, compound_, danger_, definition_,
 
4715
description_, entry_, error_, field_body_, footer_, footnote_,
 
4716
header_, hint_, important_, legend_, list_item_, note_, sidebar_,
 
4717
system_message_, tip_, topic_, warning_
4634
4718
 
4635
4719
Via `%structure.model;`_, the ``%body.elements;`` parameter entity is
4636
4720
indirectly employed in the content models of the document_ and