diff options
| author | milde <milde@929543f6-e4f2-0310-98a6-ba3bd3dd1d04> | 2015-07-16 12:31:11 +0000 |
|---|---|---|
| committer | milde <milde@929543f6-e4f2-0310-98a6-ba3bd3dd1d04> | 2015-07-16 12:31:11 +0000 |
| commit | efcc824b21dcead44ed88dd7058c45084ffa8370 (patch) | |
| tree | c784dce348e3cc8d56b4df278484c4ca81ca3ff2 | |
| parent | 9246e95bf7d7833cd42e055877655ae182312d07 (diff) | |
| download | docutils-efcc824b21dcead44ed88dd7058c45084ffa8370.tar.gz | |
Rename html_base writer to html_plain, move xhtml11 writer back to sandbox.
git-svn-id: http://svn.code.sf.net/p/docutils/code/trunk@7901 929543f6-e4f2-0310-98a6-ba3bd3dd1d04
| -rw-r--r-- | docutils/HISTORY.txt | 18 | ||||
| -rw-r--r-- | docutils/RELEASE-NOTES.txt | 9 | ||||
| -rw-r--r-- | docutils/docs/dev/todo.txt | 58 | ||||
| -rw-r--r-- | docutils/docs/user/html.txt | 307 | ||||
| -rw-r--r-- | docutils/docs/user/links.txt | 41 | ||||
| -rw-r--r-- | docutils/docs/user/tools.txt | 26 | ||||
| -rw-r--r-- | docutils/docutils/writers/__init__.py | 8 | ||||
| -rw-r--r-- | docutils/docutils/writers/html4css1/__init__.py | 2 | ||||
| -rw-r--r-- | docutils/docutils/writers/html_plain/__init__.py (renamed from docutils/docutils/writers/html_base/__init__.py) | 0 | ||||
| -rw-r--r-- | docutils/docutils/writers/html_plain/math.css (renamed from docutils/docutils/writers/html_base/math.css) | 0 | ||||
| -rw-r--r-- | docutils/docutils/writers/html_plain/minimal.css (renamed from docutils/docutils/writers/html_base/minimal.css) | 0 | ||||
| -rw-r--r-- | docutils/docutils/writers/html_plain/plain.css (renamed from docutils/docutils/writers/html_base/plain.css) | 0 | ||||
| -rw-r--r-- | docutils/docutils/writers/html_plain/template.txt (renamed from docutils/docutils/writers/html_base/template.txt) | 0 | ||||
| -rwxr-xr-x | docutils/setup.py | 12 | ||||
| -rw-r--r-- | docutils/test/functional/expected/standalone_rst_html_plain.html (renamed from docutils/test/functional/expected/standalone_rst_html_base.html) | 2 | ||||
| l---------[-rw-r--r--] | docutils/test/functional/input/data/math.css | 277 | ||||
| l--------- | docutils/test/functional/input/data/minimal.css | 2 | ||||
| l--------- | docutils/test/functional/input/data/plain.css | 2 | ||||
| -rw-r--r-- | docutils/test/functional/input/standalone_rst_html_plain.txt (renamed from docutils/test/functional/input/standalone_rst_html_base.txt) | 2 | ||||
| -rw-r--r-- | docutils/test/functional/tests/math_output_mathml.py | 4 | ||||
| -rwxr-xr-x | docutils/test/test_writers/test_html4css1_misc.py | 2 | ||||
| -rw-r--r-- | docutils/test/test_writers/test_html_plain_misc.py (renamed from docutils/test/test_writers/test_html_base_misc.py) | 46 | ||||
| -rw-r--r-- | sandbox/html4strict/README.txt | 44 | ||||
| -rwxr-xr-x | sandbox/html4strict/rst2xhtml11.py (renamed from docutils/tools/rst2xhtml11.py) | 0 | ||||
| -rw-r--r-- | sandbox/html4strict/test/standalone_rst_xhtml11.py (renamed from docutils/test/functional/tests/standalone_rst_xhtml11.py) | 0 | ||||
| -rw-r--r-- | sandbox/html4strict/test/standalone_rst_xhtml11.txt (renamed from docutils/test/functional/input/standalone_rst_xhtml11.txt) | 0 | ||||
| -rw-r--r-- | sandbox/html4strict/test/standalone_rst_xhtml11.xhtml (renamed from docutils/test/functional/expected/standalone_rst_xhtml11.xhtml) | 0 | ||||
| l--------- | sandbox/html4strict/test/xhtml11.css (renamed from docutils/test/functional/input/data/xhtml11.css) | 0 | ||||
| -rw-r--r-- | sandbox/html4strict/xhtml11/__init__.py (renamed from docutils/docutils/writers/xhtml11/__init__.py) | 0 | ||||
| -rw-r--r-- | sandbox/html4strict/xhtml11/xhtml11.css (renamed from docutils/docutils/writers/xhtml11/xhtml11.css) | 0 |
30 files changed, 330 insertions, 532 deletions
diff --git a/docutils/HISTORY.txt b/docutils/HISTORY.txt index 27bfa8b4e..946e96390 100644 --- a/docutils/HISTORY.txt +++ b/docutils/HISTORY.txt @@ -43,15 +43,13 @@ Changes Since 0.12 - Add ``\colon`` macro, fix spacing around colons. Fixes [ 246 ]. - New upstream version (additional macros, piecewise integrals and sums). -* docutils/writers/html_base/ +* docutils/writers/html_plain/ - New HTML writer generating clean, polyglot_ markup conforming to `HTML 5`_ and compatible with `XHTML 1.0`_ Transitional. - CSS stylesheets ``minimal.css`` and ``plain.css`` with required and - recommended layout rules. - - Also base for the xhtml11_ writer. + The CSS stylesheets ``minimal.css`` and ``plain.css`` contain required + and recommended layout rules. * docutils/writers/html4css1/__init__.py @@ -84,16 +82,9 @@ Changes Since 0.12 - LuaLaTex compatibility: do not load "xunicode". -* docutils/writers/_`xhtml11`/ - - - New HTML writer generating `XHTML 1.1`_ styled with CSS2.1 - Moved to the docutils core from sandbox/html4strict. - - * tools/ - - New front-ends ``rst2xhtml.py`` and ``rst2html5.py`` for the - corresponding writers. + - New front-end ``rst2html5.py``. * tox.ini @@ -105,7 +96,6 @@ Changes Since 0.12 .. _polyglot: http://www.w3.org/TR/html-polyglot/ .. _HTML 5: http://www.w3.org/TR/html5/ .. _XHTML 1.0: http://www.w3.org/TR/xhtml1/ -.. _XHTML 1.1: http://www.w3.org/TR/xhtml11/ Release 0.12 (2014-07-06) diff --git a/docutils/RELEASE-NOTES.txt b/docutils/RELEASE-NOTES.txt index 7e6663f1b..9d2d5a0d6 100644 --- a/docutils/RELEASE-NOTES.txt +++ b/docutils/RELEASE-NOTES.txt @@ -38,19 +38,16 @@ Future changes Changes Since 0.12 ================== -* docutils/writers/ +* docutils/writers/html_plain - - New HTML writers generating `HTML 5`_ and `XHTML 1.1`_. + - New HTML writer generating `HTML 5`_. - New stylesheet ``html-base.css`` for default layout using CSS 2.1. * tools/ - - New front-ends ``rst2xhtml.py`` and ``rst2html5.py`` for the - corresponding writers. + - New front-end ``rst2html5.py``. .. _HTML 5: http://www.w3.org/TR/html5/ -.. _XHTML 1.1: http://www.w3.org/TR/xhtml11/ Release 0.12 (2014-07-06) diff --git a/docutils/docs/dev/todo.txt b/docutils/docs/dev/todo.txt index bb904c7f1..552098e3a 100644 --- a/docutils/docs/dev/todo.txt +++ b/docutils/docs/dev/todo.txt @@ -376,6 +376,44 @@ General Especially useful for character entity sets, text transform specs, boilerplate, etc. +* Support "include" as embedded inline-compatible directive in substitution + definitions, e.g. :: + + .. |version| include:: version.txt + + This document describes version |version| of ... + + (cf. Grzegorz Adam Hankiewicz's post from 2014-10-01 in docutils-devel) + +* Add an ``:optional: <replacement text>`` option to the "include" + directive? This would not throw an error for a missing file, instead a + warning is given and ``<replacement text>`` is used instead. It would be + the responsibility of the author to ensure the missing file does not lead + to problems later in the document. + + Use cases: + + + Standard rST syntax to replace Sphinx's "literalinclude":: + + .. include:: blah.cpp + :literal: + :optional: file ``blah.cpp`` not found + + + Variable content taken from a file, e.g. + + version.txt:: + + .. |version| replace:: 3.1 + + optionally used as:: + + .. include:: version.txt + :optional: .. |version| replace:: unknown + + This document describes version |version| of ... + + (cf. Grzegorz Adam Hankiewicz's post from 2014-10-01 in docutils-devel) + * Parameterize the Reporter object or class? See the `2004-02-18 "rest checking and source path"`_ thread. @@ -1725,6 +1763,20 @@ when used in a document. either by running it at the command line with a ``--help`` option or through an exposed API. [Suggestion for Optik.] + - _`body.float`: Generic float that can be used for figures, tables, + code listings, flowcharts, ... + + There is a Sphinx extension by Ignacio Fernández Galván <jellby@gmail.com> + + I implemented something for generic floats in sphinx, and submitted a + pull request that is still waiting:: + + .. float:: + :type: figure + :caption: My caption + + https://github.com/sphinx-doc/sphinx/pull/1858 + Interpreted Text ---------------- @@ -2506,9 +2558,9 @@ Image and figure directives + `<../../test/functional/expected/standalone_rst_html4css1.html>`__ + `<../../test/functional/expected/standalone_rst_latex.tex>`__ -* According to the HTML standard - http://www.w3.org/TR/html4/struct/objects.html#adef-align-IMG a right- or - left-aligned image should be floated alongside the paragraph. +* The default CSS styling for HTML output (plain.css, default.css) lets + text following a right- or left-aligned image float to the side of the + image/figure. + Use this default also for LaTeX? diff --git a/docutils/docs/user/html.txt b/docutils/docs/user/html.txt index c93889293..3f12f2659 100644 --- a/docutils/docs/user/html.txt +++ b/docutils/docs/user/html.txt @@ -5,98 +5,122 @@ Docutils HTML writers .. note:: This document is a working draft. Naming of writers, aliases, and front-ends may change before the release of Docutils 0.13. - The ⚠ symbol marks suggestions that are still open to - discussion and change. +.. contents:: Overview -------- -Docutils supports +* `Generic HTML writers`_ -* state of the art HTML (html_base_, html5) ⚠ + =========== ============== ============== ================= =========== + name alias(es) `front-end`_ HTML version CSS version + =========== ============== ============== ================= =========== + html4css1_ html4 rst2html4.py `XHTML 1 `CSS 1`_ + Transitional`_ -* state of the art XHTML (xhtml11_) ⚠ + .. html_ rst2html.py `XHTML 1 `CSS 1`_ + Transitional`_ -* older user agents with no/limited support for CSS and XHTML (html4css1_ - and descendants). + html_plain_ html5_ rst2html5.py `HTML 5`_ `CSS 3`_ + =========== ============== ============== ================= =========== -Additionally, there are special purpose writers (pep_html_, s5_html_) in the -Docutils core and others (e.g. html4trans_) in the sandbox. +* `Special HTML writers`_ -=========== ============== ============== ================= =========== -name alias(es) `front-end`_ HTML version(s) CSS version -=========== ============== ============== ================= =========== -[#base]_ HTML5_, (`XHTML 1 `CSS 3`_ - Transitional`_) + =========== ============== ============== ================= =========== + name alias(es) `front-end`_ HTML version CSS version + =========== ============== ============== ================= =========== + pep_html_ .. rstpep2html.py `XHTML 1 `CSS 1`_ + Transitional`_ -[#5]_ html5 [#5]_ rst2html5.py HTML5_, `CSS 3`_ + s5_html_ s5 rst2s5.py `XHTML 1 `CSS 1`_ + Transitional`_ + =========== ============== ============== ================= =========== -xhtml11_ xhtml, rst2xhtml.py `XHTML 1.1`_, `CSS 3`_ - html4strict (HTML5_) +* `HTML writers in the sandbox`_ -html4css1_ html_ [#h]_, rst2html.py `XHTML 1 `CSS 1`_ - html4 Transitional`_ + =========== ============== ============== ================= =========== + name alias(es) `front-end`_ HTML version CSS version + =========== ============== ============== ================= =========== + xhtml11_ xhtml, rst2xhtml.py `XHTML 1.1`_ `CSS 3`_ + html4strict -pep_html_ .. rstpep2html.py `XHTML 1 `CSS 1`_ - Transitional`_ + html4trans_ .. rst2html_trans `XHTML 1 no CSS + Transitional`_ required + =========== ============== ============== ================= =========== -s5_html_ s5 rst2s5.py `XHTML 1 `CSS 1`_ - Transitional`_ -=========== ============== ============== ================= =========== -.. [#base] TODO: Find the right name for the basic html writer. -.. [#5] `html5` may become the name for a specialised `html5 writer`_ in a - future release. +.. _front-end: tools.html -.. There is one more HTML writer in the sandbox: +Generic HTML writers +-------------------- - html4trans_ rst2html_trans `XHTML 1 no CSS - [#sandbox]_ Transitional`_ required +html4css1 +~~~~~~~~~ - .. [#sandbox] in the sandbox +:aliases: html4, html_ +:front-ends: rst2html4.py, rst2html.py_ +:config: `[html4css1 writer]`_ -.. _front-end: tools.html +The HTML Writer module, ``docutils/writers/html4css1.py``, started +as a proof-of-concept reference implementation. It is the first Docutils +writer and was up to release 0.13 the only official HTML writer. -html ----- +The output conforms to the `XHTML 1 Transitional`_ specification. It does +not validate as `HTML 4.01 Transitional`_ due to the closing of empty tags +required in XML but not allowed in HTML 4. However, the output follows the +`HTML Compatibility Guidelines`_ for proper rendering on most HTML user +agents. -Currently, `html` is an alias for the html4css1_ writer. +Correct rendering depends on a CSS_ style sheet. A reference style sheet, +`html4css1.css`_, is provided and used by default. -.. admonition:: suggestion +To support the `Internet Explorer` (with a market share of about 90% around +2002, the time this writer was written), documents contain some hard-coded +formatting hints and are tagged as "text/html" (instead of +"application/xhtml+xml"). [#IE]_ - The writer alias `html` points to the "recommended Docutils HTML writer". - Its meaning may change with the development of HTML, browsers, Docutils, and - the web. +.. [#IE] Conformance to `CSS 2.1`_ has been added in IE 8 (2009), support + for XHTML in IE 9 (2011). - * Use `get_writer_by_name('html') or the ``rst2html.py`` front end, if you - want the output to be up-to-date automatically. +.. TODO: How to name a specific alias/front-end pointing to html4css1? - * Use a more specific writer name or front end, if you depend on stability - of the generated HTML code, e.g. because you use a custom style sheet or - post-processing that may break otherwise. + html4 + | +1 short form of html4css1, + | -1 writer produces XHTML 1, not HTML 4 + xhtml1 + | +1 correct and short description of the output format. + | -1 may be confused with xhtml11 or xhtml (aliases for the + "new" XHTML 1.1. writer inheriting from html_plain). -html_base ------------ -:aliases: html-common, html5 [#5]_ -:front-end: rst2html5.py_ -:config: `[html-base writer]`_ +.. _rst2html.py: tools.html#rst2html-py +.. _[html4css1 writer]: config.html#html4css1-writer +.. _html4css1.css: ../../docutils/writers/html4css1/html4css1.css + -The `html_base` module is both, basis for other HTML writers and a -versatile writer for end-users or programmatic use. ⚠ +html_plain +~~~~~~~~~~ + +:aliases: html5_ +:front-end: rst2html5.py_ +:config: `[html-plain writer]`_ -It generates `polyglot HTML`_ output (compatible with HTML5_ and `XHTML 1 -Transitional`_). New features and elements will only be used if they are -widely supported to make documents `viewable with any browser`_. +The `html_plain` module is both, basis for other HTML writers and a +versatile writer for end-users or programmatic use. -Correct rendering depends on a CSS_ style sheet. Leaving out hard-coded -formatting information from the HTML code allows adaption of the layout with -`custom style sheets`_. The provided style sheets minimal.css_ and -plain.css_ define required and optional styling rules respectively. +The ``html_plain`` writer generates `polyglot HTML`_ output that is +compatible with `HTML 5`_ and `XHTML 1 Transitional`_. New features and +elements will only be used if they are widely supported to make documents +`viewable with any browser`_. There is no hard-coded formatting information +in the HTML document. Correct rendering of elements not directly supported +by HTML depends on a CSS_ style sheet. The provided style sheets +minimal.css_ and plain.css_ define required and optional styling rules +respectively. Adaption of the layout is possible with `custom style +sheets`_. New in Docutils 0.13 -.. admonition:: TODO +.. TODO Find the right name for this writer. Suggestions: @@ -118,108 +142,52 @@ New in Docutils 0.13 html-base -1 not only base class but also suited for end-users - .. _rst2html5.py: tools.html#rst2html5-py -.. _[html-base writer]: config.html#html-base-writer -.. _minimal.css: ../../docutils/writers/html_base/minimal.css -.. _plain.css: ../../docutils/writers/html_base/plain.css +.. _[html-plain writer]: config.html#html-plain-writer +.. _minimal.css: ../../docutils/writers/html_plain/minimal.css +.. _plain.css: ../../docutils/writers/html_plain/plain.css .. _custom style sheets: ../howto/html-stylesheets.html .. _viewable with any browser: http://www.anybrowser.org/campaign - -xhtml11 +Aliases ~~~~~~~ -:aliases: xhtml, html4strict -:front-end: rst2xhtml.py_ -:config: `[xhtml11 writer]`_ -`XHTML 1.1`_ is the current version of the XML based `extensible Hypertext -Markup Language`. +html +"""" -The `xhtml11` writer inherits from html_base_ and adds compatibility to the -strict requirements of `XHTML 1.1`_: +Currently, `html` is an alias for the html4css1_ writer. -* There is no attribute "lang" (only "xml:lang"). +Suggestion + The alias `html` points to the "recommended Docutils HTML writer". + Its target may change with the development of HTML, browsers, Docutils, and + the web. -* Enumerated lists don't support the 'start' attribute. + * Use `get_writer_by_name('html') or the ``rst2html.py`` front end, if you + want the output to be up-to-date automatically. - The style sheet xhtml11.css_ adds support for a "start" value for - enumerated lists via a CSS-counter. This allows also nested enumeration. + * Use a specific writer name or front end, if you depend on stability of + the generated HTML code, e.g. because you use a custom style sheet or + post-processing that may break otherwise. -* ``<sup>`` and ``<sub>`` tags are not allowed in preformatted blocks - (``<pre>``). +html4 +""""" -The `math-output` `config setting`_ defaults to "MathML". +The alias `html4` provides a stable shortcut for the html4css1_ writer. New in Docutils 0.13 -.. _rst2xhtml.py: tools.html#rst2html5-py -.. _config setting: -.. _[xhtml11 writer]: config.html#xhtml11-writer -.. _xhtml11.css: ../../docutils/writers/xhtml11/xhtml11.css - - -.. _`html5 writer`: - html5 -~~~~~ - -The writer name `html5` is reserved for a HTML writer that makes use of new -features and objects defined in HTML5 but not (yet) fit for use in -`html_base` because of limited browser support (like <video>, <aside>, or -<section>). - -In Docutils 0.13, it is an alias to the html_base_ writer. ⚠ +""""" +In Docutils 0.13, html5 is an alias to the html_plain_ writer. -html4css1 ---------- - -:aliases: html4 [#html4]_, html [#h]_ -:front-ends: rst2html.py_, rst2html4.py -:config: `[html4css1 writer]`_ - -.. [#h] `html` may become an alias for html_base in a future release. ⚠ - -The HTML Writer module, ``docutils/writers/html4css1.py``, started -as a proof-of-concept reference implementation. It is the first Docutils -writer and was up to release 0.13 the only official HTML writer. - -The output conforms to the `XHTML 1 Transitional`_ specification. -Correct rendering depends on a CSS_ style sheet. A reference style sheet, -`html4css1.css`_, is provided and used by default. - -Due to the closing of empty tags required in XML but not allowed in HTML 4, -generated documents do not validate as `HTML 4.01 Transitional`_. -However, they follow the `HTML Compatibility Guidelines`_ for proper -rendering on most HTML user agents. - -To support the `Internet Explorer` [#IE]_ (with a market share of about 90% -around 2002, the time this writer was written), documents are tagged as -"text/html" (instead of "application/xhtml+xml") and contain some hard-coded -formatting hints. - -.. [#IE] Conformance to `CSS 2.1`_ has been added in the IE 8 (2009), support - for XHTML in IE 9 (2011). - -.. [#html4] TODO: How to name a specific alias/front-end pointing to html4css1? - - html4 - | +1 short form of html4css1, - | -1 writer produces XHTML 1, not HTML 4 - xhtml1 - | +1 correct and short description of the output format. - | -1 may be confused with xhtml11 or xhtml (aliases for the - "new" XHTML 1.1. writer inheriting from html_base). - - -.. _rst2html.py: tools.html#rst2html-py -.. _[html4css1 writer]: config.html#html4css1-writer -.. _html4css1.css: ../../docutils/writers/html4css1/html4css1.css - --------------------------------------------------------------------------- +In future releases, `html5` may become a separate HTML writer that makes use +of new features and objects defined in HTML5 but not (yet) fit for use in +`html_plain`_ because of limited browser support (like <video>, <aside>, or +<section>). -The following three HTML writers inherit from `html4css1`: +Special HTML writers +-------------------- pep_html ~~~~~~~~ @@ -228,11 +196,12 @@ pep_html :config: `[pep_html writer]`_ This is a special writer for the generation of `Python Enhancement -Proposals`_ (PEPs). It adds some PEP-Specific -Options, a style sheet and template. The front-end uses also a specialised +Proposals`_ (PEPs). It inherits from html4css1_ and adds some `PEP-specific +options`_, a style sheet and template. The front-end uses also a specialised reader. .. _rstpep2html.py: tools.html#rstpep2html-py +.. _PEP-specific options: .. _[pep_html writer]: config.html#pep-html-writer .. _Python Enhancement Proposals: https://www.python.org/dev/peps/ @@ -243,9 +212,9 @@ s5_html :front-end: rst2s5.py_ :config: `[s5_html writer]`_ -The `s5` writer is used to prepare `Easy Slide Shows With reST & S5`_. It -produces XHTML for use with S5_, the “Simple Standards-based Slide Show -System” by Eric Meyer. +The `s5` writer inherits from html4css1_. It produces XHTML for use with +S5_, the “Simple Standards-based Slide Show System” by Eric Meyer. See +`Easy Slide Shows With reST & S5`_ for details. .. _rst2s5.py: tools.html#rst2s5-py .. _[s5_html writer]: config.html#s5-html-writer @@ -254,15 +223,47 @@ System” by Eric Meyer. .. _theme: tools.html#themes +HTML writers in the sandbox +--------------------------- + +There are two more HTML writers in the sandbox_: + +xhtml11 +~~~~~~~ +:aliases: xhtml, html4strict +:front-end: rst2xhtml.py +:config: `[xhtml11 writer]` + +`XHTML 1.1`_ is the current version of the XML based `extensible Hypertext +Markup Language`. + +The `xhtml11` writer inherits from html_plain_ and adds compatibility to the +strict requirements of `XHTML 1.1`_: + +* There is no attribute "lang" (only "xml:lang"). + +* Enumerated lists don't support the 'start' attribute. + + The style sheet xhtml11.css_ adds support for a "start" value for + enumerated lists via a CSS-counter. This allows also nested enumeration. + +* ``<sup>`` and ``<sub>`` tags are not allowed in preformatted blocks + (``<pre>``). + +The `math-output` `config setting`_ defaults to "MathML". + +.. _sandbox: ../dev/policies.html#the-sandbox +.. _rst2xhtml.py: tools.html#rst2html5-py +.. _config setting: +.. _[xhtml11 writer]: config.html#xhtml11-writer +.. _xhtml11.css: ../../docutils/writers/xhtml11/xhtml11.css + + html4trans ~~~~~~~~~~ :front-end: rst2html_trans.py_ -Correct rendering of HTML+CSS requires considerable resources in form of -program code, memory space and computation time. On older machines or in -embedded devices this might pose a serious problem. - The `HTML writer for lightweight browsers`_ lives in the Docutils sandbox (`sandbox/html4trans`_) since 2008. It removes the dependency on CSS. The output conforms to `XHTML 1 Transitional`_ and contains sufficient @@ -277,9 +278,9 @@ has some drawbacks_.) HTML and CSS Versions ---------------------- +~~~~~~~~~~~~~~~~~~~~~ -_`HTML5` +_`HTML 5` `HTML5, A vocabulary and associated APIs for HTML and XHTML`, W3C Recommendation, 28 October 2014. http://www.w3.org/TR/html5/ diff --git a/docutils/docs/user/links.txt b/docutils/docs/user/links.txt index e798fc2e9..d5ecf8f8e 100644 --- a/docutils/docs/user/links.txt +++ b/docutils/docs/user/links.txt @@ -146,24 +146,41 @@ website generators and HTML variants It can generate complete web sites (interlinked and indexed HTML pages), ePub, PDF, and others [#]_ from a set of rst source files. - + .. [#] see http://sphinx-doc.org/config.html#options-for-epub-output + .. _Sphinx: http://sphinx.pocoo.org/ * Nikola_ static site generator, use restructured text by default. + .. _nikola: http://getnikola.com/ + +* Pelican_ is a static site generator (mainly for blogs). Articles/pages can + be written in reStructuredText or Markdown format. + + .. _pelican: http://docs.getpelican.com + * rst2ht_ by Oliver Rutherfurd, converts reStructuredText to an .ht template, for use with ht2html_. + .. _rst2ht: http://www.rutherfurd.net/articles/rst-ht2html.html + .. _ht2html: http://ht2html.sourceforge.net/ + * htmlnav_ by Gunnar Schwant, is an HTML writer which supports navigation bars. + .. _htmlnav: http://docutils.sf.net/sandbox/gschwant/htmlnav/ + * rest2web_, by Michael Foord, is a tool for creating web sites with reStructuredText. + .. _rest2web: http://www.voidspace.org.uk/python/rest2web/ + * rst2chm_ by Oliver Rutherfurd, generates Microsoft HTML Help files from reStructuredText files. + .. _rst2chm: http://www.rutherfurd.net/software/rst2chm/ + * `html4strict <http://docutils.sf.net/sandbox/html4strict/>`__ produces XHTML that strictly conforms to the XHTML 1.0 specification. @@ -175,22 +192,15 @@ website generators and HTML variants * A `simple HTML writer`_ by Bill Bumgarner that doesn't rely on CSS (stylesheets). -.. _Sphinx: http://sphinx.pocoo.org/ -.. _nikola: http://getnikola.com/ -.. _rst2ht: http://www.rutherfurd.net/articles/rst-ht2html.html -.. _ht2html: http://ht2html.sourceforge.net/ -.. _htmlnav: http://docutils.sf.net/sandbox/gschwant/htmlnav/ -.. _rst2chm: http://www.rutherfurd.net/software/rst2chm/ -.. _rest2web: http://www.voidspace.org.uk/python/rest2web/ -.. _simple HTML writer: http://docutils.sf.net/sandbox/bbum/DocArticle/ + .. _simple HTML writer: http://docutils.sf.net/sandbox/bbum/DocArticle/ ePub ```` - + * The `rst2epub`_ project by Robert Wierschke converts simple - reStructuredText doucments into valid epub files. - - .. simple but well structured with classes/modules for epub components, + reStructuredText doucments into valid epub files. + + .. simple but well structured with classes/modules for epub components, and a standard ``setup.py`` installation file. * rst2epub2_ by Matt Harrison includes the epublib (originally by Tim @@ -262,6 +272,11 @@ Convert other formats to reStructuredText: * xhtml2rest_, written by Antonios Christofides, is a simple utility to convert XHTML to reStructuredText. +* DashTable_ by Gustav Klopp converts HTML tables into reStructuredText. + Colspan and Rowspan supported! + + .. _DashTable: https://github.com/gustavklopp/DashTable + * Sphinx_ includes a `LaTeX to Rst converter <http://svn.python.org/projects/doctools/converter/>`__ in its source code (trimmed to importing the old Python docs). diff --git a/docutils/docs/user/tools.txt b/docutils/docs/user/tools.txt index 597bfed4f..47cfc490e 100644 --- a/docutils/docs/user/tools.txt +++ b/docutils/docs/user/tools.txt @@ -101,7 +101,7 @@ rst2html.py :Reader: Standalone :Parser: reStructuredText -:Writer: html (html4css1_; this will change to hmtl-base_ in future) +:Writer: html_ (html4css1_) The ``rst2html.py`` front end reads standalone reStructuredText source files and produces `XHTML 1.0 Transitional`_ output. @@ -129,7 +129,7 @@ Stylesheets option). A stylesheet is required for proper rendering. The default stylesheet (``docutils/writers/html4css1/html4css1.css``, located in the installation directory) is provided for basic use. To use -different stylesheet(s), you must specify the stylesheets' locations +different stylesheet(s), specify the stylesheets' location(s) as comma-separated list with the "``--stylesheet``" (for a URL) or "``--stylesheet-path``" (for a local file) command-line option, or with `configuration file`_ settings (e.g. ``./docutils.conf`` @@ -138,32 +138,24 @@ or ``~/.docutils``). To experiment with styles, please see the __ ../howto/html-stylesheets.html .. _html4css1: html.html#html4css1 +.. _html: html.html#html -rst2xhtml.py --------------- - -:Reader: Standalone -:Parser: reStructuredText -:Writer: xhtml (xhtml11) - -The ``rst2xhtml11.py`` front end reads standalone reStructuredText -source files and produces clean `XHTML 1.1`_ -output. A CSS 2 stylesheet is required for proper rendering; a complete -stylesheet is installed and used by default. rst2html5.py ------------ :Reader: Standalone :Parser: reStructuredText -:Writer: html5 (html-base_) +:Writer: html5 (html_plain_) The ``rst2html5.py`` front end reads standalone reStructuredText source files and produces simple `HTML 5`_ output (compatible to `XHTML 1.0 -Transitional`_). A CSS 2 stylesheet is required for proper rendering; a -complete stylesheet is installed and used by default. +Transitional`_). +Correct rendering of elements not directly supported by HTML depends on a +CSS style sheet. The provided style sheets ``minimal.css`` and ``plain.css`` +define required and optional styling rules respectively. -.. _html-base: html.html#html-base +.. _html_plain: html.html#html-plain rstpep2html.py -------------- diff --git a/docutils/docutils/writers/__init__.py b/docutils/docutils/writers/__init__.py index 075c4c265..dc2497cd2 100644 --- a/docutils/docutils/writers/__init__.py +++ b/docutils/docutils/writers/__init__.py @@ -120,18 +120,18 @@ class UnfilteredWriter(Writer): _writer_aliases = { - 'html': 'html4css1', # will change to html_base some day + 'html': 'html4css1', # may change to html_plain some day 'html4': 'html4css1', - 'html5': 'html_base', # until a special HTML 5 writer is ready + 'html5': 'html_plain', # until a special HTML 5 writer is ready 'html4strict': 'xhtml11', - 'html-base': 'html_base', + 'html-plain': 'html_plain', 'latex': 'latex2e', 'pprint': 'pseudoxml', 'pformat': 'pseudoxml', 'pdf': 'rlpdf', 's5': 's5_html', 'xelatex': 'xetex', - 'xhtml': 'xhtml11', + 'xhtml': 'html_plain', 'xhtml10': 'html4css1', 'xml': 'docutils_xml'} diff --git a/docutils/docutils/writers/html4css1/__init__.py b/docutils/docutils/writers/html4css1/__init__.py index d3e9ef9fc..ef22e33a6 100644 --- a/docutils/docutils/writers/html4css1/__init__.py +++ b/docutils/docutils/writers/html4css1/__init__.py @@ -47,7 +47,7 @@ class Writer(writers.Writer): os.path.abspath(os.path.dirname(__file__)), # for math.css os.path.abspath(os.path.join( - os.path.dirname(os.path.dirname(__file__)), 'html_base')) + os.path.dirname(os.path.dirname(__file__)), 'html_plain')) ] default_template = 'template.txt' diff --git a/docutils/docutils/writers/html_base/__init__.py b/docutils/docutils/writers/html_plain/__init__.py index 583e6aed7..583e6aed7 100644 --- a/docutils/docutils/writers/html_base/__init__.py +++ b/docutils/docutils/writers/html_plain/__init__.py diff --git a/docutils/docutils/writers/html_base/math.css b/docutils/docutils/writers/html_plain/math.css index e6eec6565..e6eec6565 100644 --- a/docutils/docutils/writers/html_base/math.css +++ b/docutils/docutils/writers/html_plain/math.css diff --git a/docutils/docutils/writers/html_base/minimal.css b/docutils/docutils/writers/html_plain/minimal.css index df86a6199..df86a6199 100644 --- a/docutils/docutils/writers/html_base/minimal.css +++ b/docutils/docutils/writers/html_plain/minimal.css diff --git a/docutils/docutils/writers/html_base/plain.css b/docutils/docutils/writers/html_plain/plain.css index ba244eab9..ba244eab9 100644 --- a/docutils/docutils/writers/html_base/plain.css +++ b/docutils/docutils/writers/html_plain/plain.css diff --git a/docutils/docutils/writers/html_base/template.txt b/docutils/docutils/writers/html_plain/template.txt index 2591bce35..2591bce35 100644 --- a/docutils/docutils/writers/html_base/template.txt +++ b/docutils/docutils/writers/html_plain/template.txt diff --git a/docutils/setup.py b/docutils/setup.py index df806e070..c96b852a3 100755 --- a/docutils/setup.py +++ b/docutils/setup.py @@ -135,7 +135,7 @@ what-you-see-is-what-you-get plaintext markup syntax.""", # wrap at col 60 'docutils.utils.math', 'docutils.writers', 'docutils.writers.html4css1', - 'docutils.writers.html_base', + 'docutils.writers.html_plain', 'docutils.writers.xhtml11', 'docutils.writers.pep_html', 'docutils.writers.s5_html', @@ -146,11 +146,11 @@ what-you-see-is-what-you-get plaintext markup syntax.""", # wrap at col 60 ], 'data_files': ([('docutils/parsers/rst/include', glob.glob('docutils/parsers/rst/include/*.txt')), - ('docutils/writers/html_base', - ['docutils/writers/html_base/minimal.css', - 'docutils/writers/html_base/plain.css', - 'docutils/writers/html_base/math.css', - 'docutils/writers/html_base/template.txt']), + ('docutils/writers/html_plain', + ['docutils/writers/html_plain/minimal.css', + 'docutils/writers/html_plain/plain.css', + 'docutils/writers/html_plain/math.css', + 'docutils/writers/html_plain/template.txt']), ('docutils/writers/html4css1', ['docutils/writers/html4css1/html4css1.css', 'docutils/writers/html4css1/template.txt']), diff --git a/docutils/test/functional/expected/standalone_rst_html_base.html b/docutils/test/functional/expected/standalone_rst_html_plain.html index 7bfce7fca..eb8d2a4ec 100644 --- a/docutils/test/functional/expected/standalone_rst_html_base.html +++ b/docutils/test/functional/expected/standalone_rst_html_plain.html @@ -1185,7 +1185,7 @@ with the default setting of <cite>field-name-limit: 14</cite>.</p> previous one but regarded "short" by html4css1.</p> </dd> </dl> -<p>With <span class="docutils literal">html_base</span>, a <cite>field list</cite> is typeset as CSS-styled <cite>definition +<p>With <span class="docutils literal">html_plain</span>, a <cite>field list</cite> is typeset as CSS-styled <cite>definition list</cite>. The default layout is similar to the look with <cite>html4css1</cite>:</p> <dl class="open field-list"> <dt>A long field name</dt> diff --git a/docutils/test/functional/input/data/math.css b/docutils/test/functional/input/data/math.css index e6eec6565..4e0ec724d 100644..120000 --- a/docutils/test/functional/input/data/math.css +++ b/docutils/test/functional/input/data/math.css @@ -1,276 +1 @@ -/* -* math2html: convert LaTeX equations to HTML output. -* -* Copyright (C) 2009,2010 Alex Fernández -* -* 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 -* -* Based on eLyXer: convert LyX source files to HTML output. -* http://elyxer.nongnu.org/ -*/ -/* --end-- -* CSS file for LaTeX formulas. -*/ - -/* Formulas */ -.formula { - text-align: center; - font-family: "Droid Serif", "DejaVu Serif", "STIX", serif; - margin: 1.2em 0; -} -span.formula { - white-space: nowrap; -} -div.formula { - padding: 0.5ex; - margin-left: auto; - margin-right: auto; -} - -/* Basic features */ -a.eqnumber { - display: inline-block; - float: right; - clear: right; - font-weight: bold; -} -span.unknown { - color: #800000; -} -span.ignored, span.arraydef { - display: none; -} -.formula i { - letter-spacing: 0.1ex; -} - -/* Alignment */ -.align-left, .align-l { - text-align: left; -} -.align-right, .align-r { - text-align: right; -} -.align-center, .align-c { - text-align: center; -} - -/* Structures */ -span.overline, span.bar { - text-decoration: overline; -} -.fraction, .fullfraction { - display: inline-block; - vertical-align: middle; - text-align: center; -} -.fraction .fraction { - font-size: 80%; - line-height: 100%; -} -span.numerator { - display: block; -} -span.denominator { - display: block; - padding: 0ex; - border-top: thin solid; -} -sup.numerator, sup.unit { - font-size: 70%; - vertical-align: 80%; -} -sub.denominator, sub.unit { - font-size: 70%; - vertical-align: -20%; -} -span.sqrt { - display: inline-block; - vertical-align: middle; - padding: 0.1ex; -} -sup.root { - font-size: 70%; - position: relative; - left: 1.4ex; -} -span.radical { - display: inline-block; - padding: 0ex; - font-size: 150%; - vertical-align: top; -} -span.root { - display: inline-block; - border-top: thin solid; - padding: 0ex; - vertical-align: middle; -} -span.symbol { - line-height: 125%; - font-size: 125%; -} -span.bigsymbol { - line-height: 150%; - font-size: 150%; -} -span.largesymbol { - font-size: 175%; -} -span.hugesymbol { - font-size: 200%; -} -span.scripts { - display: inline-table; - vertical-align: middle; -} -.script { - display: table-row; - text-align: left; - line-height: 150%; -} -span.limits { - display: inline-table; - vertical-align: middle; -} -.limit { - display: table-row; - line-height: 99%; -} -sup.limit, sub.limit { - line-height: 100%; -} -span.symbolover { - display: inline-block; - text-align: center; - position: relative; - float: right; - right: 100%; - bottom: 0.5em; - width: 0px; -} -span.withsymbol { - display: inline-block; -} -span.symbolunder { - display: inline-block; - text-align: center; - position: relative; - float: right; - right: 80%; - top: 0.3em; - width: 0px; -} - -/* Environments */ -span.array, span.bracketcases, span.binomial, span.environment { - display: inline-table; - text-align: center; - border-collapse: collapse; - margin: 0em; - vertical-align: middle; -} -span.arrayrow, span.binomrow { - display: table-row; - padding: 0ex; - border: 0ex; -} -span.arraycell, span.bracket, span.case, span.binomcell, span.environmentcell { - display: table-cell; - padding: 0ex 0.2ex; - line-height: 99%; - border: 0ex; -} -/* -* CSS file for LaTeX formulas, extra stuff: -* binomials, vertical braces, stackrel, fonts and colors. -*/ - -/* Inline binomials */ -span.binom { - display: inline-block; - vertical-align: middle; - text-align: center; - font-size: 80%; -} -span.binomstack { - display: block; - padding: 0em; -} - -/* Over- and underbraces */ -span.overbrace { - border-top: 2pt solid; -} -span.underbrace { - border-bottom: 2pt solid; -} - -/* Stackrel */ -span.stackrel { - display: inline-block; - text-align: center; -} -span.upstackrel { - display: block; - padding: 0em; - font-size: 80%; - line-height: 64%; - position: relative; - top: 0.15em; - -} -span.downstackrel { - display: block; - vertical-align: bottom; - padding: 0em; -} - -/* Fonts */ -span.mathsf, span.textsf { - font-style: normal; - font-family: sans-serif; -} -span.mathrm, span.textrm { - font-style: normal; - font-family: serif; -} -span.text, span.textnormal { - font-style: normal; -} -span.textipa { - color: #008080; -} -span.fraktur { - font-family: "Lucida Blackletter", eufm10, blackletter; -} -span.blackboard { - font-family: Blackboard, msbm10, serif; -} -span.scriptfont { - font-family: "Monotype Corsiva", "Apple Chancery", "URW Chancery L", cursive; - font-style: italic; -} - -/* Colors */ -span.colorbox { - display: inline-block; - padding: 5px; -} -span.fbox { - display: inline-block; - border: thin solid black; - padding: 2px; -} -span.boxed, span.framebox { - display: inline-block; - border: thin solid black; - padding: 5px; -} - +../../../../docutils/writers/html_plain/math.css
\ No newline at end of file diff --git a/docutils/test/functional/input/data/minimal.css b/docutils/test/functional/input/data/minimal.css index d1e1e8638..899b6bbba 120000 --- a/docutils/test/functional/input/data/minimal.css +++ b/docutils/test/functional/input/data/minimal.css @@ -1 +1 @@ -../../../../docutils/writers/html_base/minimal.css
\ No newline at end of file +../../../../docutils/writers/html_plain/minimal.css
\ No newline at end of file diff --git a/docutils/test/functional/input/data/plain.css b/docutils/test/functional/input/data/plain.css index 1f2ad9396..77def792e 120000 --- a/docutils/test/functional/input/data/plain.css +++ b/docutils/test/functional/input/data/plain.css @@ -1 +1 @@ -../../../../docutils/writers/html_base/plain.css
\ No newline at end of file +../../../../docutils/writers/html_plain/plain.css
\ No newline at end of file diff --git a/docutils/test/functional/input/standalone_rst_html_base.txt b/docutils/test/functional/input/standalone_rst_html_plain.txt index 67b832f37..d53486f42 100644 --- a/docutils/test/functional/input/standalone_rst_html_base.txt +++ b/docutils/test/functional/input/standalone_rst_html_plain.txt @@ -43,7 +43,7 @@ characters" but the field name uses a proportional font. :MMMMMMMMMMMMMM: a field name that is actually longer than the previous one but regarded "short" by html4css1. -With ``html_base``, a `field list` is typeset as CSS-styled `definition +With ``html_plain``, a `field list` is typeset as CSS-styled `definition list`. The default layout is similar to the look with `html4css1`: .. class:: open diff --git a/docutils/test/functional/tests/math_output_mathml.py b/docutils/test/functional/tests/math_output_mathml.py index 3e9149a98..dd1017746 100644 --- a/docutils/test/functional/tests/math_output_mathml.py +++ b/docutils/test/functional/tests/math_output_mathml.py @@ -5,10 +5,10 @@ test_destination = "math_output_mathml.xhtml" # Keyword parameters passed to publish_file. reader_name = "standalone" parser_name = "rst" -writer_name = "html-base" +writer_name = "html-plain" # Settings settings_overrides['math_output'] = 'MathML' # local copy of default stylesheet: # (test runs in ``docutils/test/``, we need relative path from there.) -settings_overrides['stylesheet_dirs'] = ('.', 'functional/input/data') +settings_overrides['stylesheet_dirs'] = ('.','functional/input/data') diff --git a/docutils/test/test_writers/test_html4css1_misc.py b/docutils/test/test_writers/test_html4css1_misc.py index 7bcb8d73b..f19f9e550 100755 --- a/docutils/test/test_writers/test_html4css1_misc.py +++ b/docutils/test/test_writers/test_html4css1_misc.py @@ -100,7 +100,7 @@ class SettingsTestCase(DocutilsTestSupport.StandardTestCase): styles = core.publish_parts(self.data, writer_name='html4css1', settings_overrides=mysettings)['stylesheet'] self.assertIn('docutils/writers/html4css1/html4css1.css', styles) - self.assertIn('docutils/writers/html_base/math.css', styles) + self.assertIn('docutils/writers/html_plain/math.css', styles) def test_custom_stylesheet_linked(self): # default + custom style sheet, linked diff --git a/docutils/test/test_writers/test_html_base_misc.py b/docutils/test/test_writers/test_html_plain_misc.py index f7db124bf..b69a967f3 100644 --- a/docutils/test/test_writers/test_html_base_misc.py +++ b/docutils/test/test_writers/test_html_plain_misc.py @@ -25,7 +25,7 @@ class EncodingTestCase(DocutilsTestSupport.StandardTestCase): 'stylesheet': '', '_disable_config': True,} result = core.publish_string( - u'EUR = \u20ac', writer_name='html_base', + u'EUR = \u20ac', writer_name='html_plain', settings_overrides=settings_overrides) # Encoding a euro sign with latin1 doesn't work, so the # xmlcharrefreplace handler is used. @@ -50,7 +50,7 @@ first term: second term: second def """ - result = core.publish_string(data, writer_name='html_base', + result = core.publish_string(data, writer_name='html_plain', settings_overrides=self.settings_overrides) self.assertIn(b('<dt class="for the second item">second term:</dt>'), result) @@ -67,7 +67,7 @@ first term: second term: second def """ - result = core.publish_string(data, writer_name='html_base', + result = core.publish_string(data, writer_name='html_plain', settings_overrides=self.settings_overrides) self.assertIn(b('<dt id="second-item">second term:</dt>'), result) @@ -79,7 +79,7 @@ class SettingsTestCase(DocutilsTestSupport.StandardTestCase): def test_default_stylesheet(self): # default style sheet, embedded mysettings = {'_disable_config': True,} - styles = core.publish_parts(self.data, writer_name='html_base', + styles = core.publish_parts(self.data, writer_name='html_plain', settings_overrides=mysettings)['stylesheet'] self.assertIn('Minimal style sheet ' 'for the HTML output of Docutils.', styles) @@ -88,19 +88,19 @@ class SettingsTestCase(DocutilsTestSupport.StandardTestCase): # default style sheet, linked mysettings = {'_disable_config': True, 'embed_stylesheet': False} - styles = core.publish_parts(self.data, writer_name='html_base', + styles = core.publish_parts(self.data, writer_name='html_plain', settings_overrides=mysettings)['stylesheet'] - self.assertIn('docutils/writers/html_base/minimal.css', styles) + self.assertIn('docutils/writers/html_plain/minimal.css', styles) def test_math_stylesheet_linked(self): # default + math style sheet, linked mysettings = {'_disable_config': True, 'embed_stylesheet': False, 'stylesheet_path': 'minimal.css, math.css'} - styles = core.publish_parts(self.data, writer_name='html_base', + styles = core.publish_parts(self.data, writer_name='html_plain', settings_overrides=mysettings)['stylesheet'] - self.assertIn('docutils/writers/html_base/minimal.css', styles) - self.assertIn('docutils/writers/html_base/math.css', styles) + self.assertIn('docutils/writers/html_plain/minimal.css', styles) + self.assertIn('docutils/writers/html_plain/math.css', styles) def test_custom_stylesheet_linked(self): # default + custom style sheet, linked @@ -108,30 +108,30 @@ class SettingsTestCase(DocutilsTestSupport.StandardTestCase): 'embed_stylesheet': False, 'stylesheet_path': 'minimal.css, ' 'data/ham.css'} - styles = core.publish_parts(self.data, writer_name='html_base', + styles = core.publish_parts(self.data, writer_name='html_plain', settings_overrides=mysettings)['stylesheet'] - self.assertIn('docutils/writers/html_base/minimal.css', styles) + self.assertIn('docutils/writers/html_plain/minimal.css', styles) self.assertIn('href="data/ham.css"', styles) def test_custom_stylesheet_dir(self): mysettings = {'_disable_config': True, 'embed_stylesheet': False, - 'stylesheet_dirs': ('../docutils/writers/html_base/', + 'stylesheet_dirs': ('../docutils/writers/html_plain/', 'data'), 'stylesheet_path': 'minimal.css, ham.css'} - styles = core.publish_parts(self.data, writer_name='html_base', + styles = core.publish_parts(self.data, writer_name='html_plain', settings_overrides=mysettings)['stylesheet'] - if os.path.isdir('../docutils/writers/html_base/'): - self.assertIn('docutils/writers/html_base/minimal.css', styles) + if os.path.isdir('../docutils/writers/html_plain/'): + self.assertIn('docutils/writers/html_plain/minimal.css', styles) self.assertIn('href="data/ham.css"', styles) def test_custom_stylesheet_dir_embedded(self): mysettings = {'_disable_config': True, 'embed_stylesheet': True, - 'stylesheet_dirs': ('../docutils/writers/html_base/', + 'stylesheet_dirs': ('../docutils/writers/html_plain/', 'data'), 'stylesheet_path': 'ham.css'} - styles = core.publish_parts(self.data, writer_name='html_base', + styles = core.publish_parts(self.data, writer_name='html_plain', settings_overrides=mysettings)['stylesheet'] self.assertIn('dl.docutils dd {\n margin-bottom: 0.5em }', styles) @@ -150,7 +150,7 @@ class MathTestCase(DocutilsTestSupport.StandardTestCase): def test_math_output_default(self): # HTML with math.css stylesheet (since 0.11) mysettings = {'_disable_config': True,} - styles = core.publish_parts(self.data, writer_name='html_base', + styles = core.publish_parts(self.data, writer_name='html_plain', settings_overrides=mysettings)['stylesheet'] self.assertIn('convert LaTeX equations to HTML output.', styles) @@ -159,7 +159,7 @@ class MathTestCase(DocutilsTestSupport.StandardTestCase): # use default MathJax URL mysettings = {'_disable_config': True, 'math_output': 'MathJax'} - head = core.publish_parts(self.data, writer_name='html_base', + head = core.publish_parts(self.data, writer_name='html_plain', settings_overrides=mysettings)['head'] self.assertIn(self.mathjax_script % self.default_mathjax_url, head) @@ -168,14 +168,14 @@ class MathTestCase(DocutilsTestSupport.StandardTestCase): mysettings = {'_disable_config': True, 'math_output': 'mathjax %s' % self.custom_mathjax_url} - head = core.publish_parts(self.data, writer_name='html_base', + head = core.publish_parts(self.data, writer_name='html_plain', settings_overrides=mysettings)['head'] self.assertIn(self.mathjax_script % self.custom_mathjax_url, head) def test_math_output_html(self): mysettings = {'_disable_config': True, 'math_output': 'HTML'} - head = core.publish_parts(self.data, writer_name='html_base', + head = core.publish_parts(self.data, writer_name='html_plain', settings_overrides=mysettings)['head'] # There should be no MathJax script when math_output is not MathJax self.assertNotIn('MathJax.js', head) @@ -185,7 +185,7 @@ class MathTestCase(DocutilsTestSupport.StandardTestCase): 'math_output': 'HTML math.css,custom/style.css', 'stylesheet_dirs': ('.', 'functional/input/data'), 'embed_stylesheet': False} - styles = core.publish_parts(self.data, writer_name='html_base', + styles = core.publish_parts(self.data, writer_name='html_plain', settings_overrides=mysettings)['stylesheet'] self.assertEqual(u"""\ <link rel="stylesheet" href="functional/input/data/minimal.css" type="text/css" /> @@ -198,7 +198,7 @@ class MathTestCase(DocutilsTestSupport.StandardTestCase): mysettings = {'_disable_config': True, 'math_output': 'MathJax'} # There should be no math script when text does not contain math - head = core.publish_parts('No math.', writer_name='html_base')['head'] + head = core.publish_parts('No math.', writer_name='html_plain')['head'] self.assertNotIn('MathJax', head) diff --git a/sandbox/html4strict/README.txt b/sandbox/html4strict/README.txt index 984a8f653..3efd0712f 100644 --- a/sandbox/html4strict/README.txt +++ b/sandbox/html4strict/README.txt @@ -79,27 +79,47 @@ This writer is for you, if you Usage ===== -For an example of programmatic use, see the `minimal front end to the -Docutils Publisher, producing valid XHTML 1.1` -<../../docutils/tools/rst2xhtml11.py>`_. +The `rst2xhtml.py`_ front end reads standalone reStructuredText +source files and produces clean `XHTML 1.1`_ +output. A CSS 2 stylesheet is required for proper rendering; a complete +stylesheet is installed and used by default. -This wrapper can called from the command line (when it is installed in the -BINARY PATH): +:Reader: Standalone +:Parser: reStructuredText +:Writer: xhtml (xhtml11) -Comman line use:: +This wrapper can be called from the command line (when it is installed in the +BINARY PATH):: rst2xhtml11.py [options] [<source> [<destination>]] The full usage text can be obtained with the ``--help`` option. +.. For an example of programmatic use, see the `minimal front end to the + Docutils Publisher, producing valid XHTML 1.1` + <../../docutils/tools/rst2xhtml11.py>`_. + Implementation ============== -The writer module subclasses the ``html4css1.Writer`` and -``html4css1.HTMLTranslator`` classes. Some methods are overwritten to -replace deprecated HTML constructs or hard coded formatting. +The writer module subclasses the ``html_plain.Writer`` and +``html_plain.HTMLTranslator`` classes and adds compatibility to the strict +requirements of `XHTML 1.1`_: + +* There is no attribute "lang" (only "xml:lang"). + +* Enumerated lists don't support the 'start' attribute. + + The style sheet xhtml11.css_ adds support for a "start" value for + enumerated lists via a CSS-counter. This allows also nested enumeration. + +* ``<sup>`` and ``<sub>`` tags are not allowed in preformatted blocks + (``<pre>``). + +The `math-output` `config setting`_ defaults to "MathML". + The xhtml11.css style sheet extends the standard layout for CSS2-conforming HTML browsers. @@ -402,3 +422,9 @@ References cascading style sheet by a lightweight html browser (e.g. `Dillo <http://www.dillo.org>`__ or the console browser `elinks <http://elinks.cz>`__). + +_`XHTML 1.1` + `XHTML™ 1.1 - Module-based XHTML - Second Edition`, + W3C Recommendation, 23 November 2010. + http://www.w3.org/TR/xhtml11/ + diff --git a/docutils/tools/rst2xhtml11.py b/sandbox/html4strict/rst2xhtml11.py index ab700a27c..ab700a27c 100755 --- a/docutils/tools/rst2xhtml11.py +++ b/sandbox/html4strict/rst2xhtml11.py diff --git a/docutils/test/functional/tests/standalone_rst_xhtml11.py b/sandbox/html4strict/test/standalone_rst_xhtml11.py index c8925ac9c..c8925ac9c 100644 --- a/docutils/test/functional/tests/standalone_rst_xhtml11.py +++ b/sandbox/html4strict/test/standalone_rst_xhtml11.py diff --git a/docutils/test/functional/input/standalone_rst_xhtml11.txt b/sandbox/html4strict/test/standalone_rst_xhtml11.txt index b5ec4242f..b5ec4242f 100644 --- a/docutils/test/functional/input/standalone_rst_xhtml11.txt +++ b/sandbox/html4strict/test/standalone_rst_xhtml11.txt diff --git a/docutils/test/functional/expected/standalone_rst_xhtml11.xhtml b/sandbox/html4strict/test/standalone_rst_xhtml11.xhtml index 190e27204..190e27204 100644 --- a/docutils/test/functional/expected/standalone_rst_xhtml11.xhtml +++ b/sandbox/html4strict/test/standalone_rst_xhtml11.xhtml diff --git a/docutils/test/functional/input/data/xhtml11.css b/sandbox/html4strict/test/xhtml11.css index 9d6083d54..9d6083d54 120000 --- a/docutils/test/functional/input/data/xhtml11.css +++ b/sandbox/html4strict/test/xhtml11.css diff --git a/docutils/docutils/writers/xhtml11/__init__.py b/sandbox/html4strict/xhtml11/__init__.py index 2664eef8f..2664eef8f 100644 --- a/docutils/docutils/writers/xhtml11/__init__.py +++ b/sandbox/html4strict/xhtml11/__init__.py diff --git a/docutils/docutils/writers/xhtml11/xhtml11.css b/sandbox/html4strict/xhtml11/xhtml11.css index 8daabdd91..8daabdd91 100644 --- a/docutils/docutils/writers/xhtml11/xhtml11.css +++ b/sandbox/html4strict/xhtml11/xhtml11.css |
