|
From: <mi...@us...> - 2020-09-04 16:55:29
|
Revision: 8556
http://sourceforge.net/p/docutils/code/8556
Author: milde
Date: 2020-09-04 16:55:24 +0000 (Fri, 04 Sep 2020)
Log Message:
-----------
Change the `initial_header_level`_ setting's default to "2"
Browsers use the `same style for <h1> and <h2> when it's
nested in a section`.
cf. https://stackoverflow.com/questions/39547412/same-font-size-for-h1-and-h2-in-article
Modified Paths:
--------------
trunk/docutils/FAQ.txt
trunk/docutils/HISTORY.txt
trunk/docutils/RELEASE-NOTES.txt
trunk/docutils/docs/user/config.txt
trunk/docutils/docutils/writers/html5_polyglot/__init__.py
trunk/docutils/docutils/writers/html5_polyglot/minimal.css
trunk/docutils/docutils/writers/html5_polyglot/plain.css
trunk/docutils/docutils/writers/html5_polyglot/tuftig.css
trunk/docutils/test/functional/expected/footnotes_html5.html
trunk/docutils/test/functional/expected/standalone_rst_html5.html
trunk/docutils/test/test_writers/test_html5_polyglot_parts.py
Modified: trunk/docutils/FAQ.txt
===================================================================
--- trunk/docutils/FAQ.txt 2020-09-04 16:53:11 UTC (rev 8555)
+++ trunk/docutils/FAQ.txt 2020-09-04 16:55:24 UTC (rev 8556)
@@ -995,7 +995,12 @@
(Thanks to Mark McEahern for the question and much of the answer.)
+.. note:: For the html5 writer, `initial_header_level`_ defaults to
+ ``2`` because this is what the `HTML5 standard`__ expects as
+ start value for headings nested in <section> elements.
+ __ https://www.w3.org/TR/html53/sections.html#headings-and-sections
+
How are lists formatted in HTML?
--------------------------------
Modified: trunk/docutils/HISTORY.txt
===================================================================
--- trunk/docutils/HISTORY.txt 2020-09-04 16:53:11 UTC (rev 8555)
+++ trunk/docutils/HISTORY.txt 2020-09-04 16:55:24 UTC (rev 8556)
@@ -54,6 +54,11 @@
- Use the new semantic tags <main>, <section>, <header>,
<footer>, <aside>, <figure>, and <figcaption>.
See ``minimal.css`` and ``plain.css`` for styling rule examples.
+
+ Change the `initial_header_level` setting default to "2", as browsers
+ use the `same style for <h1> and <h2> when nested in a <section>`__.
+
+ __ https://stackoverflow.com/questions/39547412/same-font-size-for-h1-and-h2-in-article
- Use HTML text-level tags <small>, <s>, <q>, <dfn>, <var>, <samp>, <kbd>,
<i>, <b>, <u>, <mark>, and <bdi> if a matching class value
Modified: trunk/docutils/RELEASE-NOTES.txt
===================================================================
--- trunk/docutils/RELEASE-NOTES.txt 2020-09-04 16:53:11 UTC (rev 8555)
+++ trunk/docutils/RELEASE-NOTES.txt 2020-09-04 16:55:24 UTC (rev 8556)
@@ -26,9 +26,6 @@
and/or ``\DUtitle`` or set to "True".
* HTML5 writer:
- Do not use <h1> for section headings when it is used for the document
- title. https://www.w3.org/wiki/HTML/Usage/Headings/h1only
-
Use <blockquote> instead of <div> tags for topics and admonitions.
* ``Node.traverse()`` will return an iterator instead of a list.
@@ -81,6 +78,9 @@
<footer>, <aside>, <figure>, and <figcaption>.
See ``minimal.css`` and ``plain.css`` for styling rule examples.
+ Change the `initial_header_level`_ setting's default to "2", as browsers
+ use the `same style for <h1> and <h2> when nested in a section`__.
+
- Use HTML text-level tags <small>, <s>, <q>, <dfn>, <var>, <samp>, <kbd>,
<i>, <b>, <u>, <mark>, and <bdi> if a matching class value
is found in `inline` and `literal` elements.
@@ -91,6 +91,11 @@
Move non-essential styling from ``minimal.css`` to ``plain.css``.
Support numbered figures in ``plain.css``.
+ .. _initial_header_level: docs/user/config.html#initial-header-level
+ __ https://stackoverflow.com/questions/39547412/same-font-size-for-h1-and-h2-in-article
+
+
+
* LaTeX writer:
- New configuration setting `legacy_class_functions`_.
Modified: trunk/docutils/docs/user/config.txt
===================================================================
--- trunk/docutils/docs/user/config.txt 2020-09-04 16:53:11 UTC (rev 8555)
+++ trunk/docutils/docs/user/config.txt 2020-09-04 16:55:24 UTC (rev 8556)
@@ -976,7 +976,9 @@
The initial level for header elements. This does not affect the
document title & subtitle; see doctitle_xform_.
-Default: 1 (for "<h1>"). Option: ``--initial-header-level``.
+Default: writer dependent (see `[html4css1 writer]`_, `[html5 writer]`_,
+`[pep_html writer]`_).
+Option: ``--initial-header-level``.
math_output
@@ -1139,7 +1141,7 @@
deactivate stylesheet inclusion.
Default: writer dependent (see `[html4css1 writer]`_, `[html5 writer]`_,
-[pep_html writer]_).
+`[pep_html writer]`_).
Options: ``--stylesheet-path``.
__ `embed_stylesheet [html writers]`_
@@ -1216,6 +1218,9 @@
Writer specific defaults:
+`initial_header_level`_
+ 1 (for "<h1>")
+
`stylesheet_path <stylesheet_path [html writers]_>`__:
"html4css1.css"
@@ -1253,15 +1258,20 @@
Writer specific defaults:
+`initial_header_level`_
+ 2 (for "<h2>", cf. the `HTML5.3 Working Draft`__)
+
`stylesheet_path <stylesheet_path [html writers]_>`__:
"minimal.css,plain.css"
New in Docutils 0.13.
+__ https://www.w3.org/TR/html53/sections.html#the-h1-h2-h3-h4-h5-and-h6-elements
.. _HTML5 Writer: html.html#html5-polyglot
.. _HTML5: http://www.w3.org/TR/html5/
+
[pep_html writer]
~~~~~~~~~~~~~~~~~
@@ -1271,6 +1281,9 @@
Writer specific defaults:
+`initial_header_level`_
+ 1 (for "<h1>")
+
`stylesheet_path <stylesheet_path [html writers]_>`__:
"pep.css"
Modified: trunk/docutils/docutils/writers/html5_polyglot/__init__.py
===================================================================
--- trunk/docutils/docutils/writers/html5_polyglot/__init__.py 2020-09-04 16:53:11 UTC (rev 8555)
+++ trunk/docutils/docutils/writers/html5_polyglot/__init__.py 2020-09-04 16:55:24 UTC (rev 8556)
@@ -12,7 +12,7 @@
# notice and this notice are preserved.
# This file is offered as-is, without any warranty.
#
-# .. _2-Clause BSD license: http://www.spdx.org/licenses/BSD-2-Clause
+# .. _2-Clause BSD license: https://opensource.org/licenses/BSD-2-Clause
# Use "best practice" as recommended by the W3C:
# http://www.w3.org/2009/cheatsheet/
@@ -82,10 +82,10 @@
{'metavar': '<dir[,dir,...]>',
'validator': frontend.validate_comma_separated_list,
'default': default_stylesheet_dirs}),
- ('Specify the initial header level. Default is 1 for "<h1>". '
+ ('Specify the initial header level. Default is 2 for "<h2>". '
'Does not affect document title & subtitle (see --no-doc-title).',
['--initial-header-level'],
- {'choices': '1 2 3 4 5 6'.split(), 'default': '1',
+ {'choices': '1 2 3 4 5 6'.split(), 'default': '2',
'metavar': '<level>'}),
('Format for footnote references: one of "superscript" or '
'"brackets". Default is "brackets".',
Modified: trunk/docutils/docutils/writers/html5_polyglot/minimal.css
===================================================================
--- trunk/docutils/docutils/writers/html5_polyglot/minimal.css 2020-09-04 16:53:11 UTC (rev 8555)
+++ trunk/docutils/docutils/writers/html5_polyglot/minimal.css 2020-09-04 16:55:24 UTC (rev 8556)
@@ -40,10 +40,10 @@
font-weight: bold;
}
h1 + p.subtitle,
-h1 + p.section-subtitle {
+h2 + p.section-subtitle {
font-size: 1.6em;
}
-h2 + p.section-subtitle {
+h3 + p.section-subtitle {
font-size: 1.28em;
}
p.subtitle,
@@ -64,7 +64,7 @@
text-decoration: none; }
/* Warnings, Errors */
-div.system-messages h1,
+div.system-messages h2,
span.problematic,
p.system-message-title {
color: red;
Modified: trunk/docutils/docutils/writers/html5_polyglot/plain.css
===================================================================
--- trunk/docutils/docutils/writers/html5_polyglot/plain.css 2020-09-04 16:53:11 UTC (rev 8555)
+++ trunk/docutils/docutils/writers/html5_polyglot/plain.css 2020-09-04 16:55:24 UTC (rev 8556)
@@ -220,7 +220,7 @@
margin-left: 1em;
}
/* Stop floating sidebars, images and figures at section level 1,2,3 */
-h1, h2, h3 { clear: both; }
+h1, h2, h3, h4 { clear: both; }
/* Numbered figures */
figure.numbered > figcaption > p:before {
Modified: trunk/docutils/docutils/writers/html5_polyglot/tuftig.css
===================================================================
--- trunk/docutils/docutils/writers/html5_polyglot/tuftig.css 2020-09-04 16:53:11 UTC (rev 8555)
+++ trunk/docutils/docutils/writers/html5_polyglot/tuftig.css 2020-09-04 16:55:24 UTC (rev 8556)
@@ -62,13 +62,13 @@
section > div.topic.contents,
section > ol,
section > ul,
-section > h3,
+section > h4,
hr.docutils {
background: GhostWhite;
box-sizing: border-box;
width: 55%; /* of max 100em ≦ 55em, ca. 90…100 characters */
}
-section > h1, section > h2 {
+section > h2, section > h3 {
width: 60% /* cf. tufte-latex */
}
section > table {
@@ -139,9 +139,9 @@
section > div.topic.contents,
section > ol,
section > ul,
- section > h3,
+ section > h4,
hr.docutils,
- section > h1, section > h2 {
+ section > h2, section > h3 {
width: 95%;
}
section > table,
@@ -171,7 +171,7 @@
/* Titles and Headings */
-h1, h2, h3, p.subtitle, p.section-subtitle,
+h2, h3, h4, p.subtitle, p.section-subtitle,
p.topic-title, p.sidebar-title, p.sidebar-subtitle {
font-weight: 400;
font-style: italic;
@@ -199,19 +199,19 @@
font-size: 2.0em;
clear: both;
}
-h1 + p.section-subtitle {
+h2 + p.section-subtitle {
font-size: 1.6em;
}
-h2 {
+h3 {
margin-top: 2em;
font-size: 1.2em;
}
-h2 + p.section-subtitle {
+h3 + p.section-subtitle {
font-size: 1.1em;
}
-h3 {
+h4 {
margin-top: 1.7em;
font-size: 1.1em;
}
Modified: trunk/docutils/test/functional/expected/footnotes_html5.html
===================================================================
--- trunk/docutils/test/functional/expected/footnotes_html5.html 2020-09-04 16:53:11 UTC (rev 8555)
+++ trunk/docutils/test/functional/expected/footnotes_html5.html 2020-09-04 16:55:24 UTC (rev 8556)
@@ -44,7 +44,7 @@
</dd>
</dl>
<section id="citations">
-<h1>Citations</h1>
+<h2>Citations</h2>
<dl class="citation">
<dt class="label" id="cit2002"><span class="brackets">CIT2002</span><span class="fn-backref">(<a href="#citation-reference-1">1</a>,<a href="#citation-reference-3">2</a>)</span></dt>
<dd><p>Citations are text-labeled footnotes. They may be
Modified: trunk/docutils/test/functional/expected/standalone_rst_html5.html
===================================================================
--- trunk/docutils/test/functional/expected/standalone_rst_html5.html 2020-09-04 16:53:11 UTC (rev 8555)
+++ trunk/docutils/test/functional/expected/standalone_rst_html5.html 2020-09-04 16:55:24 UTC (rev 8556)
@@ -165,9 +165,9 @@
</ul>
</div>
<section id="structural-elements">
-<h1><a class="toc-backref" href="#toc-entry-1"><span class="sectnum">1</span> Structural Elements</a></h1>
+<h2><a class="toc-backref" href="#toc-entry-1"><span class="sectnum">1</span> Structural Elements</a></h2>
<section id="section-title">
-<h2 class="with-subtitle"><a class="toc-backref" href="#toc-entry-2"><span class="sectnum">1.1</span> Section Title</a></h2>
+<h3 class="with-subtitle"><a class="toc-backref" href="#toc-entry-2"><span class="sectnum">1.1</span> Section Title</a></h3>
<p class="section-subtitle" id="section-subtitle">Section Subtitle</p>
<p>Lone subsections are converted to a section subtitle by a transform
activated with the <span class="docutils literal"><span class="pre">--section-subtitles</span></span> command line option or the
@@ -174,10 +174,10 @@
<span class="docutils literal"><span class="pre">sectsubtitle-xform</span></span> configuration value.</p>
</section>
<section id="empty-section">
-<h2><a class="toc-backref" href="#toc-entry-3"><span class="sectnum">1.2</span> Empty Section</a></h2>
+<h3><a class="toc-backref" href="#toc-entry-3"><span class="sectnum">1.2</span> Empty Section</a></h3>
</section>
<section id="transitions">
-<h2><a class="toc-backref" href="#toc-entry-4"><span class="sectnum">1.3</span> Transitions</a></h2>
+<h3><a class="toc-backref" href="#toc-entry-4"><span class="sectnum">1.3</span> Transitions</a></h3>
<p>Here's a transition:</p>
<hr class="docutils" />
<p>It divides the section. Transitions may also occur between sections:</p>
@@ -185,12 +185,12 @@
</section>
<hr class="docutils" />
<section id="body-elements">
-<h1><a class="toc-backref" href="#toc-entry-5"><span class="sectnum">2</span> Body Elements</a></h1>
+<h2><a class="toc-backref" href="#toc-entry-5"><span class="sectnum">2</span> Body Elements</a></h2>
<section id="paragraphs">
-<h2><a class="toc-backref" href="#toc-entry-6"><span class="sectnum">2.1</span> Paragraphs</a></h2>
+<h3><a class="toc-backref" href="#toc-entry-6"><span class="sectnum">2.1</span> Paragraphs</a></h3>
<p>A paragraph.</p>
<section id="inline-markup">
-<h3><a class="toc-backref" href="#toc-entry-7"><span class="sectnum">2.1.1</span> Inline Markup</a></h3>
+<h4><a class="toc-backref" href="#toc-entry-7"><span class="sectnum">2.1.1</span> Inline Markup</a></h4>
<p>Paragraphs contain text and may contain inline markup: <em>emphasis</em>,
<strong>strong emphasis</strong>, <span class="docutils literal">inline literals</span>, standalone hyperlinks
(<a class="reference external" href="http://www.python.org">http://www.python.org</a>), external hyperlinks (<a class="reference external" href="http://www.python.org/">Python</a> <a class="footnote-reference brackets" href="#footnote-7" id="footnote-reference-18">7</a>), internal
@@ -219,7 +219,7 @@
</section>
</section>
<section id="bullet-lists">
-<h2><a class="toc-backref" href="#toc-entry-8"><span class="sectnum">2.2</span> Bullet Lists</a></h2>
+<h3><a class="toc-backref" href="#toc-entry-8"><span class="sectnum">2.2</span> Bullet Lists</a></h3>
<ul>
<li><p>A bullet list</p>
<ul class="simple">
@@ -246,7 +246,7 @@
</ul>
</section>
<section id="enumerated-lists">
-<h2><a class="toc-backref" href="#toc-entry-9"><span class="sectnum">2.3</span> Enumerated Lists</a></h2>
+<h3><a class="toc-backref" href="#toc-entry-9"><span class="sectnum">2.3</span> Enumerated Lists</a></h3>
<ol class="arabic">
<li><p>Arabic numerals.</p>
<ol class="loweralpha simple">
@@ -282,7 +282,7 @@
</ol>
</section>
<section id="definition-lists">
-<h2><a class="toc-backref" href="#toc-entry-10"><span class="sectnum">2.4</span> Definition Lists</a></h2>
+<h3><a class="toc-backref" href="#toc-entry-10"><span class="sectnum">2.4</span> Definition Lists</a></h3>
<dl>
<dt>Term</dt>
<dd><p>Definition</p>
@@ -300,7 +300,7 @@
</dl>
</section>
<section id="field-lists">
-<h2><a class="toc-backref" href="#toc-entry-11"><span class="sectnum">2.5</span> Field Lists</a></h2>
+<h3><a class="toc-backref" href="#toc-entry-11"><span class="sectnum">2.5</span> Field Lists</a></h3>
<dl class="field-list">
<dt>what</dt>
<dd><p>Field lists map field names to field bodies, like database
@@ -320,7 +320,7 @@
</dl>
</section>
<section id="option-lists">
-<h2><a class="toc-backref" href="#toc-entry-12"><span class="sectnum">2.6</span> Option Lists</a></h2>
+<h3><a class="toc-backref" href="#toc-entry-12"><span class="sectnum">2.6</span> Option Lists</a></h3>
<p>For listing command-line options:</p>
<dl class="option-list">
<dt><kbd><span class="option">-a</span></kbd></dt>
@@ -359,7 +359,7 @@
description.</p>
</section>
<section id="literal-blocks">
-<h2><a class="toc-backref" href="#toc-entry-13"><span class="sectnum">2.7</span> Literal Blocks</a></h2>
+<h3><a class="toc-backref" href="#toc-entry-13"><span class="sectnum">2.7</span> Literal Blocks</a></h3>
<p>Literal blocks are indicated with a double-colon ("::") at the end of
the preceding paragraph (over there <span class="docutils literal"><span class="pre">--></span></span>). They can be indented:</p>
<pre class="literal-block">if literal_block:
@@ -372,7 +372,7 @@
> Why didn't I think of that?</pre>
</section>
<section id="line-blocks">
-<h2><a class="toc-backref" href="#toc-entry-14"><span class="sectnum">2.8</span> Line Blocks</a></h2>
+<h3><a class="toc-backref" href="#toc-entry-14"><span class="sectnum">2.8</span> Line Blocks</a></h3>
<p>This section tests line blocks. Line blocks are body elements which
consist of lines and other line blocks. Nested line blocks cause
indentation.</p>
@@ -446,7 +446,7 @@
</div>
</section>
<section id="block-quotes">
-<h2><a class="toc-backref" href="#toc-entry-15"><span class="sectnum">2.9</span> Block Quotes</a></h2>
+<h3><a class="toc-backref" href="#toc-entry-15"><span class="sectnum">2.9</span> Block Quotes</a></h3>
<p>Block quotes consist of indented body elements:</p>
<blockquote>
<p>My theory by A. Elk. Brackets Miss, brackets. This theory goes
@@ -465,7 +465,7 @@
</blockquote>
</section>
<section id="doctest-blocks">
-<h2><a class="toc-backref" href="#toc-entry-16"><span class="sectnum">2.10</span> Doctest Blocks</a></h2>
+<h3><a class="toc-backref" href="#toc-entry-16"><span class="sectnum">2.10</span> Doctest Blocks</a></h3>
<pre class="code python doctest">>>> print 'Python-specific usage examples; begun with ">>>"'
Python-specific usage examples; begun with ">>>"
>>> print '(cut and pasted from interactive Python sessions)'
@@ -473,7 +473,7 @@
</pre>
</section>
<section id="footnotes">
-<h2><a class="toc-backref" href="#toc-entry-17"><span class="sectnum">2.11</span> Footnotes</a></h2>
+<h3><a class="toc-backref" href="#toc-entry-17"><span class="sectnum">2.11</span> Footnotes</a></h3>
<dl class="footnote brackets">
<dt class="label" id="footnote-1"><span class="brackets">1</span><span class="fn-backref">(<a href="#footnote-reference-1">1</a>,<a href="#footnote-reference-5">2</a>,<a href="#footnote-reference-9">3</a>)</span></dt>
<dd><p>A footnote contains body elements, consistently indented by at
@@ -506,7 +506,7 @@
</dl>
</section>
<section id="citations">
-<h2><a class="toc-backref" href="#toc-entry-18"><span class="sectnum">2.12</span> Citations</a></h2>
+<h3><a class="toc-backref" href="#toc-entry-18"><span class="sectnum">2.12</span> Citations</a></h3>
<dl class="citation">
<dt class="label" id="cit2002"><span class="brackets">CIT2002</span><span class="fn-backref">(<a href="#citation-reference-1">1</a>,<a href="#citation-reference-2">2</a>)</span></dt>
<dd><p>Citations are text-labeled footnotes. They may be
@@ -517,7 +517,7 @@
citation.</p>
</section>
<section id="targets">
-<span id="another-target"></span><h2><a class="toc-backref" href="#toc-entry-19"><span class="sectnum">2.13</span> Targets</a></h2>
+<span id="another-target"></span><h3><a class="toc-backref" href="#toc-entry-19"><span class="sectnum">2.13</span> Targets</a></h3>
<p id="example">This paragraph is pointed to by the explicit "example" target. A
reference can be found under <a class="reference internal" href="#inline-markup">Inline Markup</a>, above. <a class="reference internal" href="#inline-hyperlink-targets">Inline
hyperlink targets</a> are also possible.</p>
@@ -530,13 +530,13 @@
<p>Here's a <a href="#system-message-4"><span class="problematic" id="problematic-2">`hyperlink reference without a target`_</span></a>, which generates an
error.</p>
<section id="duplicate-target-names">
-<h3><a class="toc-backref" href="#toc-entry-20"><span class="sectnum">2.13.1</span> Duplicate Target Names</a></h3>
+<h4><a class="toc-backref" href="#toc-entry-20"><span class="sectnum">2.13.1</span> Duplicate Target Names</a></h4>
<p>Duplicate names in section headers or other implicit targets will
generate "info" (level-1) system messages. Duplicate names in
explicit targets will generate "warning" (level-2) system messages.</p>
</section>
<section id="duplicate-target-names-1">
-<h3><a class="toc-backref" href="#toc-entry-21"><span class="sectnum">2.13.2</span> Duplicate Target Names</a></h3>
+<h4><a class="toc-backref" href="#toc-entry-21"><span class="sectnum">2.13.2</span> Duplicate Target Names</a></h4>
<p>Since there are two "Duplicate Target Names" section headers, we
cannot uniquely refer to either of them by name. If we try to (like
this: <a href="#system-message-5"><span class="problematic" id="problematic-3">`Duplicate Target Names`_</span></a>), an error is generated.</p>
@@ -543,7 +543,7 @@
</section>
</section>
<section id="directives">
-<h2><a class="toc-backref" href="#toc-entry-22"><span class="sectnum">2.14</span> Directives</a></h2>
+<h3><a class="toc-backref" href="#toc-entry-22"><span class="sectnum">2.14</span> Directives</a></h3>
<div class="contents local topic" id="contents">
<ul class="auto-toc simple">
<li><p><a class="reference internal" href="#document-parts" id="toc-entry-55"><span class="sectnum">2.14.1</span> Document Parts</a></p></li>
@@ -562,13 +562,13 @@
others, please see
<a class="reference external" href="http://docutils.sourceforge.net/docs/ref/rst/directives.html">http://docutils.sourceforge.net/docs/ref/rst/directives.html</a>.</p>
<section id="document-parts">
-<h3><a class="toc-backref" href="#toc-entry-55"><span class="sectnum">2.14.1</span> Document Parts</a></h3>
+<h4><a class="toc-backref" href="#toc-entry-55"><span class="sectnum">2.14.1</span> Document Parts</a></h4>
<p>An example of the "contents" directive can be seen above this section
(a local, untitled table of <a class="reference internal" href="#contents">contents</a>) and at the beginning of the
document (a document-wide <a class="reference internal" href="#table-of-contents">table of contents</a>).</p>
</section>
<section id="images-and-figures">
-<h3><a class="toc-backref" href="#toc-entry-56"><span class="sectnum">2.14.2</span> Images and Figures</a></h3>
+<h4><a class="toc-backref" href="#toc-entry-56"><span class="sectnum">2.14.2</span> Images and Figures</a></h4>
<p>An image directive (also clickable -- a hyperlink reference):</p>
<p class="image-wrapper"><a class="reference internal image-reference" href="#directives"><img alt="../../../docs/user/rst/images/title.png" class="class1 class2" src="../../../docs/user/rst/images/title.png" /></a></p>
<p>Image with multiple IDs:</p>
@@ -667,7 +667,7 @@
upon the style sheet and the browser or rendering software used.</p>
</section>
<section id="tables">
-<h3><a class="toc-backref" href="#toc-entry-57"><span class="sectnum">2.14.3</span> Tables</a></h3>
+<h4><a class="toc-backref" href="#toc-entry-57"><span class="sectnum">2.14.3</span> Tables</a></h4>
<p>Tables may be given titles and additional arguments with the <em>table</em>
directive:</p>
<table class="align-left">
@@ -761,7 +761,7 @@
</table>
</section>
<section id="admonitions">
-<h3><a class="toc-backref" href="#toc-entry-58"><span class="sectnum">2.14.4</span> Admonitions</a></h3>
+<h4><a class="toc-backref" href="#toc-entry-58"><span class="sectnum">2.14.4</span> Admonitions</a></h4>
<div class="admonition attention">
<p class="admonition-title">Attention!</p>
<p>Directives at large.</p>
@@ -810,7 +810,7 @@
</div>
</section>
<section id="topics-sidebars-and-rubrics">
-<h3><a class="toc-backref" href="#toc-entry-59"><span class="sectnum">2.14.5</span> Topics, Sidebars, and Rubrics</a></h3>
+<h4><a class="toc-backref" href="#toc-entry-59"><span class="sectnum">2.14.5</span> Topics, Sidebars, and Rubrics</a></h4>
<p><em>Sidebars</em> are like miniature, parallel documents.</p>
<aside class="sidebar">
<p class="sidebar-title">Optional Sidebar Title</p>
@@ -834,7 +834,7 @@
allowed (e.g. inside a directive).</p>
</section>
<section id="target-footnotes">
-<h3><a class="toc-backref" href="#toc-entry-60"><span class="sectnum">2.14.6</span> Target Footnotes</a></h3>
+<h4><a class="toc-backref" href="#toc-entry-60"><span class="sectnum">2.14.6</span> Target Footnotes</a></h4>
<dl class="footnote brackets">
<dt class="label" id="footnote-7"><span class="brackets">7</span><span class="fn-backref">(<a href="#footnote-reference-18">1</a>,<a href="#footnote-reference-19">2</a>,<a href="#footnote-reference-20">3</a>,<a href="#footnote-reference-25">4</a>)</span></dt>
<dd><p><a class="reference external" href="http://www.python.org/">http://www.python.org/</a></p>
@@ -863,11 +863,11 @@
</dl>
</section>
<section id="replacement-text">
-<h3><a class="toc-backref" href="#toc-entry-61"><span class="sectnum">2.14.7</span> Replacement Text</a></h3>
+<h4><a class="toc-backref" href="#toc-entry-61"><span class="sectnum">2.14.7</span> Replacement Text</a></h4>
<p>I recommend you try <a class="reference external" href="http://www.python.org/">Python, <em>the</em> best language around</a> <a class="footnote-reference brackets" href="#footnote-7" id="footnote-reference-20">7</a>.</p>
</section>
<section id="compound-paragraph">
-<h3><a class="toc-backref" href="#toc-entry-62"><span class="sectnum">2.14.8</span> Compound Paragraph</a></h3>
+<h4><a class="toc-backref" href="#toc-entry-62"><span class="sectnum">2.14.8</span> Compound Paragraph</a></h4>
<p>The <em>compound</em> directive is used to create a "compound paragraph", which
is a single logical paragraph containing multiple physical body
elements. For example:</p>
@@ -978,7 +978,7 @@
</div>
</section>
<section id="parsed-literal-blocks">
-<h3><a class="toc-backref" href="#toc-entry-63"><span class="sectnum">2.14.9</span> Parsed Literal Blocks</a></h3>
+<h4><a class="toc-backref" href="#toc-entry-63"><span class="sectnum">2.14.9</span> Parsed Literal Blocks</a></h4>
<pre class="literal-block">This is a parsed literal block.
This line is indented. The next line is blank.
@@ -988,7 +988,7 @@
footnotes <a class="footnote-reference brackets" href="#footnote-1" id="footnote-reference-9">1</a>, <span class="target" id="hyperlink-targets">hyperlink targets</span>, and <a class="reference external" href="http://www.python.org/">references</a>.</pre>
</section>
<section id="code">
-<h3><a class="toc-backref" href="#toc-entry-64"><span class="sectnum">2.14.10</span> Code</a></h3>
+<h4><a class="toc-backref" href="#toc-entry-64"><span class="sectnum">2.14.10</span> Code</a></h4>
<p>Blocks of source code can be set with the <cite>code</cite> directive. If the code
language is specified, the content is parsed and tagged by the <a class="reference external" href="http://pygments.org/">Pygments</a> <a class="footnote-reference brackets" href="#footnote-8" id="footnote-reference-21">8</a>
syntax highlighter and can be formatted with a style sheet. (Code parsing
@@ -1014,13 +1014,13 @@
</section>
</section>
<section id="substitution-definitions">
-<h2><a class="toc-backref" href="#toc-entry-33"><span class="sectnum">2.15</span> Substitution Definitions</a></h2>
+<h3><a class="toc-backref" href="#toc-entry-33"><span class="sectnum">2.15</span> Substitution Definitions</a></h3>
<p>An inline image (<img alt="EXAMPLE" src="../../../docs/user/rst/images/biohazard.png" />) example:</p>
<p>A Unicode example:</p>
<p>(Substitution definitions are not visible in the HTML source.)</p>
</section>
<section id="comments">
-<h2><a class="toc-backref" href="#toc-entry-34"><span class="sectnum">2.16</span> Comments</a></h2>
+<h3><a class="toc-backref" href="#toc-entry-34"><span class="sectnum">2.16</span> Comments</a></h3>
<p>Here's one:</p>
<!-- Comments begin with two dots and a space. Anything may
follow, except for the syntax of footnotes, hyperlink
@@ -1032,13 +1032,13 @@
<p>(View the HTML source to see the comment.)</p>
</section>
<section id="raw-text">
-<h2><a class="toc-backref" href="#toc-entry-35"><span class="sectnum">2.17</span> Raw text</a></h2>
+<h3><a class="toc-backref" href="#toc-entry-35"><span class="sectnum">2.17</span> Raw text</a></h3>
<p>This does not necessarily look nice, because there may be missing white space.</p>
<p>It's just there to freeze the behavior.</p>
A test.Second test.<div class="myclass">Another test with myclass set.</div><p>This is the <span class="myrawroleclass">fourth test</span> with myrawroleclass set.</p>
Fifth test in HTML.<br />Line two.</section>
<section id="container">
-<h2><a class="toc-backref" href="#toc-entry-36"><span class="sectnum">2.18</span> Container</a></h2>
+<h3><a class="toc-backref" href="#toc-entry-36"><span class="sectnum">2.18</span> Container</a></h3>
<div class="custom docutils container">
<p>paragraph 1</p>
<p>paragraph 2</p>
@@ -1045,7 +1045,7 @@
</div>
</section>
<section id="colspanning-tables">
-<h2><a class="toc-backref" href="#toc-entry-37"><span class="sectnum">2.19</span> Colspanning tables</a></h2>
+<h3><a class="toc-backref" href="#toc-entry-37"><span class="sectnum">2.19</span> Colspanning tables</a></h3>
<p>This table has a cell spanning two columns:</p>
<table>
<colgroup>
@@ -1083,7 +1083,7 @@
</table>
</section>
<section id="rowspanning-tables">
-<h2><a class="toc-backref" href="#toc-entry-38"><span class="sectnum">2.20</span> Rowspanning tables</a></h2>
+<h3><a class="toc-backref" href="#toc-entry-38"><span class="sectnum">2.20</span> Rowspanning tables</a></h3>
<p>Here's a table with cells spanning several rows:</p>
<table>
<colgroup>
@@ -1116,7 +1116,7 @@
</table>
</section>
<section id="complex-tables">
-<h2><a class="toc-backref" href="#toc-entry-39"><span class="sectnum">2.21</span> Complex tables</a></h2>
+<h3><a class="toc-backref" href="#toc-entry-39"><span class="sectnum">2.21</span> Complex tables</a></h3>
<p>Here's a complex table, which should test all features.</p>
<table>
<colgroup>
@@ -1165,7 +1165,7 @@
</table>
</section>
<section id="list-tables">
-<h2><a class="toc-backref" href="#toc-entry-40"><span class="sectnum">2.22</span> List Tables</a></h2>
+<h3><a class="toc-backref" href="#toc-entry-40"><span class="sectnum">2.22</span> List Tables</a></h3>
<p>Here's a list table exercising all features:</p>
<table class="colwidths-given test" style="width: 40em">
<caption>list table with integral header</caption>
@@ -1212,7 +1212,7 @@
</table>
</section>
<section id="custom-roles">
-<h2><a class="toc-backref" href="#toc-entry-41"><span class="sectnum">2.23</span> Custom Roles</a></h2>
+<h3><a class="toc-backref" href="#toc-entry-41"><span class="sectnum">2.23</span> Custom Roles</a></h3>
<ul>
<li><p>A role based on an existing role.</p>
<p><span class="custom docutils literal">one</span> <span class="custom docutils literal">two</span> <span class="custom docutils literal">three</span></p>
@@ -1241,9 +1241,9 @@
</section>
</section>
<section id="html-specific">
-<h1><a class="toc-backref" href="#toc-entry-42"><span class="sectnum">3</span> HTML specific</a></h1>
+<h2><a class="toc-backref" href="#toc-entry-42"><span class="sectnum">3</span> HTML specific</a></h2>
<section id="svg-images">
-<h2><a class="toc-backref" href="#toc-entry-43"><span class="sectnum">3.1</span> SVG Images</a></h2>
+<h3><a class="toc-backref" href="#toc-entry-43"><span class="sectnum">3.1</span> SVG Images</a></h3>
<p class="image-wrapper"><img alt="../../../docs/user/rst/images/biohazard.svg" class="align-left" src="../../../docs/user/rst/images/biohazard.svg" style="width: 48px; height: 48px;" /></p>
<p>Scalable vector graphics (SVG) images are the only standards-compliable way
to include vector graphics in HTML documents. However, they are not
@@ -1330,7 +1330,7 @@
</blockquote>
</section>
<section id="swf-images">
-<h2><a class="toc-backref" href="#toc-entry-44"><span class="sectnum">3.2</span> SWF Images</a></h2>
+<h3><a class="toc-backref" href="#toc-entry-44"><span class="sectnum">3.2</span> SWF Images</a></h3>
<p>Shockwave Flash is an image/movie format that most modern web browsers
support via a plugin. It is sometimes blocked due to privacy/security
concerns.</p>
@@ -1341,7 +1341,7 @@
<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">
-<h2><a class="toc-backref" href="#toc-entry-45"><span class="sectnum">3.3</span> Text-level semantics</a></h2>
+<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">
@@ -1546,7 +1546,7 @@
</dl>
</section>
<section id="indicating-edits">
-<h2><a class="toc-backref" href="#toc-entry-46"><span class="sectnum">3.4</span> Indicating Edits</a></h2>
+<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">
@@ -1582,7 +1582,7 @@
</section>
</section>
<section id="changes-to-the-html4css1-writer">
-<h1><a class="toc-backref" href="#toc-entry-47"><span class="sectnum">4</span> Changes to the html4css1 writer</a></h1>
+<h2><a class="toc-backref" href="#toc-entry-47"><span class="sectnum">4</span> Changes to the html4css1 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>
@@ -1593,7 +1593,7 @@
<li><p>Put subtitles in <p> elements.</p></li>
</ul>
<section id="field-list-handling">
-<h2><a class="toc-backref" href="#toc-entry-48"><span class="sectnum">4.1</span> Field list handling</a></h2>
+<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>
@@ -1637,11 +1637,11 @@
</dl>
</section>
<section id="styling-with-class-arguments">
-<h2><a class="toc-backref" href="#toc-entry-49"><span class="sectnum">4.2</span> Styling with class arguments</a></h2>
+<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">
-<h3><a class="toc-backref" href="#toc-entry-50"><span class="sectnum">4.2.1</span> Description lists</a></h3>
+<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">
<dt>description lists</dt>
@@ -1657,7 +1657,7 @@
</dl>
</section>
<section id="field-list-variants">
-<h3><a class="toc-backref" href="#toc-entry-51"><span class="sectnum">4.2.2</span> Field list variants</a></h3>
+<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 +1724,7 @@
</dl>
</section>
<section id="table-variants">
-<h3><a class="toc-backref" href="#toc-entry-52"><span class="sectnum">4.2.3</span> Table variants</a></h3>
+<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>
@@ -1804,7 +1804,7 @@
</blockquote>
</section>
<section id="numbered-figures">
-<h3><a class="toc-backref" href="#toc-entry-53"><span class="sectnum">4.2.4</span> Numbered Figures</a></h3>
+<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">
@@ -1818,7 +1818,7 @@
</section>
</section>
<section id="error-handling">
-<h1><a class="toc-backref" href="#toc-entry-54"><span class="sectnum">5</span> Error Handling</a></h1>
+<h2><a class="toc-backref" href="#toc-entry-54"><span class="sectnum">5</span> Error Handling</a></h2>
<p>Any errors caught during processing will generate system messages.</p>
<p>There should be five messages in the following, auto-generated
section, "Docutils System Messages":</p>
@@ -1825,7 +1825,7 @@
<!-- section should be added by Docutils automatically -->
</section>
<section class="system-messages">
-<h1>Docutils System Messages</h1>
+<h2>Docutils System Messages</h2>
<div class="system-message" id="system-message-1">
<p class="system-message-title">System Message: ERROR/3 (<span class="docutils literal">functional/input/data/standard.txt</span>, line 104); <em><a href="#problematic-1">backlink</a></em></p>
<p>Undefined substitution referenced: "problematic".</p>
Modified: trunk/docutils/test/test_writers/test_html5_polyglot_parts.py
===================================================================
--- trunk/docutils/test/test_writers/test_html5_polyglot_parts.py 2020-09-04 16:53:11 UTC (rev 8555)
+++ trunk/docutils/test/test_writers/test_html5_polyglot_parts.py 2020-09-04 16:55:24 UTC (rev 8556)
@@ -143,10 +143,10 @@
"""\
{'fragment': '''<p>Some stuff</p>
<section id="section">
-<h1>Section</h1>
+<h2>Section</h2>
<p>Some more stuff</p>
<section id="another-section">
-<h2>Another Section</h2>
+<h3>Another Section</h3>
<p>And even more stuff</p>
</section>
</section>\\n''',
@@ -155,10 +155,10 @@
<p class="subtitle" id="subtitle">Subtitle</p>
<p>Some stuff</p>
<section id="section">
-<h1>Section</h1>
+<h2>Section</h2>
<p>Some more stuff</p>
<section id="another-section">
-<h2>Another Section</h2>
+<h3>Another Section</h3>
<p>And even more stuff</p>
</section>
</section>
@@ -282,15 +282,15 @@
""",
"""\
{'fragment': '''<section id="title">
-<h1>Title</h1>
+<h2>Title</h2>
<section id="not-a-subtitle">
-<h2>Not A Subtitle</h2>
+<h3>Not A Subtitle</h3>
<p>Some stuff</p>
<section id="section">
-<h3>Section</h3>
+<h4>Section</h4>
<p>Some more stuff</p>
<section id="another-section">
-<h4>Another Section</h4>
+<h5>Another Section</h5>
<p>And even more stuff</p>
</section>
</section>
@@ -298,15 +298,15 @@
</section>\\n''',
'html_body': '''<main>
<section id="title">
-<h1>Title</h1>
+<h2>Title</h2>
<section id="not-a-subtitle">
-<h2>Not A Subtitle</h2>
+<h3>Not A Subtitle</h3>
<p>Some stuff</p>
<section id="section">
-<h3>Section</h3>
+<h4>Section</h4>
<p>Some more stuff</p>
<section id="another-section">
-<h4>Another Section</h4>
+<h5>Another Section</h5>
<p>And even more stuff</p>
</section>
</section>
This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site.
|