diff options
| author | milde <milde@929543f6-e4f2-0310-98a6-ba3bd3dd1d04> | 2021-05-27 15:06:51 +0000 |
|---|---|---|
| committer | milde <milde@929543f6-e4f2-0310-98a6-ba3bd3dd1d04> | 2021-05-27 15:06:51 +0000 |
| commit | 0c0aee2cff28cb9b820e45f8f1e0853b4e666ac6 (patch) | |
| tree | ad2b79d20af26d2c1b7780b7a70c645b280dac2e /docutils | |
| parent | 79979e5d4aeb3dd4088c513faa3e5d22e2a3bf12 (diff) | |
| download | docutils-0c0aee2cff28cb9b820e45f8f1e0853b4e666ac6.tar.gz | |
Minor documentation update.
git-svn-id: https://svn.code.sf.net/p/docutils/code/trunk@8759 929543f6-e4f2-0310-98a6-ba3bd3dd1d04
Diffstat (limited to 'docutils')
| -rw-r--r-- | docutils/FAQ.txt | 12 | ||||
| -rw-r--r-- | docutils/docs/user/config.txt | 2 | ||||
| -rw-r--r-- | docutils/docutils/writers/_html_base.py | 6 |
3 files changed, 18 insertions, 2 deletions
diff --git a/docutils/FAQ.txt b/docutils/FAQ.txt index 0c9eac368..0e9631000 100644 --- a/docutils/FAQ.txt +++ b/docutils/FAQ.txt @@ -983,10 +983,22 @@ without H2). .. 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. + + .. Sectioning content elements are always considered subsections of + their nearest ancestor *sectioning root* [#]_ or their nearest + ancestor element of *sectioning content* [#]_, whichever is nearest, + [...] + + .. [#] <blockquote>, <body>, <details>, <dialog>, <fieldset>, + <figure>, <td> + .. [#] <article>, <aside>, <nav>, <section> + + I.e., a top-level <section> is a subsection of <body>. __ https://www.w3.org/TR/html53/sections.html#headings-and-sections + How are lists formatted in HTML? -------------------------------- diff --git a/docutils/docs/user/config.txt b/docutils/docs/user/config.txt index 3d2470b98..a6e169a42 100644 --- a/docutils/docs/user/config.txt +++ b/docutils/docs/user/config.txt @@ -1106,7 +1106,7 @@ the output document. Supported values are (case insensitive): "align" (or other equation-aligning) environment. (C++) LaTeXML_ - Comprehensive macro support but very slow. (Perl) + Comprehensive macro support but *very* slow. (Perl) TtM_ No "matrix", "align" and "cases" environments. Support may be removed. diff --git a/docutils/docutils/writers/_html_base.py b/docutils/docutils/writers/_html_base.py index ab3ea8515..58fd663f8 100644 --- a/docutils/docutils/writers/_html_base.py +++ b/docutils/docutils/writers/_html_base.py @@ -880,7 +880,7 @@ class HTMLTranslator(nodes.NodeVisitor): def visit_field_list(self, node): atts = {} - classes = node.setdefault('classes', []) + classes = node.setdefault('classes', []) for i, cls in enumerate(classes): if cls.startswith('field-indent-'): try: @@ -1628,9 +1628,11 @@ class HTMLTranslator(nodes.NodeVisitor): if isinstance(node.parent, nodes.topic): self.body.append( self.starttag(node, 'p', '', CLASS='topic-title')) + # TODO: use role="heading" or <h1>? (HTML5 only) elif isinstance(node.parent, nodes.sidebar): self.body.append( self.starttag(node, 'p', '', CLASS='sidebar-title')) + # TODO: use role="heading" or <h1>? (HTML5 only) elif isinstance(node.parent, nodes.Admonition): self.body.append( self.starttag(node, 'p', '', CLASS='admonition-title')) @@ -1645,6 +1647,8 @@ class HTMLTranslator(nodes.NodeVisitor): else: assert isinstance(node.parent, nodes.section) h_level = self.section_level + self.initial_header_level - 1 + # TODO: use '<h6 aria-level="%s">' % h_level + # for h_level > 6 (HTML5 only) atts = {} if (len(node.parent) >= 2 and isinstance(node.parent[1], nodes.subtitle)): |
