Documentation update.
[docutils.git] / sandbox / html4strict / data / standalone_rst_html4strict.txt
bloba814125d06ffc0b9ea880e86bf69d68ed97f11a8
1 .. include:: data/standard.txt
2 .. include:: data/header_footer.txt
3 .. include:: data/table_colspan.txt
4 .. include:: data/table_rowspan.txt
5 .. include:: data/table_complex.txt
6 .. include:: data/list_table.txt
7 .. include:: data/custom_roles.txt
8 .. include:: data/svg_images.txt
9 .. include:: data/swf_images.txt
11 Additional html4_strict features
12 ================================
14 Enumerated lists with nested counters
15 -------------------------------------
17 .. class:: nested
19 #. first point
21    #. first sub-point
22    #. second sub-point
24       With a standard paragraph
26       #. first sub-sub-point
28    #. third sub-point with a long and silly text just to test the line
29       wrapping in this kind of lists.
31    * Unordered list nested in enumeration.
33    Definition list
34      nested in top-level enumeration
36 #. second top-level point
39 Description list
40 ----------------
42 Definition lists are styled like in most dictionaries, encyclopedias
43 etc. (as well as the LaTeX `description` environment) if given the
44 ``description`` class argument:
46 .. class:: description
48 The label
49   is bold.
51 The description
52   starts on the same line. If it is longer, you will see that it has a
53   hanging indent.
56 Field list handling
57 -------------------
59 The following list demonstrates the problems with the html4css1
60 approach: the `field-name-limit` setting is given in "number of
61 characters" but the field name uses a proportional font.
63 :The field name:  is typeset on the same line, unless it is "long".
65 :this field name: is considered "long" in the html table rendering by
66                   the html4css1 writer with the default setting of
67                   ``--field-name-limit=14``.
69 :iiiiiiiiiiiiiii: a field name that is considered "long" by html4css1
70                   with the default setting of `field-name-limit: 14`.
72 :MMMMMMMMMMMMMM: a field name that is actually longer than the
73                  previous one but regarded "short" by html4css1.
75 With `html4strict`, the field list is typeset as CSS-styled `definition
76 list`. The default layout is similar to the look with `html4css1`:
78 .. class:: open
80 :A long field name: sticks into the field body.
82                 The field body is pushed to the next line (you can
83                 suppress this behaviour with the `run-in`_ or
84                 `fix-labelwidth`_ class arguments).
86 :Customization: of the field name width is possible with CSS instead
87                 of the `field-name-limit` configuration setting, for
88                 example::
90                     dl.field-list > dd { margin-left: 6em; }
92 Styling with class arguments
93 ````````````````````````````
95 The default style sheet ``html4css2.css`` supports the following class
96 arguments for alternative styles:
98 *compact*
99   .. class:: compact
101   :Feature: No additional space between list items.
103   :Option: The ``--compact-field-lists`` command line option (and the
104            corresponding configuration setting) set the `compact`
105            class argument on all "simple" field lists, if not
106            overridden with `open`.
108   :Use:  For lists with short field body.
110 *open*
111   .. class:: open
113   :Feature: Additional space between list items also in "simple" lists.
114             (Overrides the ``--compact-field-lists`` command line
115             option and the corresponding configuration setting)
117   :Use: For "simple" lists that should keep the space between list items.
119 *narrow*
120   .. class:: narrow
122   :Feature: Less indented field body.
123   :Use:   For lists with short field names.
124   :A long field name:
125        sticks into the field body and the field body starts on a
126        new line (if not combined with `run-in`_ or `fix-labelwidth`_).
128 .. _`run-in`:
130 *run-in*
131   .. class:: run-in
133   :Feature: Field body starts on the same line also after long field
134             names.
136   :A long field name: sticks into the field body which continues on
137                          the same line.
139   :The next field name:  and field body should align.
141 .. _`fix-labelwidth`:
143 *fix-labelwidth*
144   .. class:: fix-labelwidth
146   :Feature:  The width of the field name (label) is fixed. Long labels
147              wrap.
149   :Problem: Non-wrappable field names are truncated.
151   :a_very_long_field_name:
152              is truncated if it can not wrap.
154   :this long field name: will wrap.
156   :the next field name:  and field body should align.
158              .. If the field name is wrapped but the field body just
159                 one line, following field bodies "float up" if not
160                 prevented by a dummy dd:after element in the CSS.
163 Table styling with class arguments
164 ----------------------------------
166 Numbered tables can be achieved with the ``numbered`` class option
168 .. table:: truth values
169    :class: numbered
171    ======= ======= ==========
172    A       B       A or B
173    ======= ======= ==========
174    False   False   False
175    True    False   True
176    False   True    True
177    True    True    True
178    ======= ======= ==========
180 In addition to the "borderless" table-style_, the style sheet also
181 defines "booktabs", that will be rendered similar to the style from
182 the booktabs_ LaTeX package.
184 .. _table-style:
185    http://docutils.sourceforge.net/docs/user/config.html#table-style
186 .. _booktabs:
187    http://tug.ctan.org/tex-archive/macros/latex/contrib/booktabs/booktabs.pdf
189 .. class:: booktabs
191 =====  =====  ======
192 False  False  False
193 True   False  True
194 False  True   True
195 True   True   True
196 =====  =====  ======
198 This table also uses the "align-left" class argument, to left-align
199 the headers:
201 .. class:: booktabs align-left
203 =====  =====  =======
204   A      B    A or B
205 =====  =====  =======
206 False  False  False
207 True   False  True
208 False  True   True
209 True   True   True
210 =====  =====  =======
213 Of course, also booktabs style tables can be numbered:
215 .. table:: I/O values
216    :class: numbered booktabs
218    =====  =====  ======
219       Inputs     Output
220    ------------  ------
221      A      B    A or B
222    =====  =====  ======
223    False  False  False
224    True   False  True
225    False  True   True
226    True   True   True
227    =====  =====  ======
230 Math
231 ----
233 The W3C consortium provides a DTD for XHTML 1.1 plus MathML 2.0, so
234 that documents embedding formulas as MathML can be validated.
236 The linear mapping :math:`f: \mathbb{C}^{N}\longmapsto\mathbb{C}^{N}`
237 with
239 .. math::
241   c_{k}=F(kf_{0})=T_{\text{A}}
242   \sum_{n=-N/2}^{+N/2}f(x_{n})\text{e}^{-2\pi\text{i}\frac{nk}{N}}
244 for all :math:`a\in\mathbb{C}^{N}` is called discrete Fourier
245 transformation (DFT).
248 .. include:: data/errors.txt
250 .. footer:: |valid-xhtml11| |valid-CSS2|
252 .. |valid-xhtml11| image:: http://www.w3.org/Icons/valid-xhtml11
253    :height: 31
254    :width: 88
255    :alt: Valid XHTML 1.1!
256    :target: http://validator.w3.org/check?uri=referer
258 .. |valid-CSS2| image:: http://jigsaw.w3.org/css-validator/images/vcss
259    :height: 31
260    :width: 88
261    :alt: Valid CSS 2.1!
262    :target: http://jigsaw.w3.org/css-validator/check/referer