|
From: <mi...@us...> - 2015-03-10 17:56:49
|
Revision: 7818
http://sourceforge.net/p/docutils/code/7818
Author: milde
Date: 2015-03-10 17:56:46 +0000 (Tue, 10 Mar 2015)
Log Message:
-----------
Base xhtml11 writer on html-base. Adapt and fix tests.
Modified Paths:
--------------
trunk/docutils/docutils/writers/html_base/__init__.py
trunk/docutils/docutils/writers/xhtml11/__init__.py
trunk/docutils/test/functional/expected/math_output_mathml.xhtml
trunk/docutils/test/functional/expected/standalone_rst_html_base.html
trunk/docutils/test/functional/expected/standalone_rst_xhtml11.xhtml
trunk/docutils/test/functional/input/data/html-base.css
trunk/docutils/test/functional/input/standalone_rst_xhtml11.txt
trunk/docutils/test/functional/tests/math_output_mathml.py
trunk/docutils/test/functional/tests/standalone_rst_xhtml11.py
trunk/docutils/tools/rst2html5.py
trunk/docutils/tools/rst2xhtml11.py
Added Paths:
-----------
trunk/docutils/docutils/writers/html_base/html-base.css
trunk/docutils/test/functional/input/data/html4css1.css
Removed Paths:
-------------
trunk/docutils/docutils/writers/xhtml11/html-base.css
trunk/docutils/test/functional/input/data/html4css1.css
Modified: trunk/docutils/docutils/writers/html_base/__init__.py
===================================================================
--- trunk/docutils/docutils/writers/html_base/__init__.py 2015-03-10 15:11:37 UTC (rev 7817)
+++ trunk/docutils/docutils/writers/html_base/__init__.py 2015-03-10 17:56:46 UTC (rev 7818)
@@ -136,10 +136,14 @@
'or "LaTeX") and options(s). Default: "HTML math.css"',
['--math-output'],
{'default': 'HTML math.css'}),
- ('Omit the XML declaration. Must be true for HTML5 conformance.',
+ ('Prepend an XML declaration. (Thwarts HTML5 conformance.) '
+ 'Default: False',
+ ['--xml-declaration'],
+ {'default': False, 'action': 'store_true',
+ 'validator': frontend.validate_boolean}),
+ ('Omit the XML declaration.',
['--no-xml-declaration'],
- {'dest': 'xml_declaration', 'default': False,
- 'action': 'store_false', 'validator': frontend.validate_boolean}),
+ {'dest': 'xml_declaration', 'action': 'store_false'}),
('Obfuscate email addresses to confuse harvesters while still '
'keeping email links usable with standards-compliant browsers.',
['--cloak-email-addresses'],
@@ -208,8 +212,8 @@
' xml:lang="%(lang)s" lang="%(lang)s">\n<head>\n')
content_type = ('<meta http-equiv="Content-Type"'
' content="text/html; charset=%s" />\n')
- content_type_mathml = ('<meta http-equiv="Content-Type"'
- ' content="text/html; charset=%s" />\n')
+ content_type_xml = ('<meta http-equiv="Content-Type"'
+ ' content="application/xhtml+xml; charset=%s" />\n')
generator = ('<meta name="generator" content="Docutils %s: '
'http://docutils.sourceforge.net/" />\n')
@@ -240,6 +244,7 @@
if settings.xml_declaration:
self.head_prefix.append(self.xml_declaration
% settings.output_encoding)
+ self.content_type = self.content_type_xml
# encoding not interpolated:
self.html_prolog.append(self.xml_declaration)
self.head = self.meta[:]
@@ -831,18 +836,11 @@
atts['start'] = node['start']
if 'enumtype' in node:
atts['class'] = node['enumtype']
- # @@@ To do: prefix, suffix. How? Change prefix/suffix to a
- # single "format" attribute? Use CSS2?
- old_compact_simple = self.compact_simple
- self.context.append((self.compact_simple, self.compact_p))
- self.compact_p = None
- self.compact_simple = self.is_compactable(node)
- if self.compact_simple and not old_compact_simple:
+ if self.is_compactable(node):
atts['class'] = (atts.get('class', '') + ' simple').strip()
self.body.append(self.starttag(node, 'ol', **atts))
def depart_enumerated_list(self, node):
- self.compact_simple, self.compact_p = self.context.pop()
self.body.append('</ol>\n')
# field-list
@@ -1192,7 +1190,7 @@
math_code = math2html.math2html(math_code)
elif self.math_output == 'mathml':
self.doctype = self.doctype_mathml
- self.content_type = self.content_type_mathml
+ # self.content_type = self.content_type_mathml
try:
mathml_tree = parse_latex_math(math_code, inline=not(math_env))
math_code = ''.join(mathml_tree.xml())
Copied: trunk/docutils/docutils/writers/html_base/html-base.css (from rev 7814, trunk/docutils/docutils/writers/xhtml11/html-base.css)
===================================================================
--- trunk/docutils/docutils/writers/html_base/html-base.css (rev 0)
+++ trunk/docutils/docutils/writers/html_base/html-base.css 2015-03-10 17:56:46 UTC (rev 7818)
@@ -0,0 +1,508 @@
+/* Basic style sheet for the HTML output of Docutils. */
+/* */
+/* :Author: Günter Milde, based on html4css1.css by David Goodger */
+/* :Id: $Id$ */
+/* :Copyright: © 2015 Günter Milde. */
+/* :License: Released under the terms of the `2-Clause BSD license`_, */
+/* in short: */
+/* */
+/* Copying and distribution of this file, with or without modification, */
+/* are permitted in any medium without royalty provided the copyright */
+/* 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 */
+
+
+/* This stylesheet contains basic rules for the output of the */
+/* Docutils HTML writers. It validates_ as CSS2.1_ */
+/* */
+/* .. _CSS2.1: http://www.w3.org/TR/CSS2 */
+/* .. _validates: http://jigsaw.w3.org/css-validator/validator$link */
+
+
+/* Document Structure */
+/* ****************** */
+
+/* Document */
+
+body {
+ padding: 0 5%;
+ margin: 8px 0;
+}
+
+div.document {
+ line-height:1.3;
+ counter-reset: table;
+ /* counter-reset: figure; */
+ /* avoid long lines --> better reading */
+ /* OTOH: lines should not be too short because of missing hyphenation, */
+ max-width: 50em;
+ margin: auto;
+}
+
+.align-left { text-align: left; }
+.align-right { text-align: right; }
+.align-center {
+ clear: both;
+ text-align: center;
+}
+
+/* Sections */
+
+h1.title, p.subtitle {
+ text-align: center;
+}
+
+h1 + p.subtitle { font-size: 1.6em; }
+h1 + p.section-subtitle { font-size: 1.6em; }
+h2 + p.section-subtitle { font-size: 1.28em; }
+
+a.toc-backref {
+ color: black;
+ text-decoration: none;
+}
+
+/* Stop floating sidebars, images and figures at section level 1,2,3 */
+h1, h2, h3 { clear: both; }
+
+/* Transitions */
+
+hr.docutils {
+ width: 80%;
+ margin-top: 1em;
+ margin-bottom: 1em;
+}
+
+/* Paragraphs */
+/* ========== */
+
+/* vertical space (parskip) */
+p, ol, ul, dl,
+div.line-block,
+table{
+ margin-top: 0.5em;
+ margin-bottom: 0.5em;
+}
+h1, h2, h3, h4, h5, h6,
+dl > dd {
+ margin-bottom: 0.5em;
+}
+
+/* titles */
+p.admonition-title,
+p.topic-title,
+p.sidebar-title,
+p.system-message-title {
+ font-weight: bold;
+}
+
+p.subtitle,
+p.section-subtitle,
+p.sidebar-subtitle {
+ font-weight: bold;
+ margin-top: -0.5em;
+}
+
+
+/* Warnings, Errors */
+div.caution p.admonition-title,
+div.attention p.admonition-title,
+div.danger p.admonition-title,
+div.error p.admonition-title,
+div.warning p.admonition-title,
+div.system-messages h1,
+div.error,
+span.problematic,
+p.system-message-title {
+ color: red;
+}
+
+/* Lists */
+/* ========== */
+
+/* compact and simple lists: no margin between items */
+dl.simple > dd, dl.compact > dd,
+.compact li, .compact ul, .compact ol
+.simple li, .simple ul, .simple ol,
+.simple > li p, .compact > li p {
+ margin-top: 0;
+ margin-bottom: 0;
+}
+
+/* Enumerated Lists */
+
+ol.arabic { list-style: decimal }
+ol.loweralpha { list-style: lower-alpha }
+ol.upperalpha { list-style: upper-alpha }
+ol.lowerroman { list-style: lower-roman }
+ol.upperroman { list-style: upper-roman }
+
+/* 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 */
+dd > ul, dd > ol { padding-left: 0pt; }
+
+dt span.classifier { font-style: italic }
+dt span.classifier:before {
+ font-style: normal;
+ margin: 0.5em;
+ content: ":";
+}
+
+/* Field Lists */
+
+/* bold field name, content starts on the same line */
+dl.field-list > dt,
+dl.option-list > dt,
+dl.docinfo > dt,
+dl.footnote > dt,
+dl.citation > dt,
+dl.description > dt {
+ font-weight: bold;
+ clear: left;
+ float: left;
+ margin: 0;
+ padding: 0;
+ padding-right: 0.5em;
+}
+/* Offset for field content (corresponds to the --field-name-limit option) */
+dl.field-list > dd,
+dl.option-list > dd,
+dl.docinfo > dd {
+ margin-left: 9em; /* ca. 14 chars in the test examples */
+/* padding-left: 0.5em; */
+}
+/* start field-body on a new line after long field names */
+dl.field-list > dd > *:first-child,
+dl.option-list > dd > *:first-child,
+dl.docinfo > dd > *:first-child {
+ display: inline-block;
+ width: 100%;
+ margin: 0;
+}
+/* field names followed by a colon */
+dl.field-list > dt:after,
+dl.docinfo > dt:after {
+ content: ":";
+}
+
+/* example for custom field-name width */
+dl.field-list.narrow > dd {
+ margin-left: 5em;
+}
+/* run-in: start field-body on same line after long field names */
+dl.field-list.run-in > dd p {
+ display: block;
+}
+
+/* Bibliographic Fields */
+
+/* use special field-list dl.docinfo */
+
+pre.address {
+ margin-bottom: 0;
+ margin-top: 0;
+ font: inherit;
+}
+dd.authors > p { margin: 0; }
+
+div.abstract p.topic-title {
+ text-align: center;
+}
+
+div.dedication {
+ margin: 2em 5em;
+ text-align: center;
+ font-style: italic;
+}
+div.dedication p.topic-title {
+ font-style: normal;
+}
+
+/* Option Lists */
+
+dl.option-list {
+ margin-left: 1em;
+}
+dl.option-list > dt {
+ font-weight: normal;
+}
+span.option {
+ white-space: nowrap;
+}
+
+/* Text Blocks */
+/* ============ */
+
+/* Line Blocks */
+
+div.line-block {
+ display: block;
+}
+div.line-block div.line-block {
+ margin-top: 0;
+ margin-bottom: 0;
+ margin-left: 1.5em;
+}
+
+/* Literal Blocks */
+
+pre.literal-block, pre.doctest-block,
+pre.math, pre.code {
+ margin-left: 1.5em;
+ margin-right: 1.5em
+}
+
+/* Block Quotes */
+
+blockquote,
+div.topic {
+ margin-left: 1.5em;
+ margin-right: 1.5em
+}
+blockquote > table,
+div.topic > table {
+ margin-top: 0;
+ margin-bottom: 0;
+}
+blockquote p.attribution,
+div.topic p.attribution {
+ text-align: right;
+ margin-left: 20%;
+}
+
+/* Tables */
+/* ====== */
+
+/* margins and borders for "normal" tables */
+table {
+ border-collapse: collapse;
+}
+td, th {
+ border-style: solid;
+ border-color: silver;
+ padding: 0 1ex;
+/* some borders missing at some magnifications
+/* in Firefox 31.5.0 and opera 10.63 */
+ border-width: thin;
+}
+td > p:first-child, th > p:first-child {
+ margin-top: 0;
+}
+td > p, th > p {
+ margin-bottom: 0;
+}
+th {
+ vertical-align: bottom;
+}
+
+table > caption {
+ text-align: left;
+ margin-bottom: 0.25em
+}
+
+table.borderless td, table.borderless th {
+ border: 0;
+ padding: 0;
+ padding-right: 0.5em /* separate table cells */
+}
+
+/* "booktabs" style (no vertical lines) */
+table.booktabs {
+ border: 0;
+ border-top: 2px solid;
+ border-bottom: 2px solid;
+ border-collapse: collapse;
+}
+
+table.booktabs * {
+ border: 0;
+}
+table.booktabs th {
+ border-bottom: thin solid;
+ text-align: left;
+}
+
+/* numbered tables (counter defined in div.document) */
+table.numbered > caption:before {
+ counter-increment: table;
+ content: "Table " counter(table) ": ";
+ font-weight: bold;
+}
+
+/* Explicit Markup Blocks */
+/* ====================== */
+
+/* Footnotes and Citations */
+/* ----------------------- */
+
+/* line on the left */
+dl.footnote {
+ padding-left: 1ex;
+ border-left: solid;
+ border-left-width: thin;
+}
+
+dl > dt.label {
+ font-weight: normal;
+}
+dt.label > span.fn-backref {
+ margin: 0.2em;
+}
+dt.label > span.fn-backref > a {
+ font-style: italic;
+}
+
+/* Directives */
+/* ---------- */
+
+/* Admonitions */
+/* System Messages */
+
+div.admonition,
+div.system-message {
+ margin: 2em;
+ border: medium outset;
+ padding-right: 1em;
+ padding-left: 1em;
+}
+
+/* Body Elements */
+/* ~~~~~~~~~~~~~ */
+
+/* Image and Figure */
+
+img.align-left,
+.figure.align-left,
+object.align-left {
+ clear: left;
+ float: left;
+ margin-right: 1em
+}
+img.align-right,
+.figure.align-right,
+object.align-right {
+ clear: right;
+ float: right;
+ margin-left: 1em
+}
+img.align-center,
+.figure.align-center,
+object.align-center {
+ display: block;
+ margin-left: auto;
+ margin-right: auto;
+}
+/* reset inner alignment in figures */
+div.align-right {
+ text-align: inherit }
+
+/* Topic */
+
+div.topic { margin: 2em }
+
+/* Sidebar */
+
+/* in a layout with fixed margins, */
+/* the sidebar can be moved into the margin completely */
+div.sidebar {
+ border: medium outset;
+ padding-right: 1em;
+ padding-left: 1em;
+ width: 30%;
+ max-width: 26em;
+ float: right;
+ clear: right;
+ margin-left: 1em;
+ margin-right: -5.5%;
+ background-color: #ffffee ;
+}
+p.sidebar-title { font-size: larger; }
+
+/* Code */
+
+pre.code, code { background-color: #eeeeee }
+pre.code .ln { color: gray; } /* line numbers */
+/* basic highlighting: for a complete scheme, see */
+/* http://docutils.sourceforge.net/sandbox/stylesheets/ */
+pre.code .comment, code .comment { color: #5C6576 }
+pre.code .keyword, code .keyword { color: #3B0D06; font-weight: bold }
+pre.code .literal.string, code .literal.string { color: #0C5404 }
+pre.code .name.builtin, code .name.builtin { color: #352B84 }
+pre.code .deleted, code .deleted { background-color: #DEB0A1}
+pre.code .inserted, code .inserted { background-color: #A3D289}
+
+/* Math */
+/* styled separately (see math.css for math-output=HTML) */
+
+/* Rubric */
+
+p.rubric {
+ font-weight: bold;
+ font-size: larger;
+ color: maroon;
+}
+
+/* Epigraph */
+/* Highlights */
+/* Pull-Quote */
+/* Compound Paragraph */
+/* Container */
+
+/* can be styled in a custom stylesheet */
+
+/* Document Header & Footer */
+
+div.footer, div.header {
+ clear: both;
+ font-size: smaller;
+}
+
+/* Contents */
+
+div.topic.contents {
+ margin: 0; /* don't indent like a topic */
+}
+ul.auto-toc {
+ list-style-type: none;
+}
+
+/* Inline Markup */
+/* ============= */
+
+/* Emphasis */
+/* em */
+/* Strong Emphasis */
+/* strong */
+/* Interpreted Text */
+/* span.interpreted */
+/* Title Reference */
+/* cite */
+/* Inline Literals */
+
+tt.literal, span.docutils.literal {
+ font-family: monospace;
+ /* possible values: normal, nowrap, pre, pre-wrap, pre-line */
+ white-space: pre-wrap;
+}
+/* do not wraph a hyphens and similar: */
+.literal > span.pre { white-space: nowrap; }
+
+/* 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 */
Modified: trunk/docutils/docutils/writers/xhtml11/__init__.py
===================================================================
--- trunk/docutils/docutils/writers/xhtml11/__init__.py 2015-03-10 15:11:37 UTC (rev 7817)
+++ trunk/docutils/docutils/writers/xhtml11/__init__.py 2015-03-10 17:56:46 UTC (rev 7818)
@@ -31,9 +31,9 @@
import docutils
from docutils import frontend, nodes, utils, writers, languages
-from docutils.writers import html4css1
+from docutils.writers import html_base
-class Writer(html4css1.Writer):
+class Writer(html_base.Writer):
supported = ('html', 'xhtml', 'xhtml1',
'html4strict', 'xhtml1strict',
@@ -43,17 +43,15 @@
default_stylesheets = ['html-base.css', 'xhtml11.css']
default_stylesheet_dirs = ['.',
os.path.abspath(os.path.dirname(__file__)),
- # for math.css:
os.path.abspath(os.path.join(
- os.path.dirname(os.path.dirname(__file__)), 'html4css1'))
+ os.path.dirname(os.path.dirname(__file__)), 'html_base'))
]
config_section = 'xhtml11 writer'
- config_section_dependencies = ('writers', 'html4css1 writer')
+ config_section_dependencies = ('writers', 'html writer')
settings_spec = frontend.filter_settings_spec(
- html4css1.Writer.settings_spec,
- 'field_name_limit', 'option_limit', # removed options
+ html_base.Writer.settings_spec,
stylesheet_path = (
'Comma separated list of stylesheet paths. '
'Relative paths are expanded if a matching file is found in '
@@ -75,14 +73,19 @@
math_output = ('Math output format, one of "MathML", "HTML", '
'"MathJax" or "LaTeX". Default: "MathML"',
['--math-output'],
- {'default': 'MathML'}))
+ {'default': 'MathML'}),
+ xml_declaration = ('Prepend an XML declaration. '
+ 'Default: True',
+ ['--xml-declaration'],
+ {'default': True, 'action': 'store_true',
+ 'validator': frontend.validate_boolean}))
def __init__(self):
writers.Writer.__init__(self)
self.translator_class = HTMLTranslator
-class HTMLTranslator(html4css1.HTMLTranslator):
+class HTMLTranslator(html_base.HTMLTranslator):
"""
This writer generates XHTML 1.1
without formatting that interferes with a CSS stylesheet.
@@ -94,170 +97,15 @@
'"http://www.w3.org/Math/DTD/mathml2/xhtml-math11-f.dtd">\n')
# there is no attribute "lang" in XHTML 1.1
+ lang_attribute = 'xml:lang' # changed from 'lang' in XHTML 1.0
head_prefix_template = ('<html xmlns="http://www.w3.org/1999/xhtml"'
' xml:lang="%(lang)s">\n<head>\n')
- lang_attribute = 'xml:lang' # changed from 'lang' in XHTML 1.0
- def __init__(self, document):
- html4css1.HTMLTranslator.__init__(self, document)
- self.in_footnote_list = False
- # Do not mark the first child with 'class="first"' and the last
- # child with 'class="last"' in definitions, table cells, field
- # bodies, option descriptions, and list items. Use the
- # ``:first-child`` and ``:last-child`` selectors instad.
-
- def set_first_last(self, node):
- pass
-
- # Compact lists
- # ------------
- # Include definition lists and field lists (in addition to ordered
- # and unordered lists) in the test if a list is "simple" (cf. the
- # html4css1.HTMLTranslator docstring and the SimpleListChecker class at
- # the end of this file).
-
- def is_compactable(self, node):
- # print "is_compactable %s ?" % node.__class__,
- # explicite class arguments have precedence
- if 'compact' in node['classes']:
- # print "explicitely compact"
- return True
- if 'open' in node['classes']:
- # print "explicitely open"
- return False
- # check config setting:
- if (isinstance(node, nodes.field_list) or
- isinstance(node, nodes.definition_list)
- ) and not self.settings.compact_field_lists:
- # print "`compact-field-lists` is False"
- return False
- if (isinstance(node, nodes.enumerated_list) or
- isinstance(node, nodes.bullet_list)
- ) and not self.settings.compact_lists:
- # print "`compact-lists` is False"
- return False
- # more special cases:
- if (self.topic_classes == ['contents']): # TODO: self.in_contents
- return True
- # check the list items:
- visitor = SimpleListChecker(self.document)
- try:
- node.walk(visitor)
- except nodes.NodeFound:
- # print "complex node"
- return False
- else:
- # print "simple list"
- return True
-
- # address, literal block, and doctest block: no newline after <pre> tag
- # (leads to blank line in XHTML1.1)
- def visit_address(self, node):
- self.visit_docinfo_item(node, 'address', meta=False)
- self.body.append(self.starttag(node, 'pre',suffix='',
- CLASS='address'))
-
- # author, authors
- # ---------------
- # Use paragraphs instead of hard-coded linebreaks.
-
- def visit_author(self, node):
- if not(isinstance(node.parent, nodes.authors)):
- self.visit_docinfo_item(node, 'author')
- self.body.append('<p>')
-
- def depart_author(self, node):
- self.body.append('</p>')
- if isinstance(node.parent, nodes.authors):
- self.body.append('\n')
- else:
- self.depart_docinfo_item()
-
- def visit_authors(self, node):
- self.visit_docinfo_item(node, 'authors')
-
- def depart_authors(self, node):
- self.depart_docinfo_item()
-
- # citations
- # ---------
- # Use definition list instead of table for bibliographic references.
- # Join adjacent citation entries.
-
- def visit_citation(self, node):
- if not self.in_footnote_list:
- self.body.append('<dl class="citation">\n')
- self.in_footnote_list = True
-
- def depart_citation(self, node):
- self.body.append('</dd>\n')
- if not isinstance(node.next_node(descend=False, siblings=True),
- nodes.citation):
- self.body.append('</dl>\n')
- self.in_footnote_list = False
-
- # classifier
- # ----------
- # don't insert classifier-delimiter here (done by CSS)
-
- def visit_classifier(self, node):
- self.body.append(self.starttag(node, 'span', '', CLASS='classifier'))
-
- def depart_classifier(self, node):
- self.body.append('</span>')
-
- # definition list
- # ---------------
- # check for simple/complex list and set class attribute
-
- def visit_definition_list(self, node):
- classes = node.setdefault('classes', [])
- if self.is_compactable(node):
- classes.append('simple')
- self.body.append(self.starttag(node, 'dl'))
-
- def depart_definition_list(self, node):
- self.body.append('</dl>\n')
-
- # docinfo
- # -------
- # use definition list instead of table
-
- def visit_docinfo(self, node):
- classes = 'docinfo'
- if (self.is_compactable(node)):
- classes += ' simple'
- self.body.append(self.starttag(node, 'dl', CLASS=classes))
-
- def depart_docinfo(self, node):
- self.body.append('</dl>\n')
-
- def visit_docinfo_item(self, node, name, meta=True):
- if meta:
- meta_tag = '<meta name="%s" content="%s" />\n' \
- % (name, self.attval(node.astext()))
- self.add_meta(meta_tag)
- self.body.append('<dt class="%s">%s</dt>\n'
- % (name, self.language.labels[name]))
- self.body.append(self.starttag(node, 'dd', '', CLASS=name))
-
- def depart_docinfo_item(self):
- self.body.append('</dd>\n')
-
- # doctest-block
- # -------------
- # no line-break
- # TODO: RSt-parser should treat this as code-block with class "pycon".
-
- def visit_doctest_block(self, node):
- self.body.append(self.starttag(node, 'pre', suffix='',
- CLASS='code pycon doctest-block'))
-
# enumerated lists
# ----------------
# The 'start' attribute does not conform to HTML4/XHTML1 Strict
- # (it will resurface in HTML5)
+ # (resurfaced in HTML5)
def visit_enumerated_list(self, node):
atts = {}
@@ -270,308 +118,13 @@
classes.append('simple')
self.body.append(self.starttag(node, 'ol', **atts))
- def depart_enumerated_list(self, node):
- self.body.append('</ol>\n')
- # field-list
- # ----------
- # set as definition list, styled with CSS
+ # Meta tags: 'lang' attribute replaced by 'xml:lang' in XHTML 1.1
+ # HTML5/polyglott recommends using both
- def visit_field_list(self, node):
- # Keep simple paragraphs in the field_body to enable CSS
- # rule to start body on new line if the label is too long
- classes = 'field-list'
- if (self.is_compactable(node)):
- classes += ' simple'
- self.body.append(self.starttag(node, 'dl', CLASS=classes))
-
- def depart_field_list(self, node):
- self.body.append('</dl>\n')
-
- def visit_field(self, node):
- pass
-
- def depart_field(self, node):
- pass
-
- def visit_field_name(self, node):
- self.body.append(self.starttag(node, 'dt', ''))
-
- def depart_field_name(self, node):
- self.body.append('</dt>\n')
-
- def visit_field_body(self, node):
- self.body.append(self.starttag(node, 'dd', ''))
-
- def depart_field_body(self, node):
- self.body.append('</dd>\n')
-
- # footnotes
- # ---------
- # use definition list instead of table for footnote text
-
- def visit_footnote(self, node):
- if not self.in_footnote_list:
- self.body.append('<dl class="footnote">\n')
- self.in_footnote_list = True
-
- def depart_footnote(self, node):
- self.body.append('</dd>\n')
- if not isinstance(node.next_node(descend=False, siblings=True),
- nodes.footnote):
- self.body.append('</dl>\n')
- self.in_footnote_list = False
-
- # footnote and citation label
- def label_delim(self, node, bracket, superscript):
- """put brackets around label?"""
- if isinstance(node.parent, nodes.footnote):
- if self.settings.footnote_references == 'brackets':
- return bracket
- else:
- return superscript
- assert isinstance(node.parent, nodes.citation)
- return bracket
-
- def visit_label(self, node):
- # pass parent node to get id into starttag:
- self.body.append(self.starttag(node.parent, 'dt', '', CLASS='label'))
- # footnote/citation backrefs:
- if self.settings.footnote_backlinks:
- backrefs = node.parent['backrefs']
- if len(backrefs) == 1:
- self.body.append('<a class="fn-backref" href="#%s">'
- % backrefs[0])
- self.body.append(self.label_delim(node, '[', ''))
-
- def depart_label(self, node):
- self.body.append(self.label_delim(node, ']', ''))
- if self.settings.footnote_backlinks:
- backrefs = node.parent['backrefs']
- if len(backrefs) == 1:
- self.body.append('</a>')
- elif len(backrefs) > 1:
- # Python 2.4 fails with enumerate(backrefs, 1)
- backlinks = ['<a href="#%s">%s</a>' % (ref, i+1)
- for (i, ref) in enumerate(backrefs)]
- self.body.append('<span class="fn-backref">(%s)</span>'
- % ','.join(backlinks))
- self.body.append('</dt>\n<dd>')
-
- def visit_generated(self, node):
- if 'sectnum' in node['classes']:
- # get section number (strip trailing no-break-spaces)
- sectnum = node.astext().rstrip(u' ')
- # print sectnum.encode('utf-8')
- self.body.append('<span class="sectnum">%s</span> '
- % self.encode(sectnum))
- # Content already processed:
- raise nodes.SkipNode
-
- # def depart_generated(self, node):
- # pass
-
- # Image types to place in an <object> element
- # SVG as <img> supported since IE version 9
- # (but rendering problems remain (see standalonge_rst2xhtml11.xhtml test output)
- # object_image_types = {'.swf': 'application/x-shockwave-flash'}
-
- # Do not mark the first child with 'class="first"'
- def visit_list_item(self, node):
- self.body.append(self.starttag(node, 'li', ''))
-
- # inline literal
- def visit_literal(self, node):
- # special case: "code" role
- classes = node.get('classes', [])
- if 'code' in classes:
- # filter 'code' from class arguments
- node['classes'] = [cls for cls in classes if cls != 'code']
- self.body.append(self.starttag(node, 'code', ''))
- return
- self.body.append(
- self.starttag(node, 'tt', '', CLASS='literal'))
- text = node.astext()
- # remove hard line breaks (except if in a parsed-literal block)
- if not isinstance(node.parent, nodes.literal_block):
- text = text.replace('\n', ' ')
- # Protect text like ``--an-option`` and the regular expression
- # ``[+]?(\d+(\.\d*)?|\.\d+)`` from bad line wrapping
- for token in self.words_and_spaces.findall(text):
- if token.strip() and self.sollbruchstelle.search(token):
- self.body.append('<span class="pre">%s</span>'
- % self.encode(token))
- else:
- self.body.append(self.encode(token))
- self.body.append('</tt>')
- # Content already processed:
- raise nodes.SkipNode
-
- def depart_literal(self, node):
- # skipped unless literal element is from "code" role:
- self.body.append('</code>')
-
- def visit_literal_block(self, node,):
- self.body.append(self.starttag(node, 'pre', suffix='',
- CLASS='literal-block'))
-
- # Meta tags: 'lang' attribute replaced by 'xml:lang' in XHTML 1.1
def visit_meta(self, node):
if node.hasattr('lang'):
node['xml:lang'] = node['lang']
del(node['lang'])
meta = self.emptytag(node, 'meta', **node.non_default_attributes())
self.add_meta(meta)
-
-
- # option-list as definition list, styled with CSS
- # ----------------------------------------------
-
- def visit_option_list(self, node):
- self.body.append(
- self.starttag(node, 'dl', CLASS='option-list'))
-
- def depart_option_list(self, node):
- self.body.append('</dl>\n')
-
- def visit_option_list_item(self, node):
- pass
-
- def depart_option_list_item(self, node):
- pass
-
- def visit_option_group(self, node):
- self.body.append(self.starttag(node, 'dt', ''))
- self.body.append('<kbd>')
-
- def depart_option_group(self, node):
- self.body.append('</kbd></dt>\n')
-
- def visit_option(self, node):
- self.body.append(self.starttag(node, 'span', '', CLASS='option'))
-
- def depart_option(self, node):
- self.body.append('</span>')
- if isinstance(node.next_node(descend=False, siblings=True),
- nodes.option):
- self.body.append(', ')
-
- def visit_description(self, node):
- self.body.append(self.starttag(node, 'dd', ''))
-
- def depart_description(self, node):
- self.body.append('</dd>\n')
-
- # Do not omit <p> tags
- # --------------------
- #
- # The HTML4CSS1 writer does this to "produce
- # visually compact lists (less vertical whitespace)". This writer
- # relies on CSS rules for"visual compactness".
- #
- # * In XHTML 1.1, e.g. a <blockquote> element may not contain
- # character data, so you cannot drop the <p> tags.
- # * Keeping simple paragraphs in the field_body enables a CSS
- # rule to start the field-body on a new line if the label is too long
- # * it makes the code simpler.
- #
- # TODO: omit paragraph tags in simple table cells?
-
- def visit_paragraph(self, node):
- self.body.append(self.starttag(node, 'p', ''))
-
- def depart_paragraph(self, node):
- self.body.append('</p>')
- if not (isinstance(node.parent, (nodes.list_item, nodes.entry)) and
- (len(node.parent) == 1)
- ):
- self.body.append('\n')
-
- # tables
- # ------
- # no hard-coded border setting in the table head::
-
- def visit_table(self, node):
- classes = [cls.strip(u' \t\n')
- for cls in self.settings.table_style.split(',')]
- tag = self.starttag(node, 'table', CLASS=' '.join(classes))
- self.body.append(tag)
-
- def depart_table(self, node):
- self.body.append('</table>\n')
-
- # no hard-coded vertical alignment in table body::
-
- def visit_tbody(self, node):
- self.write_colspecs()
- self.body.append(self.context.pop()) # '</colgroup>\n' or ''
- self.body.append(self.starttag(node, 'tbody'))
-
-
-class SimpleListChecker(html4css1.SimpleListChecker):
-
- """
- Raise `nodes.NodeFound` if non-simple list item is encountered.
-
- Here "simple" means a list item containing nothing other than a single
- paragraph, a simple list, or a paragraph followed by a simple list.
-
- This version also checks for simple field lists and docinfo.
- """
- # # debugging: copy of parent methods with `print` calls
- # def default_visit(self, node):
- # print "found", node.__class__, "in", node.parent.__class__
- # raise nodes.NodeFound
-
- def _pass_node(self, node):
- pass
-
- def _simple_node(self, node):
- # nodes that are never complex (can contain only inline nodes)
- raise nodes.SkipNode
-
- def visit_list_item(self, node):
- # print "visiting list item", node.__class__
- children = [child for child in node.children
- if not isinstance(child, nodes.Invisible)]
- # print "has %s visible children" % len(children)
- if (children and isinstance(children[0], nodes.paragraph)
- and (isinstance(children[-1], nodes.bullet_list) or
- isinstance(children[-1], nodes.enumerated_list) or
- isinstance(children[-1], nodes.field_list))):
- children.pop()
- # print "%s children remain" % len(children)
- if len(children) <= 1:
- return
- else:
- # print "found", child.__class__, "in", node.__class__
- raise nodes.NodeFound
-
- # Docinfo nodes:
- visit_docinfo = _pass_node
- visit_author = _simple_node
- visit_authors = visit_list_item
- visit_address = visit_list_item
- visit_contact = _pass_node
- visit_copyright = _simple_node
- visit_date = _simple_node
- visit_organization = _simple_node
- visit_status = _simple_node
- visit_version = visit_list_item
-
- # Definition list:
- visit_definition_list = _pass_node
- visit_definition_list_item = _pass_node
- visit_term = _pass_node
- visit_classifier = _pass_node
- visit_definition = visit_list_item
-
- # Field list:
- visit_field_list = _pass_node
- visit_field = _pass_node
- # the field body corresponds to a list item
- visit_field_body = visit_list_item
- visit_field_name = html4css1.SimpleListChecker.invisible_visit
-
- # Inline nodes
- visit_Text = _pass_node
Deleted: trunk/docutils/docutils/writers/xhtml11/html-base.css
===================================================================
--- trunk/docutils/docutils/writers/xhtml11/html-base.css 2015-03-10 15:11:37 UTC (rev 7817)
+++ trunk/docutils/docutils/writers/xhtml11/html-base.css 2015-03-10 17:56:46 UTC (rev 7818)
@@ -1,508 +0,0 @@
-/* Basic style sheet for the HTML output of Docutils. */
-/* */
-/* :Author: Günter Milde, based on html4css1.css by David Goodger */
-/* :Id: $Id$ */
-/* :Copyright: © 2015 Günter Milde. */
-/* :License: Released under the terms of the `2-Clause BSD license`_, */
-/* in short: */
-/* */
-/* Copying and distribution of this file, with or without modification, */
-/* are permitted in any medium without royalty provided the copyright */
-/* 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 */
-
-
-/* This stylesheet contains basic rules for the output of the */
-/* Docutils HTML writers. It validates_ as CSS2.1_ */
-/* */
-/* .. _CSS2.1: http://www.w3.org/TR/CSS2 */
-/* .. _validates: http://jigsaw.w3.org/css-validator/validator$link */
-
-
-/* Document Structure */
-/* ****************** */
-
-/* Document */
-
-body {
- padding: 0 5%;
- margin: 8px 0;
-}
-
-div.document {
- line-height:1.3;
- counter-reset: table;
- /* counter-reset: figure; */
- /* avoid long lines --> better reading */
- /* OTOH: lines should not be too short because of missing hyphenation, */
- max-width: 50em;
- margin: auto;
-}
-
-.align-left { text-align: left; }
-.align-right { text-align: right; }
-.align-center {
- clear: both;
- text-align: center;
-}
-
-/* Sections */
-
-h1.title, p.subtitle {
- text-align: center;
-}
-
-h1 + p.subtitle { font-size: 1.5em; }
-h1 + p.section-subtitle { font-size: 1.5em; }
-h2 + p.section-subtitle { font-size: 1.17em; }
-
-a.toc-backref {
- color: black;
- text-decoration: none;
-}
-
-/* Stop floating sidebars, images and figures at section level 1,2,3 */
-h1, h2, h3 { clear: both; }
-
-/* Transitions */
-
-hr.docutils {
- width: 80%;
- margin-top: 1em;
- margin-bottom: 1em;
-}
-
-/* Paragraphs */
-/* ========== */
-
-/* vertical space (parskip) */
-p, ol, ul, dl,
-div.line-block,
-table{
- margin-top: 0.5em;
- margin-bottom: 0.5em;
-}
-h1, h2, h3, h4, h5, h6,
-dl > dd {
- margin-bottom: 0.5em;
-}
-
-/* titles */
-p.admonition-title,
-p.topic-title,
-p.sidebar-title,
-p.system-message-title {
- font-weight: bold;
-}
-
-p.subtitle,
-p.section-subtitle,
-p.sidebar-subtitle {
- font-weight: bold;
- margin-top: -0.5em;
-}
-
-
-/* Warnings, Errors */
-div.caution p.admonition-title,
-div.attention p.admonition-title,
-div.danger p.admonition-title,
-div.error p.admonition-title,
-div.warning p.admonition-title,
-div.system-messages h1,
-div.error,
-span.problematic,
-p.system-message-title {
- color: red;
-}
-
-/* Lists */
-/* ========== */
-
-/* compact and simple lists: no margin between items */
-dl.simple > dd, dl.compact > dd,
-.compact li, .compact ul, .compact ol
-.simple li, .simple ul, .simple ol,
-.simple > li p, .compact > li p {
- margin-top: 0;
- margin-bottom: 0;
-}
-
-/* Enumerated Lists */
-
-ol.arabic { list-style: decimal }
-ol.loweralpha { list-style: lower-alpha }
-ol.upperalpha { list-style: upper-alpha }
-ol.lowerroman { list-style: lower-roman }
-ol.upperroman { list-style: upper-roman }
-
-/* 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 */
-dd > ul, dd > ol { padding-left: 0pt; }
-
-dt span.classifier { font-style: italic }
-dt span.classifier:before {
- font-style: normal;
- margin: 0.5em;
- content: ":";
-}
-
-/* Field Lists */
-
-/* bold field name, content starts on the same line */
-dl.field-list > dt,
-dl.option-list > dt,
-dl.docinfo > dt,
-dl.footnote > dt,
-dl.citation > dt,
-dl.description > dt {
- font-weight: bold;
- clear: left;
- float: left;
- margin: 0;
- padding: 0;
- padding-right: 0.5em;
-}
-/* Offset for field content (corresponds to the --field-name-limit option) */
-dl.field-list > dd,
-dl.option-list > dd,
-dl.docinfo > dd {
- margin-left: 9em; /* ca. 14 chars in the test examples */
-/* padding-left: 0.5em; */
-}
-/* start field-body on a new line after long field names */
-dl.field-list > dd > *:first-child,
-dl.option-list > dd > *:first-child,
-dl.docinfo > dd > *:first-child {
- display: inline-block;
- width: 100%;
- margin: 0;
-}
-/* field names followed by a colon */
-dl.field-list > dt:after,
-dl.docinfo > dt:after {
- content: ":";
-}
-
-/* example for custom field-name width */
-dl.field-list.narrow > dd {
- margin-left: 5em;
-}
-/* run-in: start field-body on same line after long field names */
-dl.field-list.run-in > dd p {
- display: block;
-}
-
-/* Bibliographic Fields */
-
-/* use special field-list dl.docinfo */
-
-pre.address {
- margin-bottom: 0;
- margin-top: 0;
- font: inherit;
-}
-dd.authors > p { margin: 0; }
-
-div.abstract p.topic-title {
- text-align: center;
-}
-
-div.dedication {
- margin: 2em 5em;
- text-align: center;
- font-style: italic;
-}
-div.dedication p.topic-title {
- font-style: normal;
-}
-
-/* Option Lists */
-
-dl.option-list {
- margin-left: 1em;
-}
-dl.option-list > dt {
- font-weight: normal;
-}
-span.option {
- white-space: nowrap;
-}
-
-/* Text Blocks */
-/* ============ */
-
-/* Line Blocks */
-
-div.line-block {
- display: block;
-}
-div.line-block div.line-block {
- margin-top: 0;
- margin-bottom: 0;
- margin-left: 1.5em;
-}
-
-/* Literal Blocks */
-
-pre.literal-block, pre.doctest-block,
-pre.math, pre.code {
- margin-left: 1.5em;
- margin-right: 1.5em
-}
-
-/* Block Quotes */
-
-blockquote,
-div.topic {
- margin-left: 1.5em;
- margin-right: 1.5em
-}
-blockquote > table,
-div.topic > table {
- margin-top: 0;
- margin-bottom: 0;
-}
-blockquote p.attribution,
-div.topic p.attribution {
- text-align: right;
- margin-left: 20%;
-}
-
-/* Tables */
-/* ====== */
-
-/* margins and borders for "normal" tables */
-table {
- border-collapse: collapse;
-}
-td, th {
- border-style: solid;
- border-color: silver;
- padding: 0 1ex;
-/* some borders missing at some magnifications
-/* in Firefox 31.5.0 and opera 10.63 */
- border-width: thin;
-}
-td > p:first-child, th > p:first-child {
- margin-top: 0;
-}
-td > p, th > p {
- margin-bottom: 0;
-}
-th {
- vertical-align: bottom;
-}
-
-table > caption {
- text-align: left;
- margin-bottom: 0.25em
-}
-
-table.borderless td, table.borderless th {
- border: 0;
- padding: 0;
- padding-right: 0.5em /* separate table cells */
-}
-
-/* "booktabs" style (no vertical lines) */
-table.booktabs {
- border: 0;
- border-top: 2px solid;
- border-bottom: 2px solid;
- border-collapse: collapse;
-}
-
-table.booktabs * {
- border: 0;
-}
-table.booktabs th {
- border-bottom: thin solid;
- text-align: left;
-}
-
-/* numbered tables (counter defined in div.document) */
-table.numbered > caption:before {
- counter-increment: table;
- content: "Table " counter(table) ": ";
- font-weight: bold;
-}
-
-/* Explicit Markup Blocks */
-/* ====================== */
-
-/* Footnotes and Citations */
-/* ----------------------- */
-
-/* line on the left */
-dl.footnote {
- padding-left: 1ex;
- border-left: solid;
- border-left-width: thin;
-}
-
-dl > dt.label {
- font-weight: normal;
-}
-dt.label > span.fn-backref {
- margin: 0.2em;
-}
-dt.label > span.fn-backref > a {
- font-style: italic;
-}
-
-/* Directives */
-/* ---------- */
-
-/* Admonitions */
-/* System Messages */
-
-div.admonition,
-div.system-message {
- margin: 2em;
- border: medium outset;
- padding-right: 1em;
- padding-left: 1em;
-}
-
-/* Body Elements */
-/* ~~~~~~~~~~~~~ */
-
-/* Image and Figure */
-
-img.align-left,
-.figure.align-left,
-object.align-left {
- clear: left;
- float: left;
- margin-right: 1em
-}
-img.align-right,
-.figure.align-right,
-object.align-right {
- clear: right;
- float: right;
- margin-left: 1em
-}
-img.align-center,
-.figure.align-center,
-object.align-center {
- display: block;
- margin-left: auto;
- margin-right: auto;
-}
-/* reset inner alignment in figures */
-div.align-right {
- text-align: inherit }
-
-/* Topic */
-
-div.topic { margin: 2em }
-
-/* Sidebar */
-
-/* in a layout with fixed margins, */
-/* the sidebar can be moved into the margin completely */
-div.sidebar {
- border: medium outset;
- padding-right: 1em;
- padding-left: 1em;
- width: 30%;
- max-width: 26em;
- float: right;
- clear: right;
- margin-left: 1em;
- margin-right: -5.5%;
- background-color: #ffffee ;
-}
-p.sidebar-title { font-size: larger; }
-
-/* Code */
-
-pre.code, code { background-color: #eeeeee }
-pre.code .ln { color: gray; } /* line numbers */
-/* basic highlighting: for a complete scheme, see */
-/* http://docutils.sourceforge.net/sandbox/stylesheets/ */
-pre.code .comment, code .comment { color: #5C6576 }
-pre.code .keyword, code .keyword { color: #3B0D06; font-weight: bold }
-pre.code .literal.string, code .literal.string { color: #0C5404 }
-pre.code .name.builtin, code .name.builtin { color: #352B84 }
-pre.code .deleted, code .deleted { background-color: #DEB0A1}
-pre.code .inserted, code .inserted { background-color: #A3D289}
-
-/* Math */
-/* styled separately (see math.css for math-output=HTML) */
-
-/* Rubric */
-
-p.rubric {
- font-weight: bold;
- font-size: larger;
- color: maroon;
-}
-
-/* Epigraph */
-/* Highlights */
-/* Pull-Quote */
-/* Compound Paragraph */
-/* Container */
-
-/* can be styled in a custom stylesheet */
-
-/* Document Header & Footer */
-
-div.footer, div.header {
- clear: both;
- font-size: smaller;
-}
-
-/* Contents */
-
-div.topic.contents {
- margin: 0; /* don't indent like a topic */
-}
-ul.auto-toc {
- list-style-type: none;
-}
-
-/* Inline Markup */
-/* ============= */
-
-/* Emphasis */
-/* em */
-/* Strong Emphasis */
-/* strong */
-/* Interpreted Text */
-/* span.interpreted */
-/* Title Reference */
-/* cite */
-/* Inline Literals */
-
-tt.literal, span.docutils.literal {
- font-family: monospace;
- /* possible values: normal, nowrap, pre, pre-wrap, pre-line */
- white-space: pre-wrap;
-}
-/* do not wraph a hyphens and similar: */
-.literal > span.pre { white-space: nowrap; }
-
-/* 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 */
Modified: trunk/docutils/test/functional/expected/math_output_mathml.xhtml
===================================================================
--- trunk/docutils/test/functional/expected/math_output_mathml.xhtml 2015-03-10 15:11:37 UTC (rev 7817)
+++ trunk/docutils/test/functional/expected/math_output_mathml.xhtml 2015-03-10 17:56:46 UTC (rev 7818)
@@ -5,13 +5,14 @@
<meta http-equiv="Content-Type" content="application/xhtml+xml; charset=utf-8" />
<meta name="generator" content="Docutils 0.13: http://docutils.sourceforge.net/" />
<title>Mathematics</title>
-<link rel="stylesheet" href="../input/data/html4-base.css" type="text/css" />
+<link rel="stylesheet" href="../input/data/html-base.css" type="text/css" />
+<link rel="stylesheet" href="../input/data/xhtml11.css" type="text/css" />
</head>
<body>
<div class="document" id="mathematics">
<h1 class="title">Mathematics</h1>
-<p>Docutils supports inline math with the prefix or postfix <tt class="literal">:math:</tt>
+<p>Docutils supports inline math with the prefix or postfix <span class="docutils literal">:math:</span>
role specificator, <math xmlns="http://www.w3.org/1998/Math/MathML">
<mrow><mi>n</mi><mo>!</mo><mo>+</mo><mo>sin</mo><mo>(</mo><msubsup><mi>x</mi><mi>n</mi><mn>2</mn></msubsup><mo>)</mo></mrow></math> and <math xmlns="http://www.w3.org/1998/Math/MathML">
<mrow><msub><mi>A</mi><mtext>c</mtext></msub><mo>=</mo><mfrac>
@@ -38,7 +39,7 @@
<mrow><mtext>number of apples</mtext></mrow>
<mrow><mn>7</mn></mrow></mfrac></mtd></mtr></mtable></math>
</div>
-<p>Equations can be labeled with a reference name using the <tt class="literal">:name:</tt> option.
+<p>Equations can be labeled with a reference name using the <span class="docutils literal">:name:</span> option.
See <a class="reference internal" href="#eq-m">eq:M</a> and <a class="reference internal" href="#eq-schrodinger">eq:schrödinger</a> below.</p>
<p>The determinant of the matrix</p>
<div id="eq-m">
@@ -97,50 +98,50 @@
<dt>Math-Accents:</dt>
<dd><table class="borderless">
<colgroup>
-<col width="33%" />
-<col width="33%" />
-<col width="33%" />
+<col style="width: 33%" />
+<col style="width: 33%" />
+<col style="width: 33%" />
</colgroup>
<tbody>
<tr><td><p><math xmlns="http://www.w3.org/1998/Math/MathML">
<mrow><mover>
-<mrow><mi>a</mi></mrow><mo>´</mo></mover></mrow></math> <tt class="literal">\acute{a}</tt></p></td>
+<mrow><mi>a</mi></mrow><mo>´</mo></mover></mrow></math> <span class="docutils literal">\acute{a}</span></p></td>
<td><p><math xmlns="http://www.w3.org/1998/Math/MathML">
<mrow><mover>
-<mrow><mi>t</mi></mrow><mo>˙</mo></mover></mrow></math> <tt class="literal">\dot{t}</tt></p></td>
+<mrow><mi>t</mi></mrow><mo>˙</mo></mover></mrow></math> <span class="docutils literal">\dot{t}</span></p></td>
<td><p><math xmlns="http://www.w3.org/1998/Math/MathML">
<mrow><mover>
-<mrow><mi>γ</mi></mrow><mo>^</mo></mover></mrow></math> <tt class="literal"><span class="pre">\hat{\gamma}</span></tt></p></td>
+<mrow><mi>γ</mi></mrow><mo>^</mo></mover></mrow></math> <span class="docutils literal"><span class="pre">\hat{\gamma}</span></span></p></td>
</tr>
<tr><td><p><math xmlns="http://www.w3.org/1998/Math/MathML">
<mrow><mover>
-<mrow><mi>a</mi></mrow><mo>`</mo></mover></mrow></math> <tt class="literal">\grave{a}</tt></p></td>
+<mrow><mi>a</mi></mrow><mo>`</mo></mover></mrow></math> <span class="docutils literal">\grave{a}</span></p></td>
<td><p><math xmlns="http://www.w3.org/1998/Math/MathML">
<mrow><mover>
-<mrow><mi>t</mi></mrow><mo>¨</mo></mover></mrow></math> <tt class="literal">\ddot{t}</tt></p></td>
+<mrow><mi>t</mi></mrow><mo>¨</mo></mover></mrow></math> <span class="docutils literal">\ddot{t}</span></p></td>
<td><p><math xmlns="http://www.w3.org/1998/Math/MathML">
<mrow><mover>
-<mrow><mi>α</mi></mrow><mo>˜</mo></mover></mrow></math> <tt class="literal"><span class="pre">\tilde{\alpha}</span></tt></p></td>
+<mrow><mi>α</mi></mrow><mo>˜</mo></mover></mrow></math> <span class="docutils literal"><span class="pre">\tilde{\alpha}</span></span></p></td>
</tr>
<tr><td><p><math xmlns="http://www.w3.org/1998/Math/MathML">
<mrow><mover>
-<mrow><mi>x</mi></mrow><mo>˘</mo></mover></mrow></math> <tt class="literal">\breve{x}</tt></p></td>
+<mrow><mi>x</mi></mrow><mo>˘</mo></mover></mrow></math> <span class="docutils literal">\breve{x}</span></p></td>
<td><p><math xmlns="http://www.w3.org/1998/Math/MathML">
<mrow><mover>
-<mrow><mi>t</mi></mrow><mo>⃛</mo></mover></mrow></math> <tt class="literal">\dddot{t}</tt></p></td>
+<mrow><mi>t</mi></mrow><mo>⃛</mo></mover></mrow></math> <span class="docutils literal">\dddot{t}</span></p></td>
<td><p><math xmlns="http://www.w3.org/1998/Math/MathML">
<mrow><mover>
-<mrow><mi>ı</mi></mrow><mo>⃗</mo></mover></mrow></math> <tt class="literal"><span class="pre">\vec{\imath}</span></tt></p></td>
+<mrow><mi>ı</mi></mrow><mo>⃗</mo></mover></mrow></math> <span class="docutils literal"><span class="pre">\vec{\imath}</span></span></p></td>
</tr>
<tr><td><p><math xmlns="http://www.w3.org/1998/Math/MathML">
<mrow><mover>
-<mrow><mi>a</mi></mrow><mo>ˇ</mo></mover></mrow></math> <tt class="literal">\check{a}</tt></p></td>
+<mrow><mi>a</mi></mrow><mo>ˇ</mo></mover></mrow></math> <span class="docutils literal">\check{a}</span></p></td>
<td><p><math xmlns="http://www.w3.org/1998/Math/MathML">
<mrow><mover>
-<mrow><mi>a</mi></mrow><mo>¯</mo></mover></mrow></math> <tt class="literal">\bar{a}</tt></p></td>
+<mrow><mi>a</mi></mrow><mo>¯</mo></mover></mrow></math> <span class="docutils literal">\bar{a}</span></p></td>
<td><p><math xmlns="http://www.w3.org/1998/Math/MathML">
<mrow><mover>
-<mrow><mi>R</mi></mrow><mo>⃗</mo></mover></mrow></math> <tt class="literal">\vec{R}</tt></p></td>
+<mrow><mi>R</mi></mrow><mo>⃗</mo></mover></mrow></math> <span class="docutils literal">\vec{R}</span></p></td>
</tr>
</tbody>
</table>
@@ -172,8 +173,8 @@
<mrow><mi>x</mi></mrow></mrow></mfrac></mrow></mfenced><mo>.</mo></mtd></mtr></mtable></math>
</div>
<p>Math split over two lines: If a double backslash is detected outside a
-<tt class="literal"><span class="pre">\begin{...}</span> <span class="pre">\end{...}</span></tt> pair, the math code is wrapped in an <a class="reference external" href="ftp://ftp.ams.org/ams/doc/amsmath/short-math-guide.pdf">AMSmath</a>
-<tt class="literal">align</tt> environment:</p>
+<span class="docutils literal"><span class="pre">\begin{...}</span> <span class="pre">\end{...}</span></span> pair, the math code is wrapped in an <a class="reference external" href="ftp://ftp.ams.org/ams/doc/amsmath/short-math-guide.pdf">AMSmath</a>
+<span class="docutils literal">align</span> environment:</p>
<div>
<math xmlns="http://www.w3.org/1998/Math/MathML" mode="display">
<mtable>
@@ -187,7 +188,7 @@
<mtd><mo>=</mo><mo>∫</mo><msub><mi>s</mi>
<mrow><mtext>in</mtext></mrow></msub><mo>(</mo><mi>x</mi><mo>'</mo><mo>)</mo><msub><mi>s</mi><mi>δ</mi></msub><mo>(</mo><mi>x</mi><mo>-</mo><mi>x</mi><mo>'</mo><mo>)</mo><mtext>d</mtext><mi>x</mi><mo>'</mo></mtd></mtr></mtable></math>
</div>
-<p>Cases ("manually", with <tt class="literal">matrix</tt> environment):</p>
+<p>Cases ("manually", with <span class="docutils literal">matrix</span> environment):</p>
<div>
<math xmlns="http://www.w3.org/1998/Math/MathML" mode="display">
<mtable>
@@ -202,10 +203,10 @@
<mtd><mn>1</mn></mtd>
<mtd><mi>x</mi><mo>></mo><mn>0</mn></mtd></mtr></mtable></mrow></mfenced></mtd></mtr></mtable></math>
</div>
-<p>Cases with the <a class="reference external" href="ftp://ftp.ams.org/ams/doc/amsmath/short-math-guide.pdf">AMSmath</a> <tt class="literal">cases</tt> environment (not (yet) supported by
-HTML writers with <tt class="literal"><span class="pre">--math-output=MathML</span></tt>):</p>
+<p>Cases with the <a class="reference external" href="ftp://ftp.ams.org/ams/doc/amsmath/short-math-guide.pdf">AMSmath</a> <span class="docutils literal">cases</span> environment (not (yet) supported by
+HTML writers with <span class="docutils literal"><span class="pre">--math-output=MathML</span></span>):</p>
<div class="system-message">
-<p class="system-message-title">System Message: ERROR/3 (<tt class="docutils">functional/input/data/math.txt</tt>, line 107)</p>
+<p class="system-message-title">System Message: ERROR/3 (<span class="docutils literal">functional/input/data/math.txt</span>, line 107)</p>
<p>
Environment not supported! Supported environment: "matrix".</p>
<pre class="literal-block">
Modified: trunk/docutils/test/functional/expected/standalone_rst_html_base.html
===================================================================
--- trunk/docutils/test/functional/expected/standalone_rst_html_base.html 2015-03-10 15:11:37 UTC (rev 7817)
+++ trunk/docutils/test/functional/expected/standalone_rst_html_base.html 2015-03-10 17:56:46 UTC (rev 7818)
@@ -238,11 +238,11 @@
<li><p>Arabic numerals.</p>
<ol class="loweralpha simple">
<li><p>lower alpha)</p>
-<ol class="lowerroman">
+<ol class="lowerroman simple">
<li><p>(lower roman)</p>
-<ol class="upperalpha">
+<ol class="upperalpha simple">
<li><p>upper alpha.</p>
-<ol class="upperroman">
+<ol class="upperroman simple">
<li><p>upper roman)</p></li>
</ol>
</li>
Modified: trunk/docutils/test/functional/expected/standalone_rst_xhtml11.xhtml
===================================================================
--- trunk/docutils/test/functional/expected/standalone_rst_xhtml11.xhtml 2015-03-10 15:11:37 UTC (rev 7817)
+++ trunk/docutils/test/functional/expected/standalone_rst_xhtml11.xhtml 2015-03-10 17:56:46 UTC (rev 7818)
@@ -6,10 +6,6 @@
<meta name="generator" content="Docutils 0.13: http://docutils.sourceforge.net/" />
<title>reStructuredText Test Document</title>
<meta name="author" content="David Goodger" />
-<meta name="authors" content="Me Myself I" />
-<meta name="organization" content="humankind" />
-<meta name="date" content="Now, or yesterday. Or maybe even before yesterday." />
-<meta name="copyright" content="This document has been placed in the public domain. You may do with it as you wish. You may copy, modify, redistribute, reattribute, sell, buy, rent, lease, destroy, or improve it, quote it at length, excerpt, incorporate, collate, fold, staple, or mutilate it, or do anything else to it that your or anyone else's heart desires." />
<meta content="reStructuredText, test, parser" name="keywords" />
<meta content="A test document, containing at least one example of each reStructuredText construct." name="description" xml:lang="en" />
<link rel="stylesheet" href="../input/data/html-base.css" type="text/css" />
@@ -24,8 +20,8 @@
<div class="document" id="restructuredtext-test-document">
<span id="doctitle"></span>
<h1 class="title">reStructuredText Test Document</h1>
-<h2 class="subtitle" id="examples-of-syntax-constructs"><span id="subtitle"></span>Examples of Syntax Constructs</h2>
+<p class="subtitle" id="examples-of-syntax-constructs"><span id="subtitle"></span>Examples of Syntax Constructs</p>
<dl class="docinfo">
<dt class="author">Author</dt>
<dd class="author"><p>David Goodger</p></dd>
@@ -162,10 +158,10 @@
<h1><a class="toc-backref" href="#id38"><span class="sectnum">1</span> Structural Elements</a></h1>
<div class="section" id="section-title">
<h2 class="with-subtitle"><a class="toc-backref" href="#id39"><span class="sectnum">1.1</span> Section Title</a></h2>
-<h2 class="section-subtitle" id="section-subtitle"><span class="section-subtitle">Section Subtitle</span></h2>
+<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 <tt class="literal"><span class="pre">--section-subtitles</span></tt> command line option or the
-<tt class="literal"><span class="pre">sectsubtitle-xform</span></tt> configuration value.</p>
+activated with the <span class="docutils...
[truncated message content] |