Rename html_plain writer to html5_polyglott.
[docutils.git] / test / functional / input / standalone_rst_html5_polyglot.txt
bloba87d9fa05e03b99fd379b6632bbf78260d48ee8b
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 Changes to the html4css1 writer
12 ===============================
14 * Use only meta keywords recognized by HTML 5.
16 * Set table column widths with <style="width: ...">, not "width" argument.
18 * Horizontal alignment of table heads with CSS.
20 * Field lists as styled definition lists.
22 * Do not drop paragraph objects, use CSS rules to prevent unwanted vertical
23   space.
25 * Put subtitles in <p> elements.
27 Field list handling
28 -------------------
30 The following list demonstrates the problems with the html4css1
31 approach: the `field-name-limit` setting is given in "number of
32 characters" but the field name uses a proportional font.
34 :The field name:  is typeset on the same line, unless it is "long".
36 :this field name: is considered "long" in the html table rendering by
37                   the html4css1 writer with the default setting of
38                   ``--field-name-limit=14``.
40 :iiiiiiiiiiiiiii: a field name that is considered "long" by html4css1
41                   with the default setting of `field-name-limit: 14`.
43 :MMMMMMMMMMMMMM: a field name that is actually longer than the
44                  previous one but regarded "short" by html4css1.
46 With ``html_plain``, a `field list` is typeset as CSS-styled `definition
47 list`. The default layout is similar to the look with `html4css1`:
49 .. class:: open
51 :A long field name: sticks into the field body.
53                 The field body is pushed to the next line (you can suppress
54                 this behaviour with the `run-in`_ class argument).
56 :Customization: of the field name width is possible with CSS instead
57                 of the `field-name-limit` configuration setting, for
58                 example::
60                     dl.field-list > dd { margin-left: 6em; }
62 :Empty:
64 :fields:       must not lead to misalignment of the following content.
66 Styling with class arguments
67 ----------------------------
69 The ``plain.css`` style sheet comes with some pre-defined style variants
70 that can be choosen via a class argument.
72 Description lists
73 `````````````````
75 Definition lists with the "description" class argument:
77 .. class:: description
79 description lists
80   Definition lists that are styled like in most dictionaries,
81   encyclopedias etc. (as well as the LaTeX `description` environment).
82 label
83   The term to be described. Put in boldface.
84 content
85   Starts on the same line and has a hanging indent.
87 Field list variants
88 ```````````````````
90 For field lists, the "compact/open", "narrow" and "run-in" styles are defined.
92 *compact*
93   .. class:: compact
95   :Feature: No additional space between list items.
97   :Option: The ``--compact-field-lists`` command line option (and the
98            corresponding configuration setting) set the `compact`
99            class argument on all "simple" field lists, if not
100            overridden with `open`.
102   :Use:  For lists with short field body.
104 *open*
105   .. class:: open
107   :Feature: Additional space between list items also in "simple" lists.
108             (Overrides the ``--compact-field-lists`` command line
109             option and the corresponding configuration setting)
111   :Use: For "simple" lists that should keep the space between list items.
113 *narrow*
114   .. class:: narrow
116   :Feature: Less indented field body.
117   :Use:   For lists with short field names.
118   :A long field name:
119        sticks into the field body and the field body starts on a
120        new line (if not combined with `run-in`_).
122 .. _`run-in`:
124 *run-in*
125   .. class:: run-in
127   :Feature: Field body starts on the same line also after long field
128             names.
130   :A long field name: sticks into the field body which continues on
131                          the same line.
133   :The next field name:  and field body should align. Long text in the field
134                          body is wrapped and aligns with other fields.
136 Table variants
137 ``````````````
139 The following styles can be applied to individual tables via a class
140 argument or as document wide setting with the table-style_ configuration
141 setting (or command line argument).
143 * Numbered tables can be achieved with the "numbered" class option:
145   .. table:: truth values
146      :class: numbered
148      ======= ======= ==========
149      A       B       A or B
150      ======= ======= ==========
151      False   False   False
152      True    False   True
153      False   True    True
154      True    True    True
155      ======= ======= ==========
157   Currently, referencing to the table by number is not supported. This is a
158   common request and already on the `TODO list`.
160 * With the "widths" argument "auto" (or "class" value "colwidths-auto"),
161   column widths are determined by the browser.
163   .. table::
164      :widths: auto
166      ======= ======= ==========
167      A       B       A or B
168      ======= ======= ==========
169      False   False   False
170      True    False   True
171      False   True    True
172      True    True    True
173      ======= ======= ==========
175 * A table with "booktabs" class value, is rendered similar to the style
176   from the booktabs_ LaTeX package.
178   .. _table-style:
179      http://docutils.sourceforge.net/docs/user/config.html#table-style
180   .. _booktabs:
181      http://tug.ctan.org/tex-archive/macros/latex/contrib/booktabs/booktabs.pdf
183 "Booktabs" style table, numbered, centre-aligned, with auto-sized columns:
185   .. table:: I/O values
186      :class: booktabs numbered
187      :align: center
188      :widths: auto
190      ======= ======= ==========
191      Input           Output
192      --------------- ----------
193      A       B       A or B
194      ======= ======= ==========
195      False   False   False
196      True    False   True
197      False   True    True
198      True    True    True
199      ======= ======= ==========
202 .. include:: data/errors.txt
204 .. footer:: |HTML 5| |validator| |valid-CSS2|
206 .. |HTML 5| image:: http://www.w3.org/html/logo/badge/html5-badge-h-css3-semantics.png
207    :height: 31
208    :width: 88
209    :alt: Conforms to HTML 5
210    :target: http://www.w3.org/TR/html5/
212 .. |validator| image:: https://validator-suite.w3.org/icons/vs-blue-256.png
213    :height: 31
214    :width: 88
215    :alt: Check validity!
216    :target: http://validator.w3.org/check?uri=referer
218 .. |valid-CSS2| image:: http://jigsaw.w3.org/css-validator/images/vcss
219    :height: 31
220    :width: 88
221    :alt: Valid CSS 2.1!
222    :target: http://jigsaw.w3.org/css-validator/check/referer