|
From: <mi...@us...> - 2019-09-19 13:59:11
|
Revision: 8396
http://sourceforge.net/p/docutils/code/8396
Author: milde
Date: 2019-09-19 13:59:09 +0000 (Thu, 19 Sep 2019)
Log Message:
-----------
HTML fixes and updates.
Remove dead code.
Remove unused class value "first" for topic-title.
Fix/update CSS stylesheets for html5 writer.
Modified Paths:
--------------
trunk/docutils/docutils/writers/_html_base.py
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/test/functional/expected/pep_html.html
trunk/docutils/test/functional/expected/standalone_rst_html4css1.html
trunk/docutils/test/functional/expected/standalone_rst_html5.html
trunk/docutils/test/functional/expected/standalone_rst_s5_html_1.html
trunk/docutils/test/functional/expected/standalone_rst_s5_html_2.html
trunk/docutils/test/functional/input/standalone_rst_html5.txt
Modified: trunk/docutils/docutils/writers/_html_base.py
===================================================================
--- trunk/docutils/docutils/writers/_html_base.py 2019-09-18 10:13:40 UTC (rev 8395)
+++ trunk/docutils/docutils/writers/_html_base.py 2019-09-19 13:59:09 UTC (rev 8396)
@@ -1514,11 +1514,10 @@
def visit_title(self, node):
"""Only 6 section levels are supported by HTML."""
- check_id = 0 # TODO: is this a bool (False) or a counter?
close_tag = '</p>\n'
if isinstance(node.parent, nodes.topic):
self.body.append(
- self.starttag(node, 'p', '', CLASS='topic-title first'))
+ self.starttag(node, 'p', '', CLASS='topic-title'))
elif isinstance(node.parent, nodes.sidebar):
self.body.append(
self.starttag(node, 'p', '', CLASS='sidebar-title'))
Modified: trunk/docutils/docutils/writers/html5_polyglot/__init__.py
===================================================================
--- trunk/docutils/docutils/writers/html5_polyglot/__init__.py 2019-09-18 10:13:40 UTC (rev 8395)
+++ trunk/docutils/docutils/writers/html5_polyglot/__init__.py 2019-09-19 13:59:09 UTC (rev 8396)
@@ -217,7 +217,3 @@
# TODO: use the new HTML5 element <section>?
# def visit_section(self, node):
# def depart_section(self, node):
-
- # TODO: use the new HTML5 element <aside>?
- # def visit_topic(self, node):
- # def depart_topic(self, node):
Modified: trunk/docutils/docutils/writers/html5_polyglot/minimal.css
===================================================================
--- trunk/docutils/docutils/writers/html5_polyglot/minimal.css 2019-09-18 10:13:40 UTC (rev 8395)
+++ trunk/docutils/docutils/writers/html5_polyglot/minimal.css 2019-09-19 13:59:09 UTC (rev 8396)
@@ -32,10 +32,10 @@
h1.title, p.subtitle {
text-align: center;
}
-p.admonition-title,
p.topic-title,
p.sidebar-title,
p.rubric,
+p.admonition-title,
p.system-message-title {
font-weight: bold;
}
@@ -93,7 +93,7 @@
}
/* Table of Contents */
-div.topic.contents { margin: 0; }
+div.topic.contents { margin: 0.5em 0; }
div.topic.contents ul {
list-style-type: none;
padding-left: 1.5em;
@@ -152,7 +152,7 @@
dd.authors > p { margin: 0; }
/* Option Lists */
-dl.option-list { margin-left: 40px; }
+dl.option-list { margin-left: 1.5em; }
dl.option-list > dt { font-weight: normal; }
span.option { white-space: nowrap; }
@@ -189,11 +189,7 @@
}
.figure.align-center,
img.align-center,
-object.align-center {
- margin-left: auto;
- margin-right: auto;
- display: block;
-}
+object.align-center,
table.align-center {
margin-left: auto;
margin-right: auto;
@@ -204,6 +200,11 @@
table.align-right {
margin-left: auto;
}
+.figure.align-center, .figure.align-right,
+img.align-center, img.align-right,
+object.align-center, object.align-right {
+ display: block;
+}
/* reset inner alignment in figures and tables */
/* div.align-left, div.align-center, div.align-right, */
table.align-left, table.align-center, table.align-right
@@ -212,15 +213,19 @@
/* Admonitions and System Messages */
div.admonition,
div.system-message,
-div.sidebar{
- margin: 40px;
+div.sidebar,
+aside.sidebar {
+ margin: 1em 1.5em;
border: medium outset;
+ padding-top: 0.5em;
+ padding-bottom: 0.5em;
padding-right: 1em;
padding-left: 1em;
}
/* Sidebar */
-div.sidebar {
+div.sidebar,
+aside.sidebar {
width: 30%;
max-width: 26em;
float: right;
@@ -235,13 +240,8 @@
pre.math,
pre.code {
margin-left: 1.5em;
- margin-right: 1.5em
+ margin-right: 1.5em;
}
-pre.literal-block,
-pre.doctest-block,
-pre.math,
-pre.code {
- font-family: monospace;
pre.code .ln { color: gray; } /* line numbers */
/* Tables */
@@ -265,3 +265,14 @@
padding: 0;
padding-right: 0.5em /* separate table cells */
}
+
+/* Document Header and Footer */
+/* div.header, */
+/* header { border-bottom: 1px solid black; } */
+/* div.footer, */
+/* footer { border-top: 1px solid black; } */
+
+/* new HTML5 block elements: set display for older browsers */
+header, section, footer, aside, nav, main, article, figure {
+ display: block;
+}
Modified: trunk/docutils/docutils/writers/html5_polyglot/plain.css
===================================================================
--- trunk/docutils/docutils/writers/html5_polyglot/plain.css 2019-09-18 10:13:40 UTC (rev 8395)
+++ trunk/docutils/docutils/writers/html5_polyglot/plain.css 2019-09-19 13:59:09 UTC (rev 8396)
@@ -48,32 +48,33 @@
clear: both;
}
-/* Paragraphs */
-/* ========== */
+/* Paragraphs */
+/* ========== */
/* vertical space (parskip) */
p, ol, ul, dl,
div.line-block,
-table{
+div.topic,
+table {
margin-top: 0.5em;
margin-bottom: 0.5em;
}
+p:first-child { margin-top: 0; }
+/* (:last-child is new in CSS 3) */
+p:last-child { margin-bottom: 0; }
+
h1, h2, h3, h4, h5, h6,
dl > dd {
margin-bottom: 0.5em;
}
-/* Lists */
-/* ========== */
+/* Lists */
+/* ===== */
-/* Definition Lists */
+/* Definition Lists */
-dl > dd > p:first-child { margin-top: 0; }
-/* :last-child is not part of CSS 2.1 (introduced in CSS 3) */
-dl > dd > p:last-child { margin-bottom: 0; }
-
/* lists nested in definition lists */
-/* :only-child is not part of CSS 2.1 (introduced in CSS 3) */
+/* (:only-child is new in CSS 3) */
dd > ul:only-child, dd > ol:only-child { padding-left: 1em; }
/* Description Lists */
@@ -122,13 +123,20 @@
font-weight: normal;
}
-/* Text Blocks */
-/* ============ */
+/* Text Blocks */
+/* =========== */
-/* Literal Blocks */
+/* Literal Blocks */
-/* Block Quotes */
+pre.literal-block,
+pre.doctest-block,
+pre.math,
+pre.code {
+ font-family: monospace;
+}
+/* Block Quotes */
+
blockquote > table,
div.topic > table {
margin-top: 0;
@@ -140,8 +148,8 @@
margin-left: 20%;
}
-/* Tables */
-/* ====== */
+/* Tables */
+/* ====== */
/* th { vertical-align: bottom; } */
@@ -168,11 +176,11 @@
font-weight: bold;
}
-/* Explicit Markup Blocks */
-/* ====================== */
+/* Explicit Markup Blocks */
+/* ====================== */
-/* Footnotes and Citations */
-/* ----------------------- */
+/* Footnotes and Citations */
+/* ----------------------- */
/* line on the left */
dl.footnote {
@@ -181,11 +189,11 @@
border-left-width: thin;
}
-/* Directives */
-/* ---------- */
+/* Directives */
+/* ---------- */
-/* Body Elements */
-/* ~~~~~~~~~~~~~ */
+/* Body Elements */
+/* ~~~~~~~~~~~~~ */
/* Images and Figures */
@@ -211,13 +219,13 @@
/* Sidebar */
-/* Move into the margin. In a layout with fixed margins, */
-/* it can be moved into the margin completely. */
+/* Move right. In a layout with fixed margins, */
+/* it can be moved into the margin. */
div.sidebar {
width: 30%;
max-width: 26em;
margin-left: 1em;
- margin-right: -5.5%;
+ margin-right: -2%;
background-color: #ffffee ;
}
@@ -238,44 +246,49 @@
/* Math */
/* styled separately (see math.css for math-output=HTML) */
-/* Epigraph */
-/* Highlights */
-/* Pull-Quote */
-/* Compound Paragraph */
-/* Container */
+/* Epigraph */
+/* Highlights */
+/* Pull-Quote */
+/* Compound Paragraph */
+/* Container */
/* can be styled in a custom stylesheet */
/* Document Header and Footer */
+footer, header,
div.footer, div.header {
+ font-size: smaller;
clear: both;
- font-size: smaller;
+ padding: 0.5em 2%;
+ background-color: #ebebee;
+ border: none;
}
-/* Inline Markup */
-/* ============= */
+/* Inline Markup */
+/* ============= */
-/* Emphasis */
-/* em */
-/* Strong Emphasis */
-/* strong */
-/* Interpreted Text */
-/* span.interpreted */
-/* Title Reference */
-/* cite */
-/* Inline Literals */
+/* Emphasis */
+/* em */
+/* Strong Emphasis */
+/* strong */
+/* Interpreted Text */
+/* span.interpreted */
+/* Title Reference */
+/* cite */
+
+/* Inline Literals */
/* possible values: normal, nowrap, pre, pre-wrap, pre-line */
-/* span.docutils.literal { white-space: pre-wrap; } */
+/* span.docutils.literal { white-space: pre-wrap; } */
-/* Hyperlink References */
+/* Hyperlink References */
a { text-decoration: none; }
-/* External Targets */
-/* span.target.external */
-/* Internal Targets */
-/* span.target.internal */
-/* Footnote References */
-/* a.footnote-reference */
-/* Citation References */
-/* a.citation-reference */
+/* External Targets */
+/* span.target.external */
+/* Internal Targets */
+/* span.target.internal */
+/* Footnote References */
+/* a.footnote-reference */
+/* Citation References */
+/* a.citation-reference */
Modified: trunk/docutils/test/functional/expected/pep_html.html
===================================================================
--- trunk/docutils/test/functional/expected/pep_html.html 2019-09-18 10:13:40 UTC (rev 8395)
+++ trunk/docutils/test/functional/expected/pep_html.html 2019-09-19 13:59:09 UTC (rev 8396)
@@ -55,7 +55,7 @@
</table>
<hr />
<div class="contents topic" id="contents">
-<p class="topic-title first">Contents</p>
+<p class="topic-title">Contents</p>
<ul class="simple">
<li><a class="reference internal" href="#abstract" id="id5">Abstract</a></li>
<li><a class="reference internal" href="#copyright" id="id6">Copyright</a></li>
Modified: trunk/docutils/test/functional/expected/standalone_rst_html4css1.html
===================================================================
--- trunk/docutils/test/functional/expected/standalone_rst_html4css1.html 2019-09-18 10:13:40 UTC (rev 8395)
+++ trunk/docutils/test/functional/expected/standalone_rst_html4css1.html 2019-09-19 13:59:09 UTC (rev 8396)
@@ -70,11 +70,11 @@
</tbody>
</table>
<div class="dedication topic">
-<p class="topic-title first">Dedication</p>
+<p class="topic-title">Dedication</p>
<p>For Docutils users & co-developers.</p>
</div>
<div class="abstract topic">
-<p class="topic-title first">Abstract</p>
+<p class="topic-title">Abstract</p>
<p>This is a test document, containing at least one example of each
reStructuredText construct.</p>
</div>
@@ -84,7 +84,7 @@
They are transformed from section titles after parsing. -->
<!-- bibliographic fields (which also require a transform): -->
<div class="contents topic" id="table-of-contents">
-<p class="topic-title first">Table of Contents</p>
+<p class="topic-title">Table of Contents</p>
<ul class="auto-toc simple">
<li><a class="reference internal" href="#structural-elements" id="id34">1 Structural Elements</a><ul class="auto-toc">
<li><a class="reference internal" href="#section-title" id="id35">1.1 Section Title</a></li>
@@ -819,7 +819,7 @@
<p>A <em>topic</em> is like a block quote with a title, or a self-contained section
with no subsections.</p>
<div class="topic">
-<p class="topic-title first">Topic Title</p>
+<p class="topic-title">Topic Title</p>
<p>This is a topic.</p>
</div>
<p>A <em>rubric</em> is like an informal heading that doesn't correspond to the
Modified: trunk/docutils/test/functional/expected/standalone_rst_html5.html
===================================================================
--- trunk/docutils/test/functional/expected/standalone_rst_html5.html 2019-09-18 10:13:40 UTC (rev 8395)
+++ trunk/docutils/test/functional/expected/standalone_rst_html5.html 2019-09-19 13:59:09 UTC (rev 8396)
@@ -70,11 +70,11 @@
</dd>
</dl>
<div class="dedication topic">
-<p class="topic-title first">Dedication</p>
+<p class="topic-title">Dedication</p>
<p>For Docutils users & co-developers.</p>
</div>
<div class="abstract topic">
-<p class="topic-title first">Abstract</p>
+<p class="topic-title">Abstract</p>
<p>This is a test document, containing at least one example of each
reStructuredText construct.</p>
</div>
@@ -84,7 +84,7 @@
They are transformed from section titles after parsing. -->
<!-- bibliographic fields (which also require a transform): -->
<div class="contents topic" id="table-of-contents">
-<p class="topic-title first">Table of Contents</p>
+<p class="topic-title">Table of Contents</p>
<ul class="auto-toc simple">
<li><p><a class="reference internal" href="#structural-elements" id="id38"><span class="sectnum">1</span> Structural Elements</a></p>
<ul class="auto-toc">
@@ -806,7 +806,7 @@
<p>A <em>topic</em> is like a block quote with a title, or a self-contained section
with no subsections.</p>
<div class="topic">
-<p class="topic-title first">Topic Title</p>
+<p class="topic-title">Topic Title</p>
<p>This is a topic.</p>
</div>
<p>A <em>rubric</em> is like an informal heading that doesn't correspond to the
@@ -1387,7 +1387,8 @@
</div>
<div class="section" id="field-list-variants">
<h3><a class="toc-backref" href="#id84"><span class="sectnum">3.2.2</span> Field list variants</a></h3>
-<p>For field lists, the "compact/open", "narrow" and "run-in" styles are defined.</p>
+<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">
<dt><em>compact</em></dt>
<dd><dl class="compact field-list simple">
@@ -1567,7 +1568,7 @@
<div class="footer">
<hr class="footer" />
<p>Document footer</p>
-<p><a class="reference external" href="http://www.w3.org/TR/html5/"><img alt="Conforms to HTML 5" src="http://www.w3.org/html/logo/badge/html5-badge-h-css3-semantics.png" style="width: 88px; height: 31px;" /></a> <a class="reference external" href="http://validator.w3.org/check?uri=referer"><img alt="Check validity!" src="https://validator-suite.w3.org/icons/vs-blue-256.png" style="width: 88px; height: 31px;" /></a> <a class="reference external" href="http://jigsaw.w3.org/css-validator/check/referer"><img alt="Valid CSS 2.1!" src="http://jigsaw.w3.org/css-validator/images/vcss" style="width: 88px; height: 31px;" /></a></p>
+<p><a class="reference external" href="http://www.w3.org/TR/html5/"><img alt="Conforms to HTML 5" src="http://www.w3.org/html/logo/badge/html5-badge-h-css3-semantics.png" style="width: 88px; height: 31px;" /></a> <a class="reference external" href="http://validator.w3.org/check?uri=referer"><img alt="Check validity!" src="https://www.w3.org/Icons/ValidatorSuite/vs-blue-190.png" style="width: 88px; height: 31px;" /></a> <a class="reference external" href="http://jigsaw.w3.org/css-validator/check/referer"><img alt="Valid CSS 2.1!" src="http://jigsaw.w3.org/css-validator/images/vcss" style="width: 88px; height: 31px;" /></a></p>
</div>
</body>
Modified: trunk/docutils/test/functional/expected/standalone_rst_s5_html_1.html
===================================================================
--- trunk/docutils/test/functional/expected/standalone_rst_s5_html_1.html 2019-09-18 10:13:40 UTC (rev 8395)
+++ trunk/docutils/test/functional/expected/standalone_rst_s5_html_1.html 2019-09-19 13:59:09 UTC (rev 8396)
@@ -69,7 +69,7 @@
<!-- Incremental Display
=================== -->
<div class="contents handout topic" id="contents">
-<p class="topic-title first">Contents</p>
+<p class="topic-title">Contents</p>
<ul class="simple">
<li><a class="reference internal" href="#introduction" id="id1">Introduction</a></li>
<li><a class="reference internal" href="#features-1" id="id2">Features (1)</a></li>
Modified: trunk/docutils/test/functional/expected/standalone_rst_s5_html_2.html
===================================================================
--- trunk/docutils/test/functional/expected/standalone_rst_s5_html_2.html 2019-09-18 10:13:40 UTC (rev 8395)
+++ trunk/docutils/test/functional/expected/standalone_rst_s5_html_2.html 2019-09-19 13:59:09 UTC (rev 8396)
@@ -65,7 +65,7 @@
<!-- Incremental Display
=================== -->
<div class="contents handout topic" id="contents">
-<p class="topic-title first">Contents</p>
+<p class="topic-title">Contents</p>
<ul class="simple">
<li><a class="reference internal" href="#introduction" id="id1">Introduction</a></li>
<li><a class="reference internal" href="#features-1" id="id2">Features (1)</a></li>
Modified: trunk/docutils/test/functional/input/standalone_rst_html5.txt
===================================================================
--- trunk/docutils/test/functional/input/standalone_rst_html5.txt 2019-09-18 10:13:40 UTC (rev 8395)
+++ trunk/docutils/test/functional/input/standalone_rst_html5.txt 2019-09-19 13:59:09 UTC (rev 8396)
@@ -87,7 +87,8 @@
Field list variants
```````````````````
-For field lists, the "compact/open", "narrow" and "run-in" styles are defined.
+For field lists, the "compact/open", "narrow" and "run-in" styles are defined
+in the style sheet ``plain.css``.
*compact*
.. class:: compact
@@ -194,7 +195,7 @@
:alt: Conforms to HTML 5
:target: http://www.w3.org/TR/html5/
-.. |validator| image:: https://validator-suite.w3.org/icons/vs-blue-256.png
+.. |validator| image:: https://www.w3.org/Icons/ValidatorSuite/vs-blue-190.png
:height: 31
:width: 88
:alt: Check validity!
This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site.
|