diff options
| author | milde <milde@929543f6-e4f2-0310-98a6-ba3bd3dd1d04> | 2021-02-13 12:00:39 +0000 |
|---|---|---|
| committer | milde <milde@929543f6-e4f2-0310-98a6-ba3bd3dd1d04> | 2021-02-13 12:00:39 +0000 |
| commit | f5b1a848d2f813b03f7d21614beb4d69c5c7a0ce (patch) | |
| tree | 4bd39fb5e62c1e2f22593de310c862568e56b98d /docutils/test/functional | |
| parent | 219794d1965c81290590d626e95db6aeedaa4ad6 (diff) | |
| download | docutils-f5b1a848d2f813b03f7d21614beb4d69c5c7a0ce.tar.gz | |
Fix/Update HTML5 writer functional test.
git-svn-id: https://svn.code.sf.net/p/docutils/code/trunk@8622 929543f6-e4f2-0310-98a6-ba3bd3dd1d04
Diffstat (limited to 'docutils/test/functional')
| -rw-r--r-- | docutils/test/functional/expected/standalone_rst_html5.html | 133 | ||||
| -rw-r--r-- | docutils/test/functional/input/data/html5-features.txt | 173 | ||||
| -rw-r--r-- | docutils/test/functional/input/data/html5-text-level-tags.txt (renamed from docutils/test/functional/input/html5-text-level-tags.txt) | 83 | ||||
| -rw-r--r-- | docutils/test/functional/input/standalone_rst_html5.txt | 180 |
4 files changed, 286 insertions, 283 deletions
diff --git a/docutils/test/functional/expected/standalone_rst_html5.html b/docutils/test/functional/expected/standalone_rst_html5.html index a13f67f92..eb7ac0182 100644 --- a/docutils/test/functional/expected/standalone_rst_html5.html +++ b/docutils/test/functional/expected/standalone_rst_html5.html @@ -140,22 +140,22 @@ They are transformed from section titles after parsing. --> <li><p><a class="reference internal" href="#custom-roles" id="toc-entry-41"><span class="sectnum">2.23</span> Custom Roles</a></p></li> </ul> </li> -<li><p><a class="reference internal" href="#html-specific" id="toc-entry-42"><span class="sectnum">3</span> HTML specific</a></p> +<li><p><a class="reference internal" href="#html-specific" id="toc-entry-42"><span class="sectnum">3</span> HTML Specific</a></p> <ul class="auto-toc"> <li><p><a class="reference internal" href="#svg-images" id="toc-entry-43"><span class="sectnum">3.1</span> SVG Images</a></p></li> <li><p><a class="reference internal" href="#swf-images" id="toc-entry-44"><span class="sectnum">3.2</span> SWF Images</a></p></li> -<li><p><a class="reference internal" href="#text-level-semantics" id="toc-entry-45"><span class="sectnum">3.3</span> Text-level semantics</a></p></li> +<li><p><a class="reference internal" href="#text-level-semantics" id="toc-entry-45"><span class="sectnum">3.3</span> Text-Level Semantics</a></p></li> <li><p><a class="reference internal" href="#indicating-edits" id="toc-entry-46"><span class="sectnum">3.4</span> Indicating Edits</a></p></li> </ul> </li> -<li><p><a class="reference internal" href="#changes-to-the-html4css1-writer" id="toc-entry-47"><span class="sectnum">4</span> Changes to the html4css1 writer</a></p> +<li><p><a class="reference internal" href="#changes-to-the-html4css1-writer" id="toc-entry-47"><span class="sectnum">4</span> Changes to the <cite>html4css1</cite> Writer</a></p> <ul class="auto-toc"> -<li><p><a class="reference internal" href="#field-list-handling" id="toc-entry-48"><span class="sectnum">4.1</span> Field list handling</a></p></li> -<li><p><a class="reference internal" href="#styling-with-class-arguments" id="toc-entry-49"><span class="sectnum">4.2</span> Styling with class arguments</a></p> +<li><p><a class="reference internal" href="#field-list-rendering" id="toc-entry-48"><span class="sectnum">4.1</span> Field List Rendering</a></p></li> +<li><p><a class="reference internal" href="#styling-with-class-arguments" id="toc-entry-49"><span class="sectnum">4.2</span> Styling with Class Arguments</a></p> <ul class="auto-toc"> -<li><p><a class="reference internal" href="#description-lists" id="toc-entry-50"><span class="sectnum">4.2.1</span> Description lists</a></p></li> -<li><p><a class="reference internal" href="#field-list-variants" id="toc-entry-51"><span class="sectnum">4.2.2</span> Field list variants</a></p></li> -<li><p><a class="reference internal" href="#table-variants" id="toc-entry-52"><span class="sectnum">4.2.3</span> Table variants</a></p></li> +<li><p><a class="reference internal" href="#description-lists" id="toc-entry-50"><span class="sectnum">4.2.1</span> Description Lists</a></p></li> +<li><p><a class="reference internal" href="#field-list-variants" id="toc-entry-51"><span class="sectnum">4.2.2</span> Field List Variants</a></p></li> +<li><p><a class="reference internal" href="#table-variants" id="toc-entry-52"><span class="sectnum">4.2.3</span> Table Variants</a></p></li> <li><p><a class="reference internal" href="#numbered-figures" id="toc-entry-53"><span class="sectnum">4.2.4</span> Numbered Figures</a></p></li> </ul> </li> @@ -1241,7 +1241,7 @@ crunchy, now would it?</p></td> </section> </section> <section id="html-specific"> -<h2><a class="toc-backref" href="#toc-entry-42"><span class="sectnum">3</span> HTML specific</a></h2> +<h2><a class="toc-backref" href="#toc-entry-42"><span class="sectnum">3</span> HTML Specific</a></h2> <section id="svg-images"> <h3><a class="toc-backref" href="#toc-entry-43"><span class="sectnum">3.1</span> SVG Images</a></h3> <img alt="../../../docs/user/rst/images/biohazard.svg" class="align-left" src="../../../docs/user/rst/images/biohazard.svg" style="width: 48px; height: 48px;" /> @@ -1341,10 +1341,10 @@ For complete control over display options use raw HTML.</p> <p>An inline SWF image <object data="../../../docs/user/rst/images/biohazard.swf" style="width: 0.8em; height: 0.8em;" type="application/x-shockwave-flash">inline-swf</object> scaled to 0.8 em x 0.8 em.</p> </section> <section id="text-level-semantics"> -<h3><a class="toc-backref" href="#toc-entry-45"><span class="sectnum">3.3</span> Text-level semantics</a></h3> -<p><a class="reference external" href="https://html.spec.whatwg.org/#text-level-semantics">HTML 5 tags for representation of text-level semantics</a> <a class="footnote-reference brackets" href="#footnote-13" id="footnote-reference-27">13</a> and their -reStructuredText equivalents.</p> -<dl class="narrow field-list"> +<h3><a class="toc-backref" href="#toc-entry-45"><span class="sectnum">3.3</span> Text-Level Semantics</a></h3> +<p>This section describes the <a class="reference external" href="https://html.spec.whatwg.org/#text-level-semantics">HTML 5 tags for representation of text-level +semantics</a> <a class="footnote-reference brackets" href="#footnote-13" id="footnote-reference-27">13</a> and their reStructuredText equivalents.</p> +<dl class="description"> <dt>a</dt> <dd><p>Hyperlinks</p> <blockquote> @@ -1415,22 +1415,16 @@ advised to use <abbr> instead. The HTML5 writer uses <abbr> for Docu <dt>ruby, rt, rp</dt> <dd><p>Ruby annotations</p> <p>Require inline nesting, currently not supported in rST.</p> -<blockquote> -<p><ruby> OJ <rp>(</rp><rt>Orange Juice</rt><rp>)</rp></ruby></p> -</blockquote> +<!-- <ruby> OJ <rp>(</rp><rt>Orange Juice</rt><rp>)</rp></ruby> --> </dd> <dt>data</dt> <dd><p>Machine-readable equivalent <a class="footnote-reference brackets" href="#attribute-required" id="footnote-reference-12">6</a></p> -<blockquote> -<p>Available starting today! <data value="UPC:022014640201">North Coast -Organic Apple Cider</data></p> -</blockquote> +<!-- Available starting today! <data value="UPC:022014640201">North Coast +Organic Apple Cider</data> --> </dd> <dt>time</dt> <dd><p>Machine-readable equivalent of date- or time-related data <a class="footnote-reference brackets" href="#attribute-required" id="footnote-reference-13">6</a></p> -<blockquote> -<p>Available starting on <time datetime="2011-11-18">November 18th</time>!</p> -</blockquote> +<!-- Available starting on <time datetime="2011-11-18">November 18th</time>! --> </dd> <dt>code</dt> <dd><p>Computer code</p> @@ -1505,11 +1499,9 @@ element.</p> </dd> <dt>bdo</dt> <dd><p>Text directionality formatting <a class="footnote-reference brackets" href="#attribute-required" id="footnote-reference-15">6</a></p> -<blockquote> -<p>The proposal is to write English, but in reverse order. "Juice" would -become "<bdo dir=rtl>Juice</bdo>"></p> -</blockquote> -<p>Authors must specify the dir attribute on this element.</p> +<!-- The proposal is to write English, but in reverse order. "Juice" would +become "<bdo dir=rtl>Juice</bdo>"> --> +<p>Authors <em>must</em> specify the dir attribute on this element.</p> </dd> <dt>span</dt> <dd><p>Other</p> @@ -1557,9 +1549,9 @@ roles to make sense.</p> </section> <section id="indicating-edits"> <h3><a class="toc-backref" href="#toc-entry-46"><span class="sectnum">3.4</span> Indicating Edits</a></h3> -<p><a class="reference external" href="https://html.spec.whatwg.org/multipage/edits.html">HTML tags for representation of edits to the document</a> <a class="footnote-reference brackets" href="#footnote-14" id="footnote-reference-28">14</a> and their -reStructuredText equivalents.</p> -<dl class="field-list"> +<p>The <a class="reference external" href="https://html.spec.whatwg.org/multipage/edits.html">HTML tags for representation of edits to the document</a> <a class="footnote-reference brackets" href="#footnote-14" id="footnote-reference-28">14</a> and their +reStructuredText equivalents are:</p> +<dl class="description"> <dt>ins</dt> <dd><p>Additions <a class="footnote-reference brackets" href="#attribute-optional" id="footnote-reference-16">5</a></p> <blockquote> @@ -1582,7 +1574,7 @@ reStructuredText equivalents.</p> </section> </section> <section id="changes-to-the-html4css1-writer"> -<h2><a class="toc-backref" href="#toc-entry-47"><span class="sectnum">4</span> Changes to the html4css1 writer</a></h2> +<h2><a class="toc-backref" href="#toc-entry-47"><span class="sectnum">4</span> Changes to the <cite>html4css1</cite> Writer</a></h2> <ul class="simple"> <li><p>Use only meta keywords recognized by HTML 5.</p></li> <li><p>Set table column widths with <style="width: ...">, not "width" argument.</p></li> @@ -1592,36 +1584,16 @@ reStructuredText equivalents.</p> space.</p></li> <li><p>Put subtitles in <p> elements.</p></li> </ul> -<section id="field-list-handling"> -<h3><a class="toc-backref" href="#toc-entry-48"><span class="sectnum">4.1</span> Field list handling</a></h3> -<p>The following list demonstrates the problems with the html4css1 -approach: the <cite>field-name-limit</cite> setting is given in "number of -characters" but the field name uses a proportional font.</p> -<dl class="field-list simple"> -<dt>The field name</dt> -<dd><p>is typeset on the same line, unless it is "long".</p> -</dd> -<dt>this field name</dt> -<dd><p>is considered "long" in the html table rendering by -the html4css1 writer with the default setting of -<span class="docutils literal"><span class="pre">--field-name-limit=14</span></span>.</p> -</dd> -<dt>iiiiiiiiiiiiiii</dt> -<dd><p>a field name that is considered "long" by html4css1 -with the default setting of <cite>field-name-limit: 14</cite>.</p> -</dd> -<dt>MMMMMMMMMMMMMM</dt> -<dd><p>a field name that is actually longer than the -previous one but regarded "short" by html4css1.</p> -</dd> -</dl> -<p>With <span class="docutils literal">html_plain</span>, a <cite>field list</cite> is typeset as CSS-styled <cite>definition -list</cite>. The default layout is similar to the look with <cite>html4css1</cite>:</p> +<section id="field-list-rendering"> +<h3><a class="toc-backref" href="#toc-entry-48"><span class="sectnum">4.1</span> Field List Rendering</a></h3> +<p>A <cite>field list</cite> is converted to a HTML <cite>definition list</cite> and given the +<span class="docutils literal"><span class="pre">field-list</span></span> class argument value to allow CSS styling. +With <span class="docutils literal">html_plain.css</span>, the layout is similar to <cite>html4css1</cite>:</p> <dl class="open field-list"> <dt>A long field name</dt> <dd><p>sticks into the field body.</p> -<p>The field body is pushed to the next line (you can suppress -this behaviour with the <a class="reference internal" href="#run-in">run-in</a> class argument).</p> +<p>The field body is pushed to the next line (you can suppress this +behaviour with the <a class="reference internal" href="#run-in">run-in</a> class argument).</p> </dd> <dt>Customization</dt> <dd><p>of the field name width is possible with CSS instead @@ -1637,27 +1609,50 @@ example:</p> </dl> </section> <section id="styling-with-class-arguments"> -<h3><a class="toc-backref" href="#toc-entry-49"><span class="sectnum">4.2</span> Styling with class arguments</a></h3> +<h3><a class="toc-backref" href="#toc-entry-49"><span class="sectnum">4.2</span> Styling with Class Arguments</a></h3> <p>The <span class="docutils literal">plain.css</span> style sheet comes with some pre-defined style variants that can be choosen via a class argument.</p> <section id="description-lists"> -<h4><a class="toc-backref" href="#toc-entry-50"><span class="sectnum">4.2.1</span> Description lists</a></h4> +<h4><a class="toc-backref" href="#toc-entry-50"><span class="sectnum">4.2.1</span> Description Lists</a></h4> <p>Definition lists with the "description" class argument:</p> -<dl class="description simple"> +<dl class="description"> <dt>description lists</dt> <dd><p>Definition lists that are styled like in most dictionaries, encyclopedias etc. (as well as the LaTeX <cite>description</cite> environment).</p> </dd> <dt>label</dt> -<dd><p>The term to be described. Put in boldface.</p> +<dd><p>The term to be described. Put in boldface or italic.</p> </dd> -<dt>content</dt> -<dd><p>Starts on the same line and has a hanging indent.</p> +<dt>Content</dt> +<dd><p>starts on the same line and has a hanging indent.</p> +</dd> +<dt>A label without content</dt> +<dd><!-- --> +</dd> +<dt>and the next label</dt> +<dd><p>must align.</p> +</dd> +<dt>as well</dt> +<dd><p>as content containing more than one</p> +<p>paragraph</p> +</dd> +<dt>or</dt> +<dd><ul class="simple"> +<li><p>nested lists</p></li> +<li><p>item 2</p></li> +</ul> +</dd> +<dt>or</dt> +<dd><dl class="simple"> +<dt>nested</dt> +<dd><p>definition lists</p> +</dd> +</dl> </dd> </dl> </section> <section id="field-list-variants"> -<h4><a class="toc-backref" href="#toc-entry-51"><span class="sectnum">4.2.2</span> Field list variants</a></h4> +<h4><a class="toc-backref" href="#toc-entry-51"><span class="sectnum">4.2.2</span> Field List Variants</a></h4> <p>For field lists, the "compact/open", "narrow" and "run-in" styles are defined in the style sheet <span class="docutils literal">plain.css</span>.</p> <dl class="simple"> @@ -1724,7 +1719,7 @@ body is wrapped and aligns with other fields.</p> </dl> </section> <section id="table-variants"> -<h4><a class="toc-backref" href="#toc-entry-52"><span class="sectnum">4.2.3</span> Table variants</a></h4> +<h4><a class="toc-backref" href="#toc-entry-52"><span class="sectnum">4.2.3</span> Table Variants</a></h4> <p>The following styles can be applied to individual tables via a class argument or as document wide setting with the <a class="reference external" href="http://docutils.sourceforge.net/docs/user/config.html#table-style">table-style</a> <a class="footnote-reference brackets" href="#footnote-10" id="footnote-reference-23">10</a> configuration setting (or command line argument).</p> @@ -1806,14 +1801,12 @@ from the <a class="reference external" href="http://tug.ctan.org/tex-archive/mac <section id="numbered-figures"> <h4><a class="toc-backref" href="#toc-entry-53"><span class="sectnum">4.2.4</span> Numbered Figures</a></h4> <p>Numbered figures can be achieved with the "numbered" <span class="docutils literal">:figclass:</span> option:</p> -<blockquote> <figure class="numbered"> -<img alt="reStructuredText, the markup syntax" src="../../../docs/user/rst/images/title.svg" /> +<img alt="reStructuredText, the markup syntax" src="../../../docs/user/rst/images/title.svg" style="width: 100%;" /> <figcaption> <p>SVG image in a numbered figure.</p> </figcaption> </figure> -</blockquote> </section> </section> </section> diff --git a/docutils/test/functional/input/data/html5-features.txt b/docutils/test/functional/input/data/html5-features.txt new file mode 100644 index 000000000..51f7c0efd --- /dev/null +++ b/docutils/test/functional/input/data/html5-features.txt @@ -0,0 +1,173 @@ +Field List Rendering +-------------------- + +A `field list` is converted to a HTML `definition list` and given the +``field-list`` class argument value to allow CSS styling. +With ``html_plain.css``, the layout is similar to `html4css1`: + +.. class:: open + +:A long field name: sticks into the field body. + + The field body is pushed to the next line (you can suppress this + behaviour with the `run-in`_ class argument). + +:Customization: of the field name width is possible with CSS instead + of the `field-name-limit` configuration setting, for + example:: + + dl.field-list > dd { margin-left: 6em; } + +:Empty: + +:fields: must not lead to misalignment of the following content. + +Styling with Class Arguments +---------------------------- + +The ``plain.css`` style sheet comes with some pre-defined style variants +that can be choosen via a class argument. + +Description Lists +````````````````` + +Definition lists with the "description" class argument: + +.. class:: description + +description lists + Definition lists that are styled like in most dictionaries, + encyclopedias etc. (as well as the LaTeX `description` environment). +label + The term to be described. Put in boldface or italic. +Content + starts on the same line and has a hanging indent. +A label without content + .. +and the next label + must align. + +as well + as content containing more than one + + paragraph + +or + * nested lists + * item 2 +or + nested + definition lists + + +Field List Variants +``````````````````` + +For field lists, the "compact/open", "narrow" and "run-in" styles are defined +in the style sheet ``plain.css``. + +*compact* + .. class:: compact + + :Feature: No additional space between list items. + + :Option: The ``--compact-field-lists`` command line option (and the + corresponding configuration setting) set the `compact` + class argument on all "simple" field lists, if not + overridden with `open`. + + :Use: For lists with short field body. + +*open* + .. class:: open + + :Feature: Additional space between list items also in "simple" lists. + (Overrides the ``--compact-field-lists`` command line + option and the corresponding configuration setting) + + :Use: For "simple" lists that should keep the space between list items. + +*narrow* + .. class:: narrow + + :Feature: Less indented field body. + :Use: For lists with short field names. + :A long field name: + sticks into the field body and the field body starts on a + new line (if not combined with `run-in`_). + +.. _`run-in`: + +*run-in* + .. class:: run-in + + :Feature: Field body starts on the same line also after long field + names. + + :A long field name: sticks into the field body which continues on + the same line. + + :The next field name: and field body should align. Long text in the field + body is wrapped and aligns with other fields. + +Table Variants +`````````````` + +The following styles can be applied to individual tables via a class +argument or as document wide setting with the table-style_ configuration +setting (or command line argument). + +* Numbered tables can be achieved with the "numbered" class option: + + .. table:: truth values + :class: numbered + + ======= ======= ========== + A B A or B + ======= ======= ========== + False False False + True False True + False True True + True True True + ======= ======= ========== + + Currently, referencing to the table by number is not supported. This is a + common request and already on the `TODO list`. + +* A table with "booktabs" class value, is rendered similar to the style + from the booktabs_ LaTeX package. + + .. _table-style: + http://docutils.sourceforge.net/docs/user/config.html#table-style + .. _booktabs: + http://tug.ctan.org/tex-archive/macros/latex/contrib/booktabs/booktabs.pdf + +"Booktabs" style table, numbered, centre-aligned, with auto-sized columns: + + .. table:: I/O values + :class: booktabs numbered + :align: center + :widths: auto + + ======= ======= ========== + Input Output + --------------- ---------- + A B A or B + ======= ======= ========== + False False False + True False True + False True True + True True True + ======= ======= ========== + +Numbered Figures +```````````````` + +Numbered figures can be achieved with the "numbered" ``:figclass:`` option: + +.. figure:: ../../../docs/user/rst/images/title.svg + :alt: reStructuredText, the markup syntax + :figclass: numbered + :width: 100% + + SVG image in a numbered figure. diff --git a/docutils/test/functional/input/html5-text-level-tags.txt b/docutils/test/functional/input/data/html5-text-level-tags.txt index 685412cbd..7ec1b097d 100644 --- a/docutils/test/functional/input/html5-text-level-tags.txt +++ b/docutils/test/functional/input/data/html5-text-level-tags.txt @@ -1,29 +1,29 @@ -Text-level semantics +Text-Level Semantics -------------------- -`HTML 5 tags for representation of text-level semantics`__ and their -reStructuredText equivalents. +This section describes the `HTML 5 tags for representation of text-level +semantics`__ and their reStructuredText equivalents. __ https://html.spec.whatwg.org/#text-level-semantics -.. class:: narrow +.. class:: description -:a: +a Hyperlinks Visit my `drinks <example.org:drinks.html>`_ page. -:em: +em Stress emphasis I must say I *adore* lemonade. I's :emphasis:`sooo` sweet. -:strong: +strong Importance **Warning**: This tea is :strong:`very hot`. -:small: +small Side comments .. role:: small @@ -31,7 +31,7 @@ __ https://html.spec.whatwg.org/#text-level-semantics These grapes are made into wine. :small:`Alcohol is addictive.` -:s: +s Inaccurate text .. role:: strikeout @@ -39,13 +39,13 @@ __ https://html.spec.whatwg.org/#text-level-semantics Price: :strikeout:`£4.50` £2.00! -:cite: +cite Titles of works The case `Hugo v. Danielle` is relevant here. I recommend reading :title:`Harry Potter`. -:q: +q Quotations .. role:: quotation @@ -54,7 +54,7 @@ __ https://html.spec.whatwg.org/#text-level-semantics The judge said :quotation:`You can drink water from the fish tank` but advised against it. -:dfn: +dfn Defining instance .. role:: dfn @@ -62,7 +62,7 @@ __ https://html.spec.whatwg.org/#text-level-semantics The term :dfn:`organic food` refers to food produced without synthetic chemicals. -:abbr: +abbr Abbreviations [#attribute-optional]_ Organic food in Ireland is certified by the :acronym:`IOFGA` [*]_ @@ -74,30 +74,34 @@ __ https://html.spec.whatwg.org/#text-level-semantics .. [*] Irish Organic Farmers and Growers Association -:ruby, rt, rp: Ruby annotations +ruby, rt, rp + Ruby annotations Require inline nesting, currently not supported in rST. + .. <ruby> OJ <rp>(</rp><rt>Orange Juice</rt><rp>)</rp></ruby> -:data: +data Machine-readable equivalent [#attribute-required]_ + .. Available starting today! <data value="UPC:022014640201">North Coast Organic Apple Cider</data> -:time: +time Machine-readable equivalent of date- or time-related data [#attribute-required]_ + .. Available starting on <time datetime="2011-11-18">November 18th</time>! -:code: +code Computer code The :code:`fruitdb` program can be used for tracking fruit production. -:var: +var Variables .. role:: var @@ -105,31 +109,31 @@ __ https://html.spec.whatwg.org/#text-level-semantics If there are :var:`n` fruit in the bowl, at least :var:`n`\ ÷2 will be ripe. -:samp: +samp Computer output .. role:: samp(literal) The computer said :samp:`Unknown error -3`. -:kbd: +kbd User input .. role:: kbd Hit :kbd:`F1` to continue. -:sub: +sub Subscripts Water is H\ :sub:`2`\O. -:sup: +sup Superscripts The Hydrogen in heavy water is usually :sup:`2`\H. -:i: +i Alternative voice .. role:: alternative-voice @@ -137,14 +141,14 @@ __ https://html.spec.whatwg.org/#text-level-semantics Lemonade consists primarily of :alternative-voice:`Citrus limon`. -:b: +b Keywords .. role:: b Take a :b:`lemon` and squeeze it with a :b:`juicer`. -:u: +u Annotations .. role:: spelling @@ -153,7 +157,7 @@ __ https://html.spec.whatwg.org/#text-level-semantics The mixture of apple juice and :spelling:`eldeflower` juice is very pleasant. -:mark: +mark Highlight .. role:: mark @@ -161,7 +165,7 @@ __ https://html.spec.whatwg.org/#text-level-semantics Elderflower cordial, with one :mark:`part` cordial to ten :mark:`part`\ s water, stands a\ :mark:`part` from the rest. -:bdi: +bdi Text directionality isolation [#attribute-optional]_ .. role:: bdi @@ -171,22 +175,23 @@ __ https://html.spec.whatwg.org/#text-level-semantics The `dir` global attribute defaults to "auto" (not "inherit") on this element. -:bdo: +bdo Text directionality formatting [#attribute-required]_ + .. The proposal is to write English, but in reverse order. "Juice" would become "<bdo dir=rtl>Juice</bdo>"> - Authors must specify the dir attribute on this element. + Authors *must* specify the dir attribute on this element. -:span: +span Other .. role:: language-fr In French we call it :language-fr:`sirop de sureau`. -:br: +br Line break For complete paragraphs, use a line-block: @@ -206,7 +211,7 @@ __ https://html.spec.whatwg.org/#text-level-semantics linebreaks in this paragraph according to the width of the containing block. -:wbr: +wbr Line breaking opportunity Not supported by rST. You may use a ZWSP character (u200B), literal or via @@ -222,16 +227,18 @@ __ https://html.spec.whatwg.org/#text-level-semantics .. [#attribute-required] Requires support for attributes to inline roles to make sense. +.. _TODO: http://docutils.sourceforge.net/docs/dev/todo.html#interpreted-text + Indicating Edits ---------------- -`HTML tags for representation of edits to the document`__ and their -reStructuredText equivalents. +The `HTML tags for representation of edits to the document`__ and their +reStructuredText equivalents are: -__ https://html.spec.whatwg.org/multipage/edits.html +.. class:: description -:ins: +ins Additions [#attribute-optional]_ .. role:: ins @@ -242,7 +249,7 @@ __ https://html.spec.whatwg.org/multipage/edits.html This paragraph has been inserted. -:del: +del Removed content [#attribute-optional]_ .. role:: del @@ -253,4 +260,4 @@ __ https://html.spec.whatwg.org/multipage/edits.html This paragraph has been deleted. -.. _TODO: http://docutils.sourceforge.net/docs/dev/todo.html#interpreted-text +__ https://html.spec.whatwg.org/multipage/edits.html diff --git a/docutils/test/functional/input/standalone_rst_html5.txt b/docutils/test/functional/input/standalone_rst_html5.txt index a755892ef..96755e0fc 100644 --- a/docutils/test/functional/input/standalone_rst_html5.txt +++ b/docutils/test/functional/input/standalone_rst_html5.txt @@ -6,15 +6,15 @@ .. include:: data/list_table.txt .. include:: data/custom_roles.txt -HTML specific +HTML Specific ============= .. include:: data/svg_images.txt .. include:: data/swf_images.txt -.. include:: html5-text-level-tags.txt +.. include:: data/html5-text-level-tags.txt -Changes to the html4css1 writer -=============================== +Changes to the `html4css1` Writer +================================= * Use only meta keywords recognized by HTML 5. @@ -29,177 +29,7 @@ Changes to the html4css1 writer * Put subtitles in <p> elements. -Field list handling -------------------- - -The following list demonstrates the problems with the html4css1 -approach: the `field-name-limit` setting is given in "number of -characters" but the field name uses a proportional font. - -:The field name: is typeset on the same line, unless it is "long". - -:this field name: is considered "long" in the html table rendering by - the html4css1 writer with the default setting of - ``--field-name-limit=14``. - -:iiiiiiiiiiiiiii: a field name that is considered "long" by html4css1 - with the default setting of `field-name-limit: 14`. - -:MMMMMMMMMMMMMM: a field name that is actually longer than the - previous one but regarded "short" by html4css1. - -With ``html_plain``, a `field list` is typeset as CSS-styled `definition -list`. The default layout is similar to the look with `html4css1`: - -.. class:: open - -:A long field name: sticks into the field body. - - The field body is pushed to the next line (you can suppress - this behaviour with the `run-in`_ class argument). - -:Customization: of the field name width is possible with CSS instead - of the `field-name-limit` configuration setting, for - example:: - - dl.field-list > dd { margin-left: 6em; } - -:Empty: - -:fields: must not lead to misalignment of the following content. - -Styling with class arguments ----------------------------- - -The ``plain.css`` style sheet comes with some pre-defined style variants -that can be choosen via a class argument. - -Description lists -````````````````` - -Definition lists with the "description" class argument: - -.. class:: description - -description lists - Definition lists that are styled like in most dictionaries, - encyclopedias etc. (as well as the LaTeX `description` environment). -label - The term to be described. Put in boldface. -content - Starts on the same line and has a hanging indent. - -Field list variants -``````````````````` - -For field lists, the "compact/open", "narrow" and "run-in" styles are defined -in the style sheet ``plain.css``. - -*compact* - .. class:: compact - - :Feature: No additional space between list items. - - :Option: The ``--compact-field-lists`` command line option (and the - corresponding configuration setting) set the `compact` - class argument on all "simple" field lists, if not - overridden with `open`. - - :Use: For lists with short field body. - -*open* - .. class:: open - - :Feature: Additional space between list items also in "simple" lists. - (Overrides the ``--compact-field-lists`` command line - option and the corresponding configuration setting) - - :Use: For "simple" lists that should keep the space between list items. - -*narrow* - .. class:: narrow - - :Feature: Less indented field body. - :Use: For lists with short field names. - :A long field name: - sticks into the field body and the field body starts on a - new line (if not combined with `run-in`_). - -.. _`run-in`: - -*run-in* - .. class:: run-in - - :Feature: Field body starts on the same line also after long field - names. - - :A long field name: sticks into the field body which continues on - the same line. - - :The next field name: and field body should align. Long text in the field - body is wrapped and aligns with other fields. - -Table variants -`````````````` - -The following styles can be applied to individual tables via a class -argument or as document wide setting with the table-style_ configuration -setting (or command line argument). - -* Numbered tables can be achieved with the "numbered" class option: - - .. table:: truth values - :class: numbered - - ======= ======= ========== - A B A or B - ======= ======= ========== - False False False - True False True - False True True - True True True - ======= ======= ========== - - Currently, referencing to the table by number is not supported. This is a - common request and already on the `TODO list`. - -* A table with "booktabs" class value, is rendered similar to the style - from the booktabs_ LaTeX package. - - .. _table-style: - http://docutils.sourceforge.net/docs/user/config.html#table-style - .. _booktabs: - http://tug.ctan.org/tex-archive/macros/latex/contrib/booktabs/booktabs.pdf - -"Booktabs" style table, numbered, centre-aligned, with auto-sized columns: - - .. table:: I/O values - :class: booktabs numbered - :align: center - :widths: auto - - ======= ======= ========== - Input Output - --------------- ---------- - A B A or B - ======= ======= ========== - False False False - True False True - False True True - True True True - ======= ======= ========== - -Numbered Figures -```````````````` - -Numbered figures can be achieved with the "numbered" ``:figclass:`` option: - - .. figure:: ../../../docs/user/rst/images/title.svg - :alt: reStructuredText, the markup syntax - :figclass: numbered - - SVG image in a numbered figure. - +.. include:: data/html5-features.txt .. include:: data/errors.txt |
