|
From: <mi...@us...> - 2019-11-04 21:14:47
|
Revision: 8410
http://sourceforge.net/p/docutils/code/8410
Author: milde
Date: 2019-11-04 21:14:43 +0000 (Mon, 04 Nov 2019)
Log Message:
-----------
buildhtml.py: New option "--html-writer".
Modified Paths:
--------------
trunk/docutils/HISTORY.txt
trunk/docutils/RELEASE-NOTES.txt
trunk/docutils/docutils/writers/html5_polyglot/__init__.py
trunk/docutils/docutils.conf
trunk/docutils/tools/buildhtml.py
trunk/docutils/tools/rst2html5.py
Modified: trunk/docutils/HISTORY.txt
===================================================================
--- trunk/docutils/HISTORY.txt 2019-10-30 15:35:28 UTC (rev 8409)
+++ trunk/docutils/HISTORY.txt 2019-11-04 21:14:43 UTC (rev 8410)
@@ -92,7 +92,14 @@
- Fix [ 359 ]: Test suite failes on Python 3.8. odt xml sorting.
Use ElementTree instead of minidom.
+* tools/buildhtml.py
+ - New option "--html-writer" allows to select "html__" (default),
+ "html4" or "html5".
+
+ __ html: docs/user/html.html#html
+
+
Release 0.15.1 (2019-07-24)
===========================
Modified: trunk/docutils/RELEASE-NOTES.txt
===================================================================
--- trunk/docutils/RELEASE-NOTES.txt 2019-10-30 15:35:28 UTC (rev 8409)
+++ trunk/docutils/RELEASE-NOTES.txt 2019-11-04 21:14:43 UTC (rev 8410)
@@ -48,11 +48,11 @@
* Remove ``utils.unique_combinations``
(obsoleted by ``itertools.combinations``).
-
+
* If the id_prefix_ setting is non-empty, leading number and hyphen characters
will not be stripped from a `reference name`_ during `identifier
normalization`_. This may change generated `identifier keys`.
-
+
Example: with ``--id-prefix="DU-"``, a section with title "34. May"
currently gets the identifier key ``DU-may`` and after the change the
identifier key ``DU-34-may``.
@@ -106,13 +106,20 @@
- Deprecate ``\docutilsrole`` prefix for styling commands:
use ``\DUrole`` instead.
+* tools/buildhtml.py
+
+ - New option "--html-writer" allows to select "html__" (default),
+ "html4" or "html5".
+
+ __ html: docs/user/html.html#html
+
* docutils/io.py
- Remove the `handle_io_errors` option from io.FileInput/Output.
-Release 0.15
-============
+Release 0.15 (2019-07-20)
+=========================
.. Note::
Modified: trunk/docutils/docutils/writers/html5_polyglot/__init__.py
===================================================================
--- trunk/docutils/docutils/writers/html5_polyglot/__init__.py 2019-10-30 15:35:28 UTC (rev 8409)
+++ trunk/docutils/docutils/writers/html5_polyglot/__init__.py 2019-11-04 21:14:43 UTC (rev 8410)
@@ -20,7 +20,7 @@
"""
Plain HyperText Markup Language document tree Writer.
-The output conforms to the `HTML5` specification.
+The output conforms to the `HTML 5` specification.
The cascading style sheet "minimal.css" is required for proper viewing,
the style sheet "plain.css" improves reading experience.
Modified: trunk/docutils/docutils.conf
===================================================================
--- trunk/docutils/docutils.conf 2019-10-30 15:35:28 UTC (rev 8409)
+++ trunk/docutils/docutils.conf 2019-11-04 21:14:43 UTC (rev 8410)
@@ -10,6 +10,11 @@
embed-stylesheet: no
field-name-limit: 20
+[html5 writer]
+stylesheet-dirs: docutils/writers/html5_polyglot/
+stylesheet-path: minimal.css, plain.css
+embed-stylesheet: no
+
# Prevent tools/buildhtml.py from processing certain text files.
[buildhtml application]
ignore: GPL2.txt
Modified: trunk/docutils/tools/buildhtml.py
===================================================================
--- trunk/docutils/tools/buildhtml.py 2019-10-30 15:35:28 UTC (rev 8409)
+++ trunk/docutils/tools/buildhtml.py 2019-11-04 21:14:43 UTC (rev 8410)
@@ -32,7 +32,7 @@
from docutils.utils.error_reporting import ErrorOutput, ErrorString
from docutils.parsers import rst
from docutils.readers import standalone, pep
-from docutils.writers import html4css1, pep_html
+from docutils.writers import html4css1, html5_polyglot, pep_html
usage = '%prog [options] [<directory> ...]'
@@ -75,6 +75,12 @@
{'metavar': '<patterns>', 'action': 'append',
'default': [],
'validator': frontend.validate_colon_separated_string_list}),
+ ('HTML version, one of "html", "html4", "html5". '
+ 'Default: "html" (use Docutils\' default HTML writer).',
+ ['--html-writer'],
+ {'metavar': '<html_writer>',
+ 'choices': ['html', 'html4', 'html5'],
+ 'default': 'html'}),
('Work silently (no progress messages). Independent of "--quiet".',
['--silent'],
{'action': 'store_true', 'validator': frontend.validate_boolean}),
@@ -121,10 +127,14 @@
self.publishers = {
'': Struct(components=(pep.Reader, rst.Parser, pep_html.Writer,
SettingsSpec)),
- '.txt': Struct(components=(rst.Parser, standalone.Reader,
+ 'html4': Struct(components=(rst.Parser, standalone.Reader,
html4css1.Writer, SettingsSpec),
reader_name='standalone',
- writer_name='html'),
+ writer_name='html4'),
+ 'html5': Struct(components=(rst.Parser, standalone.Reader,
+ html5_polyglot.Writer, SettingsSpec),
+ reader_name='standalone',
+ writer_name='html5'),
'PEPs': Struct(components=(rst.Parser, pep.Reader,
pep_html.Writer, SettingsSpec),
reader_name='pep',
@@ -134,6 +144,8 @@
all components used by individual publishers."""
self.setup_publishers()
+ # default html writer (may change to html5 some time):
+ self.publishers['html'] = self.publishers['html4']
def setup_publishers(self):
"""
@@ -223,7 +235,7 @@
if name.startswith('pep-'):
publisher = 'PEPs'
else:
- publisher = '.txt'
+ publisher = self.initial_settings.html_writer
settings = self.get_settings(publisher, directory)
errout = ErrorOutput(encoding=settings.error_encoding)
pub_struct = self.publishers[publisher]
Modified: trunk/docutils/tools/rst2html5.py
===================================================================
--- trunk/docutils/tools/rst2html5.py 2019-10-30 15:35:28 UTC (rev 8409)
+++ trunk/docutils/tools/rst2html5.py 2019-11-04 21:14:43 UTC (rev 8410)
@@ -14,7 +14,7 @@
# Date: $Date$
"""
-A minimal front end to the Docutils Publisher, producing HTML 5 documents.
+A minimal front end to the Docutils Publisher, producing HTML 5 documents.
The output also conforms to XHTML 1.0 transitional
(except for the doctype declaration).
@@ -28,7 +28,7 @@
from docutils.core import publish_cmdline, default_description
-description = (u'Generates HTML 5 documents from standalone '
+description = (u'Generates HTML 5 documents from standalone '
u'reStructuredText sources '
+ default_description)
This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site.
|