|
From: <mi...@us...> - 2022-06-17 11:31:31
|
Revision: 9077
http://sourceforge.net/p/docutils/code/9077
Author: milde
Date: 2022-06-17 11:31:28 +0000 (Fri, 17 Jun 2022)
Log Message:
-----------
Documentation update
Remove dead link and outdated footnote about limitations in Python2.
Add link to acceptable values of encoding error handlers.
Harmonise help output.
Use UTF-8 in prose text, error messages, and documentation.
Use 'utf-8' in code or when referring to code.
Modified Paths:
--------------
trunk/docutils/FAQ.txt
trunk/docutils/docs/ref/rst/directives.txt
trunk/docutils/docs/user/config.txt
trunk/docutils/docutils/frontend.py
trunk/docutils/test/data/help/docutils.txt
trunk/docutils/test/test_functional.py
trunk/docutils/test/test_io.py
Modified: trunk/docutils/FAQ.txt
===================================================================
--- trunk/docutils/FAQ.txt 2022-06-17 11:31:17 UTC (rev 9076)
+++ trunk/docutils/FAQ.txt 2022-06-17 11:31:28 UTC (rev 9077)
@@ -1099,12 +1099,9 @@
* `Python Unicode Tutorial
<http://www.reportlab.com/i18n/python_unicode_tutorial.html>`_
-* `Python Unicode Objects: Some Observations on Working With Non-ASCII
- Character Sets <http://effbot.org/zone/unicode-objects.htm>`_
-
The common case is with the default output encoding (UTF-8), when
either numbered sections are used (via the "sectnum_" directive) or
-symbol-footnotes. 3 non-breaking spaces are inserted in each numbered
+symbol-footnotes. Three non-breaking spaces are inserted in each numbered
section title, between the generated number and the title text. Most
footnote symbols are not available in ASCII, nor are non-breaking
spaces. When encoded with UTF-8 and viewed with ordinary ASCII tools,
@@ -1111,14 +1108,12 @@
these characters will appear to be multi-character garbage.
You may have an decoding problem in your browser (or editor, etc.).
-The encoding of the output is set to "utf-8", but your browser isn't
+The encoding of the output is set to UTF-8, but your browser isn't
recognizing that. You can either try to fix your browser (enable
"UTF-8 character set", sometimes called "Unicode"), or choose a
-different encoding for the HTML output. You can also try
+different `output-encoding`_. You can also try
``--output-encoding=ascii:xmlcharrefreplace`` for HTML or XML, but not
-applicable to non-XMLish outputs (if using runtime
-settings/configuration files, use ``output_encoding=ascii`` and
-``output_encoding_error_handler=xmlcharrefreplace``).
+applicable to non-XMLish outputs.
If you're generating document fragments, the "Content-Type" metadata
(between the HTML ``<head>`` and ``</head>`` tags) must agree with the
@@ -1132,6 +1127,7 @@
<?xml version="1.0" encoding="utf-8" ?>
.. _sectnum: docs/ref/rst/directives.html#sectnum
+.. _output-encoding: docs/user/config.html#output-encoding
How can I retrieve the body of the HTML document?
Modified: trunk/docutils/docs/ref/rst/directives.txt
===================================================================
--- trunk/docutils/docs/ref/rst/directives.txt 2022-06-17 11:31:17 UTC (rev 9076)
+++ trunk/docutils/docs/ref/rst/directives.txt 2022-06-17 11:31:28 UTC (rev 9077)
@@ -884,7 +884,7 @@
The horizontal alignment of the table. (New in Docutils 0.13)
``delim`` : char | "tab" | "space" [#whitespace-delim]_
- A one-character string\ [#ASCII-char]_ used to separate fields.
+ A one-character string used to separate fields.
Defaults to ``,`` (comma). May be specified as a Unicode code
point; see the unicode_ directive for syntax details.
@@ -893,7 +893,7 @@
Defaults to the document's input_encoding_.
``escape`` : char
- A one-character\ [#ASCII-char]_ string used to escape the
+ A one-character string used to escape the
delimiter or quote characters. May be specified as a Unicode
code point; see the unicode_ directive for syntax details. Used
when the delimiter is used in an unquoted field, or when quote
@@ -920,7 +920,7 @@
significant. The default is to ignore such whitespace.
``quote`` : char
- A one-character string\ [#ASCII-char]_ used to quote elements
+ A one-character string used to quote elements
containing the delimiter or which start with the quote
character. Defaults to ``"`` (quote). May be specified as a
Unicode code point; see the unicode_ directive for syntax
@@ -950,13 +950,7 @@
.. [#whitespace-delim] Whitespace delimiters are supported only for external
CSV files.
-.. [#ASCII-char] With Python 2, the values for the ``delimiter``,
- ``quote``, and ``escape`` options must be ASCII characters. (The csv
- module does not support Unicode and all non-ASCII characters are
- encoded as multi-byte utf-8 string). This limitation does not exist
- under Python 3.
-
List Table
==========
Modified: trunk/docutils/docs/user/config.txt
===================================================================
--- trunk/docutils/docs/user/config.txt 2022-06-17 11:31:17 UTC (rev 9076)
+++ trunk/docutils/docs/user/config.txt 2022-06-17 11:31:28 UTC (rev 9077)
@@ -298,8 +298,9 @@
error_encoding_error_handler
----------------------------
-The error handler for unencodable characters in error output. See
-output_encoding_error_handler_ for acceptable values.
+The error handler for unencodable characters in error output.
+Acceptable values are the `Error Handlers`_ of Python's "encoding" module.
+See also output_encoding_error_handler_.
Default: "backslashreplace"
Options: ``--error-encoding-error-handler, --error-encoding, -e``.
@@ -373,8 +374,9 @@
input_encoding_error_handler
----------------------------
-The error handler for undecodable characters in the input. Acceptable
-values include:
+The error handler for undecodable characters in the input.
+Acceptable values are the `Error Handlers`_ of Python's "encoding" module,
+including:
strict
Raise an exception in case of an encoding error.
@@ -384,10 +386,6 @@
ignore
Ignore malformed data and continue without further notice.
-Acceptable values are the same as for the "error" parameter of
-Python's ``unicode`` function; other values may be defined in
-applications or in future versions of Python.
-
Default: "strict".
Options: ``--input-encoding-error-handler, --input-encoding, -i``.
@@ -421,13 +419,14 @@
The text encoding for output.
-Default: "UTF-8". Options: ``--output-encoding, -o``.
+Default: "utf-8". Options: ``--output-encoding, -o``.
output_encoding_error_handler
-----------------------------
-The error handler for unencodable characters in the output. Acceptable
-values include:
+The error handler for unencodable characters in the output.
+Acceptable values are the `Error Handlers`_ of Python's "encoding" module,
+including:
strict
Raise an exception in case of an encoding error.
@@ -442,10 +441,6 @@
backslashreplace
Replace with backslash escape sequences, such as "``\u2020``".
-Acceptable values are the same as for the "error" parameter of
-Python's ``encode`` string method; other values may be defined in
-applications or in future versions of Python.
-
Default: "strict".
Options: ``--output-encoding-error-handler, --output-encoding, -o``.
@@ -455,7 +450,7 @@
Path to a file where Docutils will write a list of files that were
required to generate the output, e.g. included files or embedded
stylesheets [#dependencies]_. [#pwd]_ The format is one path per
-line with forward slashes as separator, the encoding is ``utf8``.
+line with forward slashes as separator, the encoding is UTF-8.
Set to ``-`` in order to write dependencies to stdout.
@@ -465,10 +460,10 @@
ham.html: ham.txt $(shell cat hamdeps.txt)
rst2html.py --record-dependencies=hamdeps.txt ham.txt ham.html
-If the filesystem encoding differs from utf8, replace the ``cat``
+If the filesystem encoding differs from UTF-8, replace the ``cat``
command with a call to a converter, e.g.::
- $(shell iconv -f utf8 -t latin1 hamdeps.txt)
+ $(shell iconv -f utf-8 -t latin1 hamdeps.txt)
Default: None. Option: ``--record-dependencies``.
@@ -2336,3 +2331,6 @@
.. _option lists: ../ref/rst/restructuredtext.html#option-lists
.. _tables: ../ref/rst/restructuredtext.html#tables
.. _table of contents: ../ref/rst/directives.html#contents
+
+.. _Error Handlers:
+ https://docs.python.org/3/library/codecs.html#error-handlers
Modified: trunk/docutils/docutils/frontend.py
===================================================================
--- trunk/docutils/docutils/frontend.py 2022-06-17 11:31:17 UTC (rev 9076)
+++ trunk/docutils/docutils/frontend.py 2022-06-17 11:31:28 UTC (rev 9077)
@@ -562,7 +562,7 @@
('Disable Python tracebacks. (default)',
['--no-traceback'], {'dest': 'traceback', 'action': 'store_false'}),
('Specify the encoding and optionally the '
- 'error handler of input text. Default: <locale-dependent>:strict.',
+ 'error handler of input text. Default: <auto-detect>:strict.',
['--input-encoding', '-i'],
{'metavar': '<name[:handler]>',
'validator': validate_encoding_and_error_handler}),
@@ -580,8 +580,8 @@
'"xmlcharrefreplace", "backslashreplace".',
['--output-encoding-error-handler'],
{'default': 'strict', 'validator': validate_encoding_error_handler}),
- ('Specify text encoding and error handler for error output. '
- 'Default: %s:%s.'
+ ('Specify text encoding and optionally error handler '
+ 'for error output. Default: %s:%s.'
% (default_error_encoding, default_error_encoding_error_handler),
['--error-encoding', '-e'],
{'metavar': '<name[:handler]>', 'default': default_error_encoding,
Modified: trunk/docutils/test/data/help/docutils.txt
===================================================================
--- trunk/docutils/test/data/help/docutils.txt 2022-06-17 11:31:17 UTC (rev 9076)
+++ trunk/docutils/test/data/help/docutils.txt 2022-06-17 11:31:28 UTC (rev 9077)
@@ -55,7 +55,7 @@
--no-traceback Disable Python tracebacks. (default)
--input-encoding=<name[:handler]>, -i <name[:handler]>
Specify the encoding and optionally the error handler
- of input text. Default: <locale-dependent>:strict.
+ of input text. Default: <auto-detect>:strict.
--input-encoding-error-handler=INPUT_ENCODING_ERROR_HANDLER
Specify the error handler for undecodable characters.
Choices: "strict" (default), "ignore", and "replace".
@@ -67,8 +67,8 @@
characters; "strict" (default), "ignore", "replace",
"xmlcharrefreplace", "backslashreplace".
--error-encoding=<name[:handler]>, -e <name[:handler]>
- Specify text encoding and error handler for error
- output. Default: utf-8:backslashreplace.
+ Specify text encoding and optionally error handler for
+ error output. Default: utf-8:backslashreplace.
--error-encoding-error-handler=ERROR_ENCODING_ERROR_HANDLER
Specify the error handler for unencodable characters
in error output. Default: backslashreplace.
Modified: trunk/docutils/test/test_functional.py
===================================================================
--- trunk/docutils/test/test_functional.py 2022-06-17 11:31:17 UTC (rev 9076)
+++ trunk/docutils/test/test_functional.py 2022-06-17 11:31:28 UTC (rev 9077)
@@ -157,7 +157,7 @@
no_expected = self.no_expected_template % {
'exp': expected_path, 'out': params['destination_path']}
self.assertTrue(os.access(expected_path, os.R_OK), no_expected)
- # samples are UTF8 encoded. 'rb' leads to errors with Python 3!
+ # samples are UTF-8 encoded. 'rb' leads to errors with Python 3!
f = open(expected_path, 'r', encoding='utf-8')
# Normalize line endings:
expected = '\n'.join(f.read().splitlines())
Modified: trunk/docutils/test/test_io.py
===================================================================
--- trunk/docutils/test/test_io.py 2022-06-17 11:31:17 UTC (rev 9076)
+++ trunk/docutils/test/test_io.py 2022-06-17 11:31:28 UTC (rev 9077)
@@ -130,8 +130,8 @@
self.assertEqual(data, ['Some include text.\n'])
def test_heuristics_no_utf8(self):
- # if no encoding is given and decoding with utf-8 fails,
- # use either the locale encoding (if specified) or latin-1:
+ # if no encoding is given and decoding with 'utf-8' fails,
+ # use either the locale encoding (if specified) or 'latin-1':
if io.locale_encoding not in ('utf-8', 'utf8'):
# in Py3k, the locale encoding is used without --input-encoding
# skipping the heuristic unless decoding fails.
This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site.
|
|
From: <mi...@us...> - 2022-06-17 11:31:42
|
Revision: 9078
http://sourceforge.net/p/docutils/code/9078
Author: milde
Date: 2022-06-17 11:31:40 +0000 (Fri, 17 Jun 2022)
Log Message:
-----------
Rename `io.locale_encoding` to mark it as internal.
The attribute was moved to "io" after the last release.
Backwards compatibility is ensured via `locale_encoding`
in the (deprecated) "utils.error_reporting" module.
Fix HISTORY entries.
Modified Paths:
--------------
trunk/docutils/HISTORY.txt
trunk/docutils/docutils/frontend.py
trunk/docutils/docutils/io.py
trunk/docutils/docutils/utils/error_reporting.py
trunk/docutils/test/test_io.py
trunk/docutils/test/test_parsers/test_rst/test_directives/test_date.py
Modified: trunk/docutils/HISTORY.txt
===================================================================
--- trunk/docutils/HISTORY.txt 2022-06-17 11:31:28 UTC (rev 9077)
+++ trunk/docutils/HISTORY.txt 2022-06-17 11:31:40 UTC (rev 9078)
@@ -31,6 +31,11 @@
Let `Publisher.publish()` print info and prompt when waiting for input
from a terminal (cf. https://clig.dev/#interactivity).
+* docutils/io.py
+ - New function `error_string()`
+ obsoletes `utils.error_reporting.ErrorString`.
+ - Class `ErrorOutput` moved here from `utils/error_reporting`.
+
* docutils/parsers/__init__.py
- Aliases "markdown" and "commonmark" point to "commonmark_wrapper".
@@ -76,8 +81,6 @@
* docutils/utils/__init__.py
- `decode_path()` returns `str` instance instead of `nodes.reprunicode`.
- - New function `error_string()` obsoletes utils.error_reporting.ErrorString.
- - Class `ErrorOutput` moved here from docutils/utils/error_reporting.py
* docutils/utils/error_reporting.py
Modified: trunk/docutils/docutils/frontend.py
===================================================================
--- trunk/docutils/docutils/frontend.py 2022-06-17 11:31:28 UTC (rev 9077)
+++ trunk/docutils/docutils/frontend.py 2022-06-17 11:31:40 UTC (rev 9078)
@@ -449,7 +449,8 @@
"""Lookup table for boolean configuration file settings."""
default_error_encoding = (getattr(sys.stderr, 'encoding', None)
- or io.locale_encoding or 'ascii')
+ or io._locale_encoding # noqa
+ or 'ascii')
default_error_encoding_error_handler = 'backslashreplace'
Modified: trunk/docutils/docutils/io.py
===================================================================
--- trunk/docutils/docutils/io.py 2022-06-17 11:31:28 UTC (rev 9077)
+++ trunk/docutils/docutils/io.py 2022-06-17 11:31:40 UTC (rev 9078)
@@ -20,7 +20,7 @@
# Guess the locale's preferred encoding.
-# If no valid guess can be made, locale_encoding is set to `None`:
+# If no valid guess can be made, _locale_encoding is set to `None`:
#
# TODO: check whether this is set correctly with every OS and Python version
# or whether front-end tools need to call `locale.setlocale()`
@@ -27,22 +27,22 @@
# before importing this module
try:
# Return locale encoding also in UTF-8 mode
- locale_encoding = locale.getlocale()[1] or locale.getdefaultlocale()[1]
- locale_encoding = locale_encoding.lower()
+ _locale_encoding = locale.getlocale()[1] or locale.getdefaultlocale()[1]
+ _locale_encoding = _locale_encoding.lower()
except ValueError as error: # OS X may set UTF-8 without language code
# See https://bugs.python.org/issue18378 fixed in 3.8
# and https://sourceforge.net/p/docutils/bugs/298/.
# Drop the special case after requiring Python >= 3.8
if "unknown locale: UTF-8" in error.args:
- locale_encoding = "utf-8"
+ _locale_encoding = "utf-8"
else:
- locale_encoding = None
+ _locale_encoding = None
except: # noqa any other problems determining the locale -> use None
- locale_encoding = None
+ _locale_encoding = None
try:
- codecs.lookup(locale_encoding)
+ codecs.lookup(_locale_encoding)
except (LookupError, TypeError):
- locale_encoding = None
+ _locale_encoding = None
class InputError(OSError): pass
@@ -139,8 +139,8 @@
# no BOM found. Start with UTF-8, because that only matches
# data that *IS* UTF-8:
encodings = ['utf-8', 'latin-1']
- if locale_encoding:
- encodings.insert(1, locale_encoding)
+ if _locale_encoding:
+ encodings.insert(1, _locale_encoding)
for enc in encodings:
try:
decoded = str(data, enc, self.error_handler)
@@ -267,7 +267,7 @@
"""Where warning output is sent."""
self.encoding = (encoding or getattr(destination, 'encoding', None)
- or locale_encoding or 'ascii')
+ or _locale_encoding or 'ascii')
"""The output character encoding."""
self.encoding_errors = encoding_errors
Modified: trunk/docutils/docutils/utils/error_reporting.py
===================================================================
--- trunk/docutils/docutils/utils/error_reporting.py 2022-06-17 11:31:28 UTC (rev 9077)
+++ trunk/docutils/docutils/utils/error_reporting.py 2022-06-17 11:31:40 UTC (rev 9078)
@@ -21,7 +21,6 @@
| SafeString -> str
| ErrorString -> docutils.io.error_string()
| ErrorOutput -> docutils.io.ErrorOutput
- | locale_encoding -> docutils.io.locale_encoding
Error reporting should be safe from encoding/decoding errors.
However, implicit conversions of strings and exceptions like
@@ -48,7 +47,7 @@
import sys
import warnings
-from docutils.io import locale_encoding
+from docutils.io import _locale_encoding as locale_encoding # noqa
warnings.warn('The `docutils.utils.error_reporting` module is deprecated '
'and will be removed in Docutils 0.21 or later.\n'
Modified: trunk/docutils/test/test_io.py
===================================================================
--- trunk/docutils/test/test_io.py 2022-06-17 11:31:28 UTC (rev 9077)
+++ trunk/docutils/test/test_io.py 2022-06-17 11:31:40 UTC (rev 9078)
@@ -132,11 +132,11 @@
def test_heuristics_no_utf8(self):
# if no encoding is given and decoding with 'utf-8' fails,
# use either the locale encoding (if specified) or 'latin-1':
- if io.locale_encoding not in ('utf-8', 'utf8'):
+ if io._locale_encoding not in ('utf-8', 'utf8'): # noqa
# in Py3k, the locale encoding is used without --input-encoding
# skipping the heuristic unless decoding fails.
return
- probed_encodings = (io.locale_encoding, 'latin-1')
+ probed_encodings = (io._locale_encoding, 'latin-1') # noqa
input = io.FileInput(source_path='data/latin1.txt')
data = input.read()
if input.successful_encoding not in probed_encodings:
Modified: trunk/docutils/test/test_parsers/test_rst/test_directives/test_date.py
===================================================================
--- trunk/docutils/test/test_parsers/test_rst/test_directives/test_date.py 2022-06-17 11:31:28 UTC (rev 9077)
+++ trunk/docutils/test/test_parsers/test_rst/test_directives/test_date.py 2022-06-17 11:31:40 UTC (rev 9078)
@@ -13,7 +13,7 @@
from test_parsers import DocutilsTestSupport
import time
-from docutils.io import locale_encoding
+from docutils.io import _locale_encoding # noqa
def suite():
@@ -63,7 +63,7 @@
# some locales return non-ASCII characters for names of days or months
# ensure the directive handles them correctly
-if locale_encoding in ('utf-8', 'utf8', 'latin-1', 'iso-8859-1'):
+if _locale_encoding in ('utf-8', 'utf8', 'latin-1', 'iso-8859-1'):
totest['decode date'] = [
["""\
.. |date| date:: täglich
This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site.
|
|
From: <mi...@us...> - 2022-06-19 14:01:06
|
Revision: 9080
http://sourceforge.net/p/docutils/code/9080
Author: milde
Date: 2022-06-19 14:01:03 +0000 (Sun, 19 Jun 2022)
Log Message:
-----------
Announce use of dpub-ARIA role "doc-footnote"
instead of ARIA role "note" for footnotes in Docutils 0.20.
Cf. [bugs:#450].
Modified Paths:
--------------
trunk/docutils/RELEASE-NOTES.txt
trunk/docutils/docs/ref/doctree.txt
Modified: trunk/docutils/RELEASE-NOTES.txt
===================================================================
--- trunk/docutils/RELEASE-NOTES.txt 2022-06-19 14:00:56 UTC (rev 9079)
+++ trunk/docutils/RELEASE-NOTES.txt 2022-06-19 14:01:03 UTC (rev 9080)
@@ -36,11 +36,9 @@
``[role="doc-noteref"]`` instead of ``.footnote-reference``
(see minimal.css for examples).
- - Remove option ``--embed-images`` (obsoleted by "image_loading_")
- in Docutils 2.0.
+ - Use dpub-ARIA role "doc-footnote" (instead of ARIA role "note")
+ for footnotes in Docutils 0.20.
- .. _image_loading: docs/user/config.html#image-loading
-
- Move attribution behind the blockquote to comply with the `"living
standard"`__. (HTML5__ allows <cite> elements inside a blockquote.)
@@ -48,6 +46,11 @@
__ https://www.w3.org/TR/2014/REC-html5-20141028/grouping-content.html
#the-blockquote-element
+ - Remove option ``--embed-images`` (obsoleted by "image_loading_")
+ in Docutils 2.0.
+
+ .. _image_loading: docs/user/config.html#image-loading
+
* `latex2e` writer:
- Change default of use_latex_citations_ setting to True
@@ -58,7 +61,7 @@
- Remove ``use_verbatim_when_possible`` setting
(use literal_block_env_: verbatim) in Docutils 2.0.
-
+
- Do not insert ``\usepackage[utf8]{inputenc}`` into UTF-8 encoded
LaTeX sources. UTF-8 is the default encoding for LaTeX2e since 2018.
Modified: trunk/docutils/docs/ref/doctree.txt
===================================================================
--- trunk/docutils/docs/ref/doctree.txt 2022-06-19 14:00:56 UTC (rev 9079)
+++ trunk/docutils/docs/ref/doctree.txt 2022-06-19 14:01:03 UTC (rev 9080)
@@ -2263,23 +2263,25 @@
The `DocBook "footnote"`_ element combines features of ``footnote``
and footnote_reference_.
+
+ The DPub ARIA role `"doc-footnote"`__ may be used to mark a (conforming__)
+ `HTML emulation`__ as "ancillary information, such as a citation or
+ commentary, that provides additional context to a referenced passage
+ of text".
- The `ARIA role "note"`__ may be used to mark a (conforming__)
- `HTML emulation`__ as "a section whose content is parenthetic or
- ancillary to the main content of the resource".
+ For collections of notes that occur at the end of a section, the
+ the DPub ARIA role `"doc-endnotes"`__ is more appropriate.
- Depending on the note's position, the `epub:type`__ *footnote* or
- *endnote* and the DPub ARIA role `"doc-footnote"`__ or
- `"doc-endnote"`__ may be applicable.
+ The corresponding types in the `EPUB 3 Structural Semantics
+ Vocabulary`__ are "footnote" and "endnote".
.. _DocBook "footnote": https://tdg.docbook.org/tdg/5.1/footnote.html
- __ https://www.w3.org/TR/wai-aria-1.1/#note
+ __ https://www.w3.org/TR/dpub-aria-1.0/#doc-footnote
__ https://www.w3.org/TR/html-aria/#docconformance
__ https://www.w3.org/TR/html51/
common-idioms-without-dedicated-elements.html#footnotes
- __ https://idpf.github.io/epub-vocabs/structure/#notes
- __ https://www.w3.org/TR/dpub-aria-1.0/#doc-footnote
- __ https://www.w3.org/TR/dpub-aria-1.0/#doc-endnote
+ __ https://www.w3.org/TR/dpub-aria-1.0/#doc-endnotes
+ __ https://www.w3.org/TR/epub-ssv-11/#notes
:Processing:
A ``footnote`` element should be set off from the rest of the
This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site.
|
|
From: <mi...@us...> - 2022-06-19 20:23:14
|
Revision: 9081
http://sourceforge.net/p/docutils/code/9081
Author: milde
Date: 2022-06-19 20:23:12 +0000 (Sun, 19 Jun 2022)
Log Message:
-----------
Add wrapper around groups of footnotes to facilitate styling as a list.
Adapt style sheets and tests.
Cf. bug #450.
Modified Paths:
--------------
trunk/docutils/HISTORY.txt
trunk/docutils/RELEASE-NOTES.txt
trunk/docutils/docutils/writers/_html_base.py
trunk/docutils/docutils/writers/html5_polyglot/plain.css
trunk/docutils/docutils/writers/html5_polyglot/tuftig.css
trunk/docutils/test/functional/expected/footnotes_html5.html
trunk/docutils/test/functional/expected/rst_html5_tuftig.html
trunk/docutils/test/functional/expected/standalone_rst_html5.html
trunk/docutils/test/test_writers/test_html5_polyglot_parts.py
Modified: trunk/docutils/HISTORY.txt
===================================================================
--- trunk/docutils/HISTORY.txt 2022-06-19 14:01:03 UTC (rev 9080)
+++ trunk/docutils/HISTORY.txt 2022-06-19 20:23:12 UTC (rev 9081)
@@ -96,6 +96,7 @@
- Add space before "charset" meta tag closing sequence.
- Remove class value "controls" from an `image` node with video content
after converting it to a "control" attribute of the <video> tag.
+ - Wrap groups of footnotes in an ``<aside>`` for easier styling.
* docutils/writers/pep_html/
Modified: trunk/docutils/RELEASE-NOTES.txt
===================================================================
--- trunk/docutils/RELEASE-NOTES.txt 2022-06-19 14:01:03 UTC (rev 9080)
+++ trunk/docutils/RELEASE-NOTES.txt 2022-06-19 20:23:12 UTC (rev 9081)
@@ -112,6 +112,14 @@
* Drop support for Python 2.7, 3.5, and 3.6.
+* Output changes:
+
+ HTML5:
+ Wrap groups of footnotes in an ``<aside>`` for easier styling.
+
+ The CSS rule ``.footnote-list { display: contents; }`` can be used to
+ restore the behaviour of custom CSS styles.
+
* After package installation, the CLI commands ``python -m docutils`` and
``docutils`` start the `generic command line front end tool`__.
Modified: trunk/docutils/docutils/writers/_html_base.py
===================================================================
--- trunk/docutils/docutils/writers/_html_base.py 2022-06-19 14:01:03 UTC (rev 9080)
+++ trunk/docutils/docutils/writers/_html_base.py 2022-06-19 20:23:12 UTC (rev 9081)
@@ -635,8 +635,8 @@
def depart_citation(self, node):
self.body.append('</div>\n')
- next_node = node.next_node(descend=False, siblings=True)
- if not isinstance(next_node, type(node)):
+ if not isinstance(node.next_node(descend=False, siblings=True),
+ type(node)):
self.body.append('</div>\n')
# Use DPub role (overwritten in HTML4)
@@ -943,15 +943,22 @@
self.body_suffix[:0] = footer
del self.body[start:]
- # use HTML5 element <aside> with ARIA role "note" for footnote text
- # (the html4css1 writer uses a table).
def visit_footnote(self, node):
- classes = [node.tagname, self.settings.footnote_references]
- self.body.append(self.starttag(node, 'aside', classes=classes,
+ # No native HTML element: use <aside> with ARIA role
+ # (html4css1 uses tables).
+ # Wrap groups of footnotes for easier styling.
+ label_style = self.settings.footnote_references # brackets/superscript
+ if not isinstance(node.previous_sibling(), type(node)):
+ self.body.append(f'<aside class="footnote-list {label_style}">\n')
+ self.body.append(self.starttag(node, 'aside',
+ classes=[node.tagname, label_style],
role="note"))
def depart_footnote(self, node):
self.body.append('</aside>\n')
+ if not isinstance(node.next_node(descend=False, siblings=True),
+ type(node)):
+ self.body.append('</aside>\n')
def visit_footnote_reference(self, node):
href = '#' + node['refid']
Modified: trunk/docutils/docutils/writers/html5_polyglot/plain.css
===================================================================
--- trunk/docutils/docutils/writers/html5_polyglot/plain.css 2022-06-19 14:01:03 UTC (rev 9080)
+++ trunk/docutils/docutils/writers/html5_polyglot/plain.css 2022-06-19 20:23:12 UTC (rev 9081)
@@ -199,18 +199,10 @@
/* ----------------------- */
/* line on the left */
-.footnote {
+.footnote-list {
border-left: solid thin;
- padding-left: 2.1em;
- margin-bottom: 0;
+ padding-left: 0.25em;
}
-.footnote + .footnote {
- padding-top: 0.5em;
- margin-top: 0;
-}
-.footnote.superscript {
- padding-left: 1.2em;
-}
/* Directives */
/* ---------- */
Modified: trunk/docutils/docutils/writers/html5_polyglot/tuftig.css
===================================================================
--- trunk/docutils/docutils/writers/html5_polyglot/tuftig.css 2022-06-19 14:01:03 UTC (rev 9080)
+++ trunk/docutils/docutils/writers/html5_polyglot/tuftig.css 2022-06-19 20:23:12 UTC (rev 9081)
@@ -222,7 +222,8 @@
}
/* Citation list (style as description list) */
-.citation-list {
+.citation-list,
+.footnote-list {
display: contents;
}
.citation {
Modified: trunk/docutils/test/functional/expected/footnotes_html5.html
===================================================================
--- trunk/docutils/test/functional/expected/footnotes_html5.html 2022-06-19 14:01:03 UTC (rev 9080)
+++ trunk/docutils/test/functional/expected/footnotes_html5.html 2022-06-19 20:23:12 UTC (rev 9081)
@@ -14,6 +14,7 @@
<p>Paragraphs may contain footnote references (manually numbered<a class="footnote-reference superscript" href="#footnote-1" id="footnote-reference-1" role="doc-noteref"><span class="fn-bracket">[</span>1<span class="fn-bracket">]</span></a>, anonymous auto-numbered<a class="footnote-reference superscript" href="#footnote-2" id="footnote-reference-2" role="doc-noteref"><span class="fn-bracket">[</span>3<span class="fn-bracket">]</span></a>, labeled auto-numbered<a class="footnote-reference superscript" href="#label" id="footnote-reference-3" role="doc-noteref"><span class="fn-bracket">[</span>2<span class="fn-bracket">]</span></a>, or
symbolic<a class="footnote-reference superscript" href="#footnote-3" id="footnote-reference-4" role="doc-noteref"><span class="fn-bracket">[</span>*<span class="fn-bracket">]</span></a>) or citation references (<a class="citation-reference" href="#cit2002" id="citation-reference-1" role="doc-biblioref">[CIT2002]</a>, <a class="citation-reference" href="#du2015" id="citation-reference-2" role="doc-biblioref">[DU2015]</a>).</p>
+<aside class="footnote-list superscript">
<aside class="footnote superscript" id="footnote-1" role="note">
<span class="label"><span class="fn-bracket">[</span>1<span class="fn-bracket">]</span></span>
<span class="backrefs">(<a role="doc-backlink" href="#footnote-reference-1">1</a>,<a role="doc-backlink" href="#footnote-reference-5">2</a>)</span>
@@ -50,6 +51,7 @@
<p>Here's an unreferenced footnote, with a reference to a
nonexistent footnote:<a class="footnote-reference superscript" href="#footnote-6" id="footnote-reference-8" role="doc-noteref"><span class="fn-bracket">[</span>5<span class="fn-bracket">]</span></a>.</p>
</aside>
+</aside>
<section id="citations">
<h2>Citations<a class="self-link" title="link to this section" href="#citations"></a></h2>
<div role="list" class="citation-list">
@@ -65,12 +67,15 @@
</div>
</div>
<p>Here's a reference to the above, <a class="citation-reference" href="#cit2002" id="citation-reference-3" role="doc-biblioref">[CIT2002]</a>.</p>
+<aside class="footnote-list superscript">
<aside class="footnote superscript" id="footnote-6" role="note">
<span class="label"><span class="fn-bracket">[</span><a role="doc-backlink" href="#footnote-reference-8">5</a><span class="fn-bracket">]</span></span>
<p>this footnote is missing in the standard example document.</p>
</aside>
+</aside>
<p>Footnotes may contain block elements like lists<a class="footnote-reference superscript" href="#footnote-7" id="footnote-reference-9" role="doc-noteref"><span class="fn-bracket">[</span>6<span class="fn-bracket">]</span></a><a class="footnote-reference superscript" href="#list-note" id="footnote-reference-10" role="doc-noteref"><span class="fn-bracket">[</span>7<span class="fn-bracket">]</span></a><a class="footnote-reference superscript" href="#footnote-8" id="footnote-reference-11" role="doc-noteref"><span class="fn-bracket">[</span>8<span class="fn-bracket">]</span></a>,
admonitions<a class="footnote-reference superscript" href="#footnote-9" id="footnote-reference-12" role="doc-noteref"><span class="fn-bracket">[</span>9<span class="fn-bracket">]</span></a>, or tables<a class="footnote-reference superscript" href="#footnote-10" id="footnote-reference-13" role="doc-noteref"><span class="fn-bracket">[</span>10<span class="fn-bracket">]</span></a>.</p>
+<aside class="footnote-list superscript">
<aside class="footnote superscript" id="footnote-7" role="note">
<span class="label"><span class="fn-bracket">[</span><a role="doc-backlink" href="#footnote-reference-9">6</a><span class="fn-bracket">]</span></span>
<ol class="arabic simple">
@@ -118,6 +123,7 @@
</tbody>
</table>
</aside>
+</aside>
<p>This<a class="footnote-reference superscript" href="#list-note" id="footnote-reference-14" role="doc-noteref"><span class="fn-bracket">[</span>7<span class="fn-bracket">]</span></a> is a second reference to the footnote containing
a bullet. list.</p>
</section>
Modified: trunk/docutils/test/functional/expected/rst_html5_tuftig.html
===================================================================
--- trunk/docutils/test/functional/expected/rst_html5_tuftig.html 2022-06-19 14:01:03 UTC (rev 9080)
+++ trunk/docutils/test/functional/expected/rst_html5_tuftig.html 2022-06-19 20:23:12 UTC (rev 9081)
@@ -127,11 +127,13 @@
</tr>
</tbody>
</table>
+<aside class="footnote-list superscript">
<aside class="footnote superscript align-left" id="not-in-margin" role="note">
<span class="label"><span class="fn-bracket">[</span>1<span class="fn-bracket">]</span></span>
<p>The “align-left” class value ensures this footnote is set
in the main text area.</p>
</aside>
+</aside>
</section>
</main>
<footer>
Modified: trunk/docutils/test/functional/expected/standalone_rst_html5.html
===================================================================
--- trunk/docutils/test/functional/expected/standalone_rst_html5.html 2022-06-19 14:01:03 UTC (rev 9080)
+++ trunk/docutils/test/functional/expected/standalone_rst_html5.html 2022-06-19 20:23:12 UTC (rev 9081)
@@ -471,6 +471,7 @@
</section>
<section id="footnotes">
<h3><a class="toc-backref" href="#toc-entry-17" role="doc-backlink"><span class="sectnum">2.11 </span>Footnotes</a></h3>
+<aside class="footnote-list brackets">
<aside class="footnote brackets" id="footnote-1" role="note">
<span class="label"><span class="fn-bracket">[</span>1<span class="fn-bracket">]</span></span>
<span class="backrefs">(<a role="doc-backlink" href="#footnote-reference-1">1</a>,<a role="doc-backlink" href="#footnote-reference-5">2</a>,<a role="doc-backlink" href="#footnote-reference-9">3</a>)</span>
@@ -507,6 +508,7 @@
<p>Here's an unreferenced footnote, with a reference to a
nonexistent footnote: <a href="#system-message-2"><span class="problematic" id="footnote-reference-8">[5]_</span></a>.</p>
</aside>
+</aside>
</section>
<section id="citations">
<h3><a class="toc-backref" href="#toc-entry-18" role="doc-backlink"><span class="sectnum">2.12 </span>Citations</a></h3>
@@ -823,6 +825,7 @@
</section>
<section id="target-footnotes">
<h4><a class="toc-backref" href="#toc-entry-59" role="doc-backlink"><span class="sectnum">2.14.6 </span>Target Footnotes</a></h4>
+<aside class="footnote-list brackets">
<aside class="footnote brackets" id="footnote-7" role="note">
<span class="label"><span class="fn-bracket">[</span>7<span class="fn-bracket">]</span></span>
<span class="backrefs">(<a role="doc-backlink" href="#footnote-reference-18">1</a>,<a role="doc-backlink" href="#footnote-reference-19">2</a>,<a role="doc-backlink" href="#footnote-reference-20">3</a>,<a role="doc-backlink" href="#footnote-reference-26">4</a>)</span>
@@ -876,6 +879,7 @@
<span class="label"><span class="fn-bracket">[</span><a role="doc-backlink" href="#footnote-reference-33">19</a><span class="fn-bracket">]</span></span>
<p><a class="reference external" href="https://html.spec.whatwg.org/multipage/edits.html">https://html.spec.whatwg.org/multipage/edits.html</a></p>
</aside>
+</aside>
</section>
<section id="replacement-text">
<h4><a class="toc-backref" href="#toc-entry-60" role="doc-backlink"><span class="sectnum">2.14.7 </span>Replacement Text</a></h4>
@@ -1581,10 +1585,12 @@
<cite>acronymes</cite>. In HTML, the <acronym> tag is obsolete and authors are
advised to use <abbr> instead. The HTML5 writer uses <abbr> for Docutil's
<abbreviation> element.</p>
+<aside class="footnote-list brackets">
<aside class="footnote brackets" id="footnote-6" role="note">
<span class="label"><span class="fn-bracket">[</span><a role="doc-backlink" href="#footnote-reference-11">‡</a><span class="fn-bracket">]</span></span>
<p>Irish Organic Farmers and Growers Association</p>
</aside>
+</aside>
</dd>
<dt>ruby, rt, rp</dt>
<dd><p>Ruby annotations</p>
@@ -1710,6 +1716,7 @@
</blockquote>
</dd>
</dl>
+<aside class="footnote-list brackets">
<aside class="footnote brackets" id="attribute-optional" role="note">
<span class="label"><span class="fn-bracket">[</span>5<span class="fn-bracket">]</span></span>
<span class="backrefs">(<a role="doc-backlink" href="#footnote-reference-10">1</a>,<a role="doc-backlink" href="#footnote-reference-14">2</a>,<a role="doc-backlink" href="#footnote-reference-16">3</a>,<a role="doc-backlink" href="#footnote-reference-17">4</a>)</span>
@@ -1722,6 +1729,7 @@
<p>Requires support for attributes to inline
roles to make sense.</p>
</aside>
+</aside>
</section>
<section id="indicating-edits">
<h3><a class="toc-backref" href="#toc-entry-52" role="doc-backlink"><span class="sectnum">3.4 </span>Indicating Edits</a></h3>
Modified: trunk/docutils/test/test_writers/test_html5_polyglot_parts.py
===================================================================
--- trunk/docutils/test/test_writers/test_html5_polyglot_parts.py 2022-06-19 14:01:03 UTC (rev 9080)
+++ trunk/docutils/test/test_writers/test_html5_polyglot_parts.py 2022-06-19 20:23:12 UTC (rev 9081)
@@ -675,6 +675,7 @@
{'fragment': '''\
<p>Two footnotes <a class="footnote-reference brackets" href="#f1" id="footnote-reference-1" role="doc-noteref"><span class="fn-bracket">[</span>1<span class="fn-bracket">]</span></a> <a class="footnote-reference brackets" href="#f2" id="footnote-reference-2" role="doc-noteref"><span class="fn-bracket">[</span>2<span class="fn-bracket">]</span></a> and two citations <a class="citation-reference" href="#once" id="citation-reference-1" role="doc-biblioref">[once]</a> <a class="citation-reference" href="#twice" id="citation-reference-2" role="doc-biblioref">[twice]</a>.</p>
<p>The latter are referenced a second time <a class="footnote-reference brackets" href="#f2" id="footnote-reference-3" role="doc-noteref"><span class="fn-bracket">[</span>2<span class="fn-bracket">]</span></a> <a class="citation-reference" href="#twice" id="citation-reference-3" role="doc-biblioref">[twice]</a>.</p>
+<aside class="footnote-list brackets">
<aside class="footnote brackets" id="f1" role="note">
<span class="label"><span class="fn-bracket">[</span>1<span class="fn-bracket">]</span></span>
<p>referenced once</p>
@@ -683,6 +684,7 @@
<span class="label"><span class="fn-bracket">[</span>2<span class="fn-bracket">]</span></span>
<p>referenced twice</p>
</aside>
+</aside>
<div role="list" class="citation-list">
<div class="citation" id="once" role="doc-biblioentry">
<span class="label"><span class="fn-bracket">[</span>once<span class="fn-bracket">]</span></span>
@@ -697,6 +699,7 @@
<main>
<p>Two footnotes <a class="footnote-reference brackets" href="#f1" id="footnote-reference-1" role="doc-noteref"><span class="fn-bracket">[</span>1<span class="fn-bracket">]</span></a> <a class="footnote-reference brackets" href="#f2" id="footnote-reference-2" role="doc-noteref"><span class="fn-bracket">[</span>2<span class="fn-bracket">]</span></a> and two citations <a class="citation-reference" href="#once" id="citation-reference-1" role="doc-biblioref">[once]</a> <a class="citation-reference" href="#twice" id="citation-reference-2" role="doc-biblioref">[twice]</a>.</p>
<p>The latter are referenced a second time <a class="footnote-reference brackets" href="#f2" id="footnote-reference-3" role="doc-noteref"><span class="fn-bracket">[</span>2<span class="fn-bracket">]</span></a> <a class="citation-reference" href="#twice" id="citation-reference-3" role="doc-biblioref">[twice]</a>.</p>
+<aside class="footnote-list brackets">
<aside class="footnote brackets" id="f1" role="note">
<span class="label"><span class="fn-bracket">[</span>1<span class="fn-bracket">]</span></span>
<p>referenced once</p>
@@ -705,6 +708,7 @@
<span class="label"><span class="fn-bracket">[</span>2<span class="fn-bracket">]</span></span>
<p>referenced twice</p>
</aside>
+</aside>
<div role="list" class="citation-list">
<div class="citation" id="once" role="doc-biblioentry">
<span class="label"><span class="fn-bracket">[</span>once<span class="fn-bracket">]</span></span>
This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site.
|
|
From: <mi...@us...> - 2022-06-20 10:06:34
|
Revision: 9082
http://sourceforge.net/p/docutils/code/9082
Author: milde
Date: 2022-06-20 10:06:31 +0000 (Mon, 20 Jun 2022)
Log Message:
-----------
Documentation update.
Add a warning about use of Python's default encoding by "quicktest.py".
Add cross-links, condense.
Modified Paths:
--------------
trunk/docutils/README.txt
trunk/docutils/docs/dev/hacking.txt
trunk/docutils/docs/user/tools.txt
Modified: trunk/docutils/README.txt
===================================================================
--- trunk/docutils/README.txt 2022-06-19 20:23:12 UTC (rev 9081)
+++ trunk/docutils/README.txt 2022-06-20 10:06:31 UTC (rev 9082)
@@ -349,22 +349,15 @@
two times represents the time required to set up the tests (import
modules, create data structures, etc.).
+A copy of the test output is written to the file ``alltests.out``.
+
If any of the tests fail, please `open a bug report`_ or `send an email`_
(see `Bugs <BUGS.html>`_).
Please include all relevant output, information about your operating
system, Python version, and Docutils version. To see the Docutils
-version, use one of the ``rst2*`` front ends or ``tools/quicktest.py``
-with the ``--version`` option, e.g.::
+version, look at the test output or use one of the `front-end scripts`_
+with the ``--version`` option.
- cd ../tools
- ./quicktest.py --version
-
-Windows users type these commands::
-
- cd ..\tools
- python quicktest.py --version
-
-
.. _Docutils Testing: https://docutils.sourceforge.io/docs/dev/testing.html
.. _open a bug report:
https://sourceforge.net/p/docutils/bugs/
Modified: trunk/docutils/docs/dev/hacking.txt
===================================================================
--- trunk/docutils/docs/dev/hacking.txt 2022-06-19 20:23:12 UTC (rev 9081)
+++ trunk/docutils/docs/dev/hacking.txt 2022-06-20 10:06:31 UTC (rev 9082)
@@ -71,7 +71,7 @@
The **Parser** analyzes the the input document and creates a **node
tree** representation. In this case we are using the
**reStructuredText parser** (``docutils/parsers/rst/__init__.py``).
-To see what that node tree looks like, we call ``quicktest.py`` (which
+To see what that node tree looks like, we call quicktest.py_ (which
can be found in the ``tools/`` directory of the Docutils distribution)
with our example file (``test.txt``) as first parameter (Windows users
might need to type ``python quicktest.py test.txt``)::
@@ -251,8 +251,8 @@
.. _Docutils-develop: ../user/mailing-lists.html#docutils-develop
+.. _quicktest.py: ../user/tools.html#quicktest-py
-
.. |---| unicode:: 8212 .. em-dash
:trim:
Modified: trunk/docutils/docs/user/tools.txt
===================================================================
--- trunk/docutils/docs/user/tools.txt 2022-06-19 20:23:12 UTC (rev 9081)
+++ trunk/docutils/docs/user/tools.txt 2022-06-20 10:06:31 UTC (rev 9082)
@@ -45,7 +45,8 @@
Tool names, install details and the set of auto-installed tools
may change in future Docutils versions.
-.. [#] The exceptions are buildhtml.py_ and rst2odt_prepstyles.py_.
+.. [#] The exceptions are buildhtml.py_, quicktest.py_ and
+ rst2odt_prepstyles.py_.
Getting Help
============
@@ -165,7 +166,9 @@
(e.g., because you use a custom style sheet or post-processing
that may break otherwise).
+.. _html: html.html#html
+
rst2html4.py
------------
@@ -196,21 +199,24 @@
``rst2html.py`` inserts into the generated HTML a cascading stylesheet
(or a link to a stylesheet, when passing the "``--link-stylesheet``"
-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), 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``
-or ``~/.docutils``). To experiment with styles, please see the
+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), specify the stylesheets' location(s) as
+comma-separated list with the "`-\-stylesheet`_"
+or "`-\-stylesheet-path`_" options.
+To experiment with styles, please see the
`guide to writing HTML (CSS) stylesheets for Docutils`__.
-__ ../howto/html-stylesheets.html
.. _html4css1: html.html#html4css1
-.. _html: html.html#html
+.. _link-stylesheet: config.html#embed-stylesheet
+.. _--stylesheet: config.html#stylesheet
+.. _--stylesheet-path: config.html#stylesheet-path
+__ ../howto/html-stylesheets.html
+
rst2html5.py
------------
@@ -525,7 +531,12 @@
--rawxml Raw native XML (with or without a stylesheet reference)
--help Usage hint and complete list of supported options.
+.. Caution:: ``quicktest.py`` uses Python's default encoding.
+ Input and output encoding depend on UTF-8 mode,
+ Python version, locale setting, and operating system
+ (cf. :PEP:`540`, :PEP:`538`, :PEP:`597`, and :PEP:`686`).
+
---------------
Customization
---------------
This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site.
|
|
From: <gr...@us...> - 2022-06-21 22:16:51
|
Revision: 9086
http://sourceforge.net/p/docutils/code/9086
Author: grubert
Date: 2022-06-21 22:16:48 +0000 (Tue, 21 Jun 2022)
Log Message:
-----------
version 0.19b2.dev
Modified Paths:
--------------
trunk/docutils/README.txt
trunk/docutils/docutils/__init__.py
trunk/docutils/setup.py
trunk/docutils/test/functional/expected/compact_lists.html
trunk/docutils/test/functional/expected/dangerous.html
trunk/docutils/test/functional/expected/embed_images_html5.html
trunk/docutils/test/functional/expected/field_name_limit.html
trunk/docutils/test/functional/expected/footnotes_html5.html
trunk/docutils/test/functional/expected/math_output_html.html
trunk/docutils/test/functional/expected/math_output_latex.html
trunk/docutils/test/functional/expected/math_output_mathjax.html
trunk/docutils/test/functional/expected/math_output_mathml.html
trunk/docutils/test/functional/expected/misc_rst_html4css1.html
trunk/docutils/test/functional/expected/misc_rst_html5.html
trunk/docutils/test/functional/expected/pep_html.html
trunk/docutils/test/functional/expected/rst_html5_tuftig.html
trunk/docutils/test/functional/expected/standalone_rst_docutils_xml.xml
trunk/docutils/test/functional/expected/standalone_rst_html4css1.html
trunk/docutils/test/functional/expected/standalone_rst_html5.html
trunk/docutils/test/functional/expected/standalone_rst_s5_html_1.html
trunk/docutils/test/functional/expected/standalone_rst_s5_html_2.html
Modified: trunk/docutils/README.txt
===================================================================
--- trunk/docutils/README.txt 2022-06-21 21:32:31 UTC (rev 9085)
+++ trunk/docutils/README.txt 2022-06-21 22:16:48 UTC (rev 9086)
@@ -1,6 +1,6 @@
-=========================
- README: Docutils 0.19b1
-=========================
+=============================
+ README: Docutils 0.19b2.dev
+=============================
:Author: David Goodger
:Contact: go...@py...
Modified: trunk/docutils/docutils/__init__.py
===================================================================
--- trunk/docutils/docutils/__init__.py 2022-06-21 21:32:31 UTC (rev 9085)
+++ trunk/docutils/docutils/__init__.py 2022-06-21 22:16:48 UTC (rev 9086)
@@ -54,7 +54,7 @@
__docformat__ = 'reStructuredText'
-__version__ = '0.19b1'
+__version__ = '0.19b2.dev'
"""Docutils version identifier (complies with PEP 440)::
major.minor[.micro][releaselevel[serial]][.dev]
@@ -118,8 +118,8 @@
minor=19,
micro=0,
releaselevel='beta', # one of 'alpha', 'beta', 'candidate', 'final'
- serial=1, # pre-release number (0 for final releases and snapshots)
- release=True # True for official releases and pre-releases
+ serial=2, # pre-release number (0 for final releases and snapshots)
+ release=False # True for official releases and pre-releases
)
"""Comprehensive version information tuple.
Modified: trunk/docutils/setup.py
===================================================================
--- trunk/docutils/setup.py 2022-06-21 21:32:31 UTC (rev 9085)
+++ trunk/docutils/setup.py 2022-06-21 22:16:48 UTC (rev 9086)
@@ -33,7 +33,7 @@
input Docutils supports reStructuredText, an easy-to-read,
what-you-see-is-what-you-get plaintext markup syntax.""", # wrap at col 60
'url': 'https://docutils.sourceforge.io/',
- 'version': '0.19b1',
+ 'version': '0.19b2.dev',
'author': 'David Goodger',
'author_email': 'go...@py...',
'maintainer': 'docutils-develop list',
Modified: trunk/docutils/test/functional/expected/compact_lists.html
===================================================================
--- trunk/docutils/test/functional/expected/compact_lists.html 2022-06-21 21:32:31 UTC (rev 9085)
+++ trunk/docutils/test/functional/expected/compact_lists.html 2022-06-21 22:16:48 UTC (rev 9086)
@@ -3,7 +3,7 @@
<html xmlns="http://www.w3.org/1999/xhtml" xml:lang="en" lang="en">
<head>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
-<meta name="generator" content="Docutils 0.19b1: https://docutils.sourceforge.io/" />
+<meta name="generator" content="Docutils 0.19b2.dev: https://docutils.sourceforge.io/" />
<title>compact_lists.txt</title>
<link rel="stylesheet" href="../input/data/html4css1.css" type="text/css" />
</head>
Modified: trunk/docutils/test/functional/expected/dangerous.html
===================================================================
--- trunk/docutils/test/functional/expected/dangerous.html 2022-06-21 21:32:31 UTC (rev 9085)
+++ trunk/docutils/test/functional/expected/dangerous.html 2022-06-21 22:16:48 UTC (rev 9086)
@@ -3,7 +3,7 @@
<html xmlns="http://www.w3.org/1999/xhtml" xml:lang="en" lang="en">
<head>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
-<meta name="generator" content="Docutils 0.19b1: https://docutils.sourceforge.io/" />
+<meta name="generator" content="Docutils 0.19b2.dev: https://docutils.sourceforge.io/" />
<title>dangerous.txt</title>
<link rel="stylesheet" href="../input/data/html4css1.css" type="text/css" />
</head>
Modified: trunk/docutils/test/functional/expected/embed_images_html5.html
===================================================================
--- trunk/docutils/test/functional/expected/embed_images_html5.html 2022-06-21 21:32:31 UTC (rev 9085)
+++ trunk/docutils/test/functional/expected/embed_images_html5.html 2022-06-21 22:16:48 UTC (rev 9086)
@@ -3,7 +3,7 @@
<head>
<meta charset="utf-8"/>
<meta name="viewport" content="width=device-width, initial-scale=1" />
-<meta name="generator" content="Docutils 0.19b1: https://docutils.sourceforge.io/" />
+<meta name="generator" content="Docutils 0.19b2.dev: https://docutils.sourceforge.io/" />
<title>Embedded Images</title>
<link rel="stylesheet" href="../input/data/minimal.css" type="text/css" />
<link rel="stylesheet" href="../input/data/plain.css" type="text/css" />
Modified: trunk/docutils/test/functional/expected/field_name_limit.html
===================================================================
--- trunk/docutils/test/functional/expected/field_name_limit.html 2022-06-21 21:32:31 UTC (rev 9085)
+++ trunk/docutils/test/functional/expected/field_name_limit.html 2022-06-21 22:16:48 UTC (rev 9086)
@@ -3,7 +3,7 @@
<html xmlns="http://www.w3.org/1999/xhtml" xml:lang="en" lang="en">
<head>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
-<meta name="generator" content="Docutils 0.19b1: https://docutils.sourceforge.io/" />
+<meta name="generator" content="Docutils 0.19b2.dev: https://docutils.sourceforge.io/" />
<title>field_list.txt</title>
<link rel="stylesheet" href="../input/data/html4css1.css" type="text/css" />
</head>
Modified: trunk/docutils/test/functional/expected/footnotes_html5.html
===================================================================
--- trunk/docutils/test/functional/expected/footnotes_html5.html 2022-06-21 21:32:31 UTC (rev 9085)
+++ trunk/docutils/test/functional/expected/footnotes_html5.html 2022-06-21 22:16:48 UTC (rev 9086)
@@ -3,7 +3,7 @@
<head>
<meta charset="utf-8" />
<meta name="viewport" content="width=device-width, initial-scale=1" />
-<meta name="generator" content="Docutils 0.19b1: https://docutils.sourceforge.io/" />
+<meta name="generator" content="Docutils 0.19b2.dev: https://docutils.sourceforge.io/" />
<title>Test footnote and citation rendering</title>
<link rel="stylesheet" href="../input/data/minimal.css" type="text/css" />
<link rel="stylesheet" href="../input/data/responsive.css" type="text/css" />
Modified: trunk/docutils/test/functional/expected/math_output_html.html
===================================================================
--- trunk/docutils/test/functional/expected/math_output_html.html 2022-06-21 21:32:31 UTC (rev 9085)
+++ trunk/docutils/test/functional/expected/math_output_html.html 2022-06-21 22:16:48 UTC (rev 9086)
@@ -3,7 +3,7 @@
<html xmlns="http://www.w3.org/1999/xhtml" xml:lang="en" lang="en">
<head>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
-<meta name="generator" content="Docutils 0.19b1: https://docutils.sourceforge.io/" />
+<meta name="generator" content="Docutils 0.19b2.dev: https://docutils.sourceforge.io/" />
<title>Mathematics</title>
<link rel="stylesheet" href="../input/data/html4css1.css" type="text/css" />
<link rel="stylesheet" href="../input/data/math.css" type="text/css" />
Modified: trunk/docutils/test/functional/expected/math_output_latex.html
===================================================================
--- trunk/docutils/test/functional/expected/math_output_latex.html 2022-06-21 21:32:31 UTC (rev 9085)
+++ trunk/docutils/test/functional/expected/math_output_latex.html 2022-06-21 22:16:48 UTC (rev 9086)
@@ -3,7 +3,7 @@
<html xmlns="http://www.w3.org/1999/xhtml" xml:lang="en" lang="en">
<head>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
-<meta name="generator" content="Docutils 0.19b1: https://docutils.sourceforge.io/" />
+<meta name="generator" content="Docutils 0.19b2.dev: https://docutils.sourceforge.io/" />
<title>Mathematics</title>
<link rel="stylesheet" href="../input/data/html4css1.css" type="text/css" />
</head>
Modified: trunk/docutils/test/functional/expected/math_output_mathjax.html
===================================================================
--- trunk/docutils/test/functional/expected/math_output_mathjax.html 2022-06-21 21:32:31 UTC (rev 9085)
+++ trunk/docutils/test/functional/expected/math_output_mathjax.html 2022-06-21 22:16:48 UTC (rev 9086)
@@ -3,7 +3,7 @@
<html xmlns="http://www.w3.org/1999/xhtml" xml:lang="en" lang="en">
<head>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
-<meta name="generator" content="Docutils 0.19b1: https://docutils.sourceforge.io/" />
+<meta name="generator" content="Docutils 0.19b2.dev: https://docutils.sourceforge.io/" />
<title>Mathematics</title>
<script type="text/javascript" src="/usr/share/javascript/mathjax/MathJax.js?config=TeX-AMS_CHTML"></script>
<link rel="stylesheet" href="../input/data/html4css1.css" type="text/css" />
Modified: trunk/docutils/test/functional/expected/math_output_mathml.html
===================================================================
--- trunk/docutils/test/functional/expected/math_output_mathml.html 2022-06-21 21:32:31 UTC (rev 9085)
+++ trunk/docutils/test/functional/expected/math_output_mathml.html 2022-06-21 22:16:48 UTC (rev 9086)
@@ -3,7 +3,7 @@
<head>
<meta charset="utf-8" />
<meta name="viewport" content="width=device-width, initial-scale=1" />
-<meta name="generator" content="Docutils 0.19b1: https://docutils.sourceforge.io/" />
+<meta name="generator" content="Docutils 0.19b2.dev: https://docutils.sourceforge.io/" />
<title>Mathematics</title>
<link rel="stylesheet" href="../input/data/minimal.css" type="text/css" />
<link rel="stylesheet" href="../input/data/plain.css" type="text/css" />
Modified: trunk/docutils/test/functional/expected/misc_rst_html4css1.html
===================================================================
--- trunk/docutils/test/functional/expected/misc_rst_html4css1.html 2022-06-21 21:32:31 UTC (rev 9085)
+++ trunk/docutils/test/functional/expected/misc_rst_html4css1.html 2022-06-21 22:16:48 UTC (rev 9086)
@@ -3,7 +3,7 @@
<html xmlns="http://www.w3.org/1999/xhtml" xml:lang="en" lang="en">
<head>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
-<meta name="generator" content="Docutils 0.19b1: https://docutils.sourceforge.io/" />
+<meta name="generator" content="Docutils 0.19b2.dev: https://docutils.sourceforge.io/" />
<title>Additional tests with html4css1</title>
<link rel="stylesheet" href="foo&bar.css" type="text/css" />
<link rel="stylesheet" href="../input/data/html4css1.css" type="text/css" />
Modified: trunk/docutils/test/functional/expected/misc_rst_html5.html
===================================================================
--- trunk/docutils/test/functional/expected/misc_rst_html5.html 2022-06-21 21:32:31 UTC (rev 9085)
+++ trunk/docutils/test/functional/expected/misc_rst_html5.html 2022-06-21 22:16:48 UTC (rev 9086)
@@ -3,7 +3,7 @@
<head>
<meta charset="utf-8" />
<meta name="viewport" content="width=device-width, initial-scale=1" />
-<meta name="generator" content="Docutils 0.19b1: https://docutils.sourceforge.io/" />
+<meta name="generator" content="Docutils 0.19b2.dev: https://docutils.sourceforge.io/" />
<title>Additional tests with HTML 5</title>
<link rel="stylesheet" href="../input/data/minimal.css" type="text/css" />
<link rel="stylesheet" href="../input/data/responsive.css" type="text/css" />
Modified: trunk/docutils/test/functional/expected/pep_html.html
===================================================================
--- trunk/docutils/test/functional/expected/pep_html.html 2022-06-21 21:32:31 UTC (rev 9085)
+++ trunk/docutils/test/functional/expected/pep_html.html 2022-06-21 22:16:48 UTC (rev 9086)
@@ -8,7 +8,7 @@
-->
<head>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
- <meta name="generator" content="Docutils 0.19b1: https://docutils.sourceforge.io/" />
+ <meta name="generator" content="Docutils 0.19b2.dev: https://docutils.sourceforge.io/" />
<title>PEP 100 - Test PEP</title>
<link rel="stylesheet" href="../input/data/html4css1.css" type="text/css" />
</head>
Modified: trunk/docutils/test/functional/expected/rst_html5_tuftig.html
===================================================================
--- trunk/docutils/test/functional/expected/rst_html5_tuftig.html 2022-06-21 21:32:31 UTC (rev 9085)
+++ trunk/docutils/test/functional/expected/rst_html5_tuftig.html 2022-06-21 22:16:48 UTC (rev 9086)
@@ -3,7 +3,7 @@
<head>
<meta charset="utf-8" />
<meta name="viewport" content="width=device-width, initial-scale=1" />
-<meta name="generator" content="Docutils 0.19b1: https://docutils.sourceforge.io/" />
+<meta name="generator" content="Docutils 0.19b2.dev: https://docutils.sourceforge.io/" />
<title>Special Features of the tuftig.css Stylesheet</title>
<link rel="stylesheet" href="../input/data/minimal.css" type="text/css" />
<link rel="stylesheet" href="../input/data/tuftig.css" type="text/css" />
Modified: trunk/docutils/test/functional/expected/standalone_rst_docutils_xml.xml
===================================================================
--- trunk/docutils/test/functional/expected/standalone_rst_docutils_xml.xml 2022-06-21 21:32:31 UTC (rev 9085)
+++ trunk/docutils/test/functional/expected/standalone_rst_docutils_xml.xml 2022-06-21 22:16:48 UTC (rev 9086)
@@ -1,6 +1,6 @@
<?xml version="1.0" encoding="utf-8"?>
<!DOCTYPE document PUBLIC "+//IDN docutils.sourceforge.net//DTD Docutils Generic//EN//XML" "http://docutils.sourceforge.net/docs/ref/docutils.dtd">
-<!-- Generated by Docutils 0.19b1 -->
+<!-- Generated by Docutils 0.19b2.dev -->
<document ids="restructuredtext-test-document doctitle" names="restructuredtext\ test\ document doctitle" source="functional/input/standalone_rst_docutils_xml.txt" title="reStructuredText Test Document">
<title>reStructuredText Test Document</title>
<subtitle ids="examples-of-syntax-constructs subtitle" names="examples\ of\ syntax\ constructs subtitle">Examples of Syntax Constructs</subtitle>
Modified: trunk/docutils/test/functional/expected/standalone_rst_html4css1.html
===================================================================
--- trunk/docutils/test/functional/expected/standalone_rst_html4css1.html 2022-06-21 21:32:31 UTC (rev 9085)
+++ trunk/docutils/test/functional/expected/standalone_rst_html4css1.html 2022-06-21 22:16:48 UTC (rev 9086)
@@ -3,7 +3,7 @@
<html xmlns="http://www.w3.org/1999/xhtml" xml:lang="en" lang="en">
<head>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
-<meta name="generator" content="Docutils 0.19b1: https://docutils.sourceforge.io/" />
+<meta name="generator" content="Docutils 0.19b2.dev: https://docutils.sourceforge.io/" />
<title>reStructuredText Test Document</title>
<meta content="reStructuredText, test, parser" name="keywords" />
<meta content="A test document, containing at least one example of each reStructuredText construct." lang="en" name="description" />
Modified: trunk/docutils/test/functional/expected/standalone_rst_html5.html
===================================================================
--- trunk/docutils/test/functional/expected/standalone_rst_html5.html 2022-06-21 21:32:31 UTC (rev 9085)
+++ trunk/docutils/test/functional/expected/standalone_rst_html5.html 2022-06-21 22:16:48 UTC (rev 9086)
@@ -3,7 +3,7 @@
<head>
<meta charset="utf-8" />
<meta name="viewport" content="width=device-width, initial-scale=1" />
-<meta name="generator" content="Docutils 0.19b1: https://docutils.sourceforge.io/" />
+<meta name="generator" content="Docutils 0.19b2.dev: https://docutils.sourceforge.io/" />
<title>reStructuredText Test Document</title>
<meta content="reStructuredText, test, parser" name="keywords" />
<meta content="A test document, containing at least one example of each reStructuredText construct." lang="en" name="description" xml:lang="en" />
Modified: trunk/docutils/test/functional/expected/standalone_rst_s5_html_1.html
===================================================================
--- trunk/docutils/test/functional/expected/standalone_rst_s5_html_1.html 2022-06-21 21:32:31 UTC (rev 9085)
+++ trunk/docutils/test/functional/expected/standalone_rst_s5_html_1.html 2022-06-21 22:16:48 UTC (rev 9086)
@@ -3,7 +3,7 @@
<html xmlns="http://www.w3.org/1999/xhtml" xml:lang="en" lang="en">
<head>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
-<meta name="generator" content="Docutils 0.19b1: https://docutils.sourceforge.io/" />
+<meta name="generator" content="Docutils 0.19b2.dev: https://docutils.sourceforge.io/" />
<meta name="version" content="S5 1.1" />
<title>Slide Shows</title>
<meta name="author" content="David Goodger" />
Modified: trunk/docutils/test/functional/expected/standalone_rst_s5_html_2.html
===================================================================
--- trunk/docutils/test/functional/expected/standalone_rst_s5_html_2.html 2022-06-21 21:32:31 UTC (rev 9085)
+++ trunk/docutils/test/functional/expected/standalone_rst_s5_html_2.html 2022-06-21 22:16:48 UTC (rev 9086)
@@ -3,7 +3,7 @@
<html xmlns="http://www.w3.org/1999/xhtml" xml:lang="en" lang="en">
<head>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
-<meta name="generator" content="Docutils 0.19b1: https://docutils.sourceforge.io/" />
+<meta name="generator" content="Docutils 0.19b2.dev: https://docutils.sourceforge.io/" />
<meta name="version" content="S5 1.1" />
<title>Slide Shows</title>
<meta name="author" content="David Goodger" />
This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site.
|
|
From: <mi...@us...> - 2022-06-22 08:51:19
|
Revision: 9089
http://sourceforge.net/p/docutils/code/9089
Author: milde
Date: 2022-06-22 08:51:16 +0000 (Wed, 22 Jun 2022)
Log Message:
-----------
`core.Publisher` ignored "input_encoding_error_handler" setting.
Modified Paths:
--------------
trunk/docutils/HISTORY.txt
trunk/docutils/docutils/core.py
Modified: trunk/docutils/HISTORY.txt
===================================================================
--- trunk/docutils/HISTORY.txt 2022-06-22 07:44:47 UTC (rev 9088)
+++ trunk/docutils/HISTORY.txt 2022-06-22 08:51:16 UTC (rev 9089)
@@ -11,6 +11,14 @@
.. contents::
+Changes since 0.19b1
+====================
+
+* docutils/core.py:
+
+ - Respect "input_encoding_error_handler" setting when opening a source.
+
+
Release 0.19b1 (2022-06-21)
===========================
Modified: trunk/docutils/docutils/core.py
===================================================================
--- trunk/docutils/docutils/core.py 2022-06-22 07:44:47 UTC (rev 9088)
+++ trunk/docutils/docutils/core.py 2022-06-22 08:51:16 UTC (rev 9089)
@@ -186,7 +186,8 @@
self.settings._source = source_path
self.source = self.source_class(
source=source, source_path=source_path,
- encoding=self.settings.input_encoding)
+ encoding=self.settings.input_encoding,
+ error_handler=self.settings.input_encoding_error_handler)
def set_destination(self, destination=None, destination_path=None):
if destination_path is None:
This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site.
|
|
From: <mi...@us...> - 2022-07-04 21:06:32
|
Revision: 9098
http://sourceforge.net/p/docutils/code/9098
Author: milde
Date: 2022-07-04 21:06:30 +0000 (Mon, 04 Jul 2022)
Log Message:
-----------
Don't use on Pythons default encoding if "input_encoding" setting is None.
If the "input_encoding" setting is None, the encoding of an
input source should be auto-detected with a heuristic.
Under Python 3, auto-detection was only used if reading a file
with Python's default encoding failed.
Resulting problems:
* EncodingWarning (PEP 597) in Python >= 3.10.
* Optional BOM not dropped from utf-8 encoded files.
* If the usrers locale sets an 8-bit encoding,
files in other 8-bit encodings, UTF-8, and UTF-16 show
character mix-up (mojibake) (self-declared encoding ignored as
reading in 8-bit encoding does not lead to errors).
Modified Paths:
--------------
trunk/docutils/HISTORY.txt
trunk/docutils/docutils/io.py
Modified: trunk/docutils/HISTORY.txt
===================================================================
--- trunk/docutils/HISTORY.txt 2022-07-04 21:06:22 UTC (rev 9097)
+++ trunk/docutils/HISTORY.txt 2022-07-04 21:06:30 UTC (rev 9098)
@@ -44,6 +44,7 @@
- New function `error_string()`
obsoletes `utils.error_reporting.ErrorString`.
- Class `ErrorOutput` moved here from `utils/error_reporting`.
+ - Don't use on Pythons default encoding if "input_encoding" setting is None.
* docutils/parsers/__init__.py
Modified: trunk/docutils/docutils/io.py
===================================================================
--- trunk/docutils/docutils/io.py 2022-07-04 21:06:22 UTC (rev 9097)
+++ trunk/docutils/docutils/io.py 2022-07-04 21:06:30 UTC (rev 9098)
@@ -358,7 +358,7 @@
if source_path:
try:
self.source = open(source_path, mode,
- encoding=self.encoding,
+ encoding=self.encoding or 'utf-8-sig',
errors=self.error_handler)
except OSError as error:
raise InputError(error.errno, error.strerror, source_path)
This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site.
|
|
From: <mi...@us...> - 2022-07-04 21:06:41
|
Revision: 9099
http://sourceforge.net/p/docutils/code/9099
Author: milde
Date: 2022-07-04 21:06:38 +0000 (Mon, 04 Jul 2022)
Log Message:
-----------
Fix handling of UTF-16 encoded source without trailing newline.
Decoding a UTF-16 encoded source with BOM after auto-detection of the
encoding failed.
The newline normalization in `docutils.FileInput.read()`
produced invalid UTF-16 because it added one byte
(binary ASCII newline).
Postponing the newline normalization after the decoding step solves
this problem.
Modified Paths:
--------------
trunk/docutils/HISTORY.txt
trunk/docutils/docutils/io.py
Modified: trunk/docutils/HISTORY.txt
===================================================================
--- trunk/docutils/HISTORY.txt 2022-07-04 21:06:30 UTC (rev 9098)
+++ trunk/docutils/HISTORY.txt 2022-07-04 21:06:38 UTC (rev 9099)
@@ -45,6 +45,7 @@
obsoletes `utils.error_reporting.ErrorString`.
- Class `ErrorOutput` moved here from `utils/error_reporting`.
- Don't use on Pythons default encoding if "input_encoding" setting is None.
+ - Fix error when reading of UTF-16 encoded source without trailing newline.
* docutils/parsers/__init__.py
Modified: trunk/docutils/docutils/io.py
===================================================================
--- trunk/docutils/docutils/io.py 2022-07-04 21:06:30 UTC (rev 9098)
+++ trunk/docutils/docutils/io.py 2022-07-04 21:06:38 UTC (rev 9099)
@@ -383,8 +383,6 @@
if self.source is sys.stdin:
# read as binary data to circumvent auto-decoding
data = self.source.buffer.read()
- # normalize newlines
- data = b'\n'.join(data.splitlines()+[b''])
else:
data = self.source.read()
except (UnicodeError, LookupError):
@@ -393,14 +391,14 @@
b_source = open(self.source_path, 'rb')
data = b_source.read()
b_source.close()
- # normalize newlines
- data = b'\n'.join(data.splitlines()+[b''])
else:
raise
finally:
if self.autoclose:
self.close()
- return self.decode(data)
+ data = self.decode(data)
+ # normalise newlines
+ return '\n'.join(data.splitlines()+[''])
def readlines(self):
"""
This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site.
|
|
From: <gr...@us...> - 2022-07-05 20:04:24
|
Revision: 9103
http://sourceforge.net/p/docutils/code/9103
Author: grubert
Date: 2022-07-05 20:04:21 +0000 (Tue, 05 Jul 2022)
Log Message:
-----------
release 0.19
Modified Paths:
--------------
trunk/docutils/HISTORY.txt
trunk/docutils/README.txt
trunk/docutils/RELEASE-NOTES.txt
trunk/docutils/docutils/__init__.py
trunk/docutils/setup.py
trunk/docutils/test/functional/expected/compact_lists.html
trunk/docutils/test/functional/expected/dangerous.html
trunk/docutils/test/functional/expected/embed_images_html5.html
trunk/docutils/test/functional/expected/field_name_limit.html
trunk/docutils/test/functional/expected/footnotes_html5.html
trunk/docutils/test/functional/expected/math_output_html.html
trunk/docutils/test/functional/expected/math_output_latex.html
trunk/docutils/test/functional/expected/math_output_mathjax.html
trunk/docutils/test/functional/expected/math_output_mathml.html
trunk/docutils/test/functional/expected/misc_rst_html4css1.html
trunk/docutils/test/functional/expected/misc_rst_html5.html
trunk/docutils/test/functional/expected/pep_html.html
trunk/docutils/test/functional/expected/rst_html5_tuftig.html
trunk/docutils/test/functional/expected/standalone_rst_docutils_xml.xml
trunk/docutils/test/functional/expected/standalone_rst_html4css1.html
trunk/docutils/test/functional/expected/standalone_rst_html5.html
trunk/docutils/test/functional/expected/standalone_rst_s5_html_1.html
trunk/docutils/test/functional/expected/standalone_rst_s5_html_2.html
Modified: trunk/docutils/HISTORY.txt
===================================================================
--- trunk/docutils/HISTORY.txt 2022-07-05 07:50:01 UTC (rev 9102)
+++ trunk/docutils/HISTORY.txt 2022-07-05 20:04:21 UTC (rev 9103)
@@ -12,8 +12,8 @@
.. contents::
-Release 0.19b2 (unpublished)
-============================
+Release 0.19 (2022-07-05)
+=========================
* General
Modified: trunk/docutils/README.txt
===================================================================
--- trunk/docutils/README.txt 2022-07-05 07:50:01 UTC (rev 9102)
+++ trunk/docutils/README.txt 2022-07-05 20:04:21 UTC (rev 9103)
@@ -1,6 +1,6 @@
-=============================
- README: Docutils 0.19b2.dev
-=============================
+=======================
+ README: Docutils 0.19
+=======================
:Author: David Goodger
:Contact: go...@py...
Modified: trunk/docutils/RELEASE-NOTES.txt
===================================================================
--- trunk/docutils/RELEASE-NOTES.txt 2022-07-05 07:50:01 UTC (rev 9102)
+++ trunk/docutils/RELEASE-NOTES.txt 2022-07-05 20:04:21 UTC (rev 9103)
@@ -121,9 +121,11 @@
.. _use_latex_citations: docs/user/config.html#use-latex-citations
-Release 0.19b1 (2022-06-21)
-===========================
+Release 0.19 (2022-07-05)
+=========================
+(Release 0.19b1 (2022-06-21))
+
* Drop support for Python 2.7, 3.5, and 3.6.
* Output changes:
Modified: trunk/docutils/docutils/__init__.py
===================================================================
--- trunk/docutils/docutils/__init__.py 2022-07-05 07:50:01 UTC (rev 9102)
+++ trunk/docutils/docutils/__init__.py 2022-07-05 20:04:21 UTC (rev 9103)
@@ -54,7 +54,7 @@
__docformat__ = 'reStructuredText'
-__version__ = '0.19b2.dev'
+__version__ = '0.19'
"""Docutils version identifier (complies with PEP 440)::
major.minor[.micro][releaselevel[serial]][.dev]
@@ -118,9 +118,9 @@
major=0,
minor=19,
micro=0,
- releaselevel='beta', # one of 'alpha', 'beta', 'candidate', 'final'
- serial=2, # pre-release number (0 for final releases and snapshots)
- release=False # True for official releases and pre-releases
+ releaselevel='final', # one of 'alpha', 'beta', 'candidate', 'final'
+ serial=0, # pre-release number (0 for final releases and snapshots)
+ release=True # True for official releases and pre-releases
)
"""Comprehensive version information tuple.
Modified: trunk/docutils/setup.py
===================================================================
--- trunk/docutils/setup.py 2022-07-05 07:50:01 UTC (rev 9102)
+++ trunk/docutils/setup.py 2022-07-05 20:04:21 UTC (rev 9103)
@@ -33,7 +33,7 @@
input Docutils supports reStructuredText, an easy-to-read,
what-you-see-is-what-you-get plaintext markup syntax.""", # wrap at col 60
'url': 'https://docutils.sourceforge.io/',
- 'version': '0.19b2.dev',
+ 'version': '0.19',
'author': 'David Goodger',
'author_email': 'go...@py...',
'maintainer': 'docutils-develop list',
Modified: trunk/docutils/test/functional/expected/compact_lists.html
===================================================================
--- trunk/docutils/test/functional/expected/compact_lists.html 2022-07-05 07:50:01 UTC (rev 9102)
+++ trunk/docutils/test/functional/expected/compact_lists.html 2022-07-05 20:04:21 UTC (rev 9103)
@@ -3,7 +3,7 @@
<html xmlns="http://www.w3.org/1999/xhtml" xml:lang="en" lang="en">
<head>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
-<meta name="generator" content="Docutils 0.19b2.dev: https://docutils.sourceforge.io/" />
+<meta name="generator" content="Docutils 0.19: https://docutils.sourceforge.io/" />
<title>compact_lists.txt</title>
<link rel="stylesheet" href="../input/data/html4css1.css" type="text/css" />
</head>
Modified: trunk/docutils/test/functional/expected/dangerous.html
===================================================================
--- trunk/docutils/test/functional/expected/dangerous.html 2022-07-05 07:50:01 UTC (rev 9102)
+++ trunk/docutils/test/functional/expected/dangerous.html 2022-07-05 20:04:21 UTC (rev 9103)
@@ -3,7 +3,7 @@
<html xmlns="http://www.w3.org/1999/xhtml" xml:lang="en" lang="en">
<head>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
-<meta name="generator" content="Docutils 0.19b2.dev: https://docutils.sourceforge.io/" />
+<meta name="generator" content="Docutils 0.19: https://docutils.sourceforge.io/" />
<title>dangerous.txt</title>
<link rel="stylesheet" href="../input/data/html4css1.css" type="text/css" />
</head>
Modified: trunk/docutils/test/functional/expected/embed_images_html5.html
===================================================================
--- trunk/docutils/test/functional/expected/embed_images_html5.html 2022-07-05 07:50:01 UTC (rev 9102)
+++ trunk/docutils/test/functional/expected/embed_images_html5.html 2022-07-05 20:04:21 UTC (rev 9103)
@@ -3,7 +3,7 @@
<head>
<meta charset="utf-8"/>
<meta name="viewport" content="width=device-width, initial-scale=1" />
-<meta name="generator" content="Docutils 0.19b2.dev: https://docutils.sourceforge.io/" />
+<meta name="generator" content="Docutils 0.19: https://docutils.sourceforge.io/" />
<title>Embedded Images</title>
<link rel="stylesheet" href="../input/data/minimal.css" type="text/css" />
<link rel="stylesheet" href="../input/data/plain.css" type="text/css" />
Modified: trunk/docutils/test/functional/expected/field_name_limit.html
===================================================================
--- trunk/docutils/test/functional/expected/field_name_limit.html 2022-07-05 07:50:01 UTC (rev 9102)
+++ trunk/docutils/test/functional/expected/field_name_limit.html 2022-07-05 20:04:21 UTC (rev 9103)
@@ -3,7 +3,7 @@
<html xmlns="http://www.w3.org/1999/xhtml" xml:lang="en" lang="en">
<head>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
-<meta name="generator" content="Docutils 0.19b2.dev: https://docutils.sourceforge.io/" />
+<meta name="generator" content="Docutils 0.19: https://docutils.sourceforge.io/" />
<title>field_list.txt</title>
<link rel="stylesheet" href="../input/data/html4css1.css" type="text/css" />
</head>
Modified: trunk/docutils/test/functional/expected/footnotes_html5.html
===================================================================
--- trunk/docutils/test/functional/expected/footnotes_html5.html 2022-07-05 07:50:01 UTC (rev 9102)
+++ trunk/docutils/test/functional/expected/footnotes_html5.html 2022-07-05 20:04:21 UTC (rev 9103)
@@ -3,7 +3,7 @@
<head>
<meta charset="utf-8" />
<meta name="viewport" content="width=device-width, initial-scale=1" />
-<meta name="generator" content="Docutils 0.19b2.dev: https://docutils.sourceforge.io/" />
+<meta name="generator" content="Docutils 0.19: https://docutils.sourceforge.io/" />
<title>Test footnote and citation rendering</title>
<link rel="stylesheet" href="../input/data/minimal.css" type="text/css" />
<link rel="stylesheet" href="../input/data/responsive.css" type="text/css" />
Modified: trunk/docutils/test/functional/expected/math_output_html.html
===================================================================
--- trunk/docutils/test/functional/expected/math_output_html.html 2022-07-05 07:50:01 UTC (rev 9102)
+++ trunk/docutils/test/functional/expected/math_output_html.html 2022-07-05 20:04:21 UTC (rev 9103)
@@ -3,7 +3,7 @@
<html xmlns="http://www.w3.org/1999/xhtml" xml:lang="en" lang="en">
<head>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
-<meta name="generator" content="Docutils 0.19b2.dev: https://docutils.sourceforge.io/" />
+<meta name="generator" content="Docutils 0.19: https://docutils.sourceforge.io/" />
<title>Mathematics</title>
<link rel="stylesheet" href="../input/data/html4css1.css" type="text/css" />
<link rel="stylesheet" href="../input/data/math.css" type="text/css" />
Modified: trunk/docutils/test/functional/expected/math_output_latex.html
===================================================================
--- trunk/docutils/test/functional/expected/math_output_latex.html 2022-07-05 07:50:01 UTC (rev 9102)
+++ trunk/docutils/test/functional/expected/math_output_latex.html 2022-07-05 20:04:21 UTC (rev 9103)
@@ -3,7 +3,7 @@
<html xmlns="http://www.w3.org/1999/xhtml" xml:lang="en" lang="en">
<head>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
-<meta name="generator" content="Docutils 0.19b2.dev: https://docutils.sourceforge.io/" />
+<meta name="generator" content="Docutils 0.19: https://docutils.sourceforge.io/" />
<title>Mathematics</title>
<link rel="stylesheet" href="../input/data/html4css1.css" type="text/css" />
</head>
Modified: trunk/docutils/test/functional/expected/math_output_mathjax.html
===================================================================
--- trunk/docutils/test/functional/expected/math_output_mathjax.html 2022-07-05 07:50:01 UTC (rev 9102)
+++ trunk/docutils/test/functional/expected/math_output_mathjax.html 2022-07-05 20:04:21 UTC (rev 9103)
@@ -3,7 +3,7 @@
<html xmlns="http://www.w3.org/1999/xhtml" xml:lang="en" lang="en">
<head>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
-<meta name="generator" content="Docutils 0.19b2.dev: https://docutils.sourceforge.io/" />
+<meta name="generator" content="Docutils 0.19: https://docutils.sourceforge.io/" />
<title>Mathematics</title>
<script type="text/javascript" src="/usr/share/javascript/mathjax/MathJax.js?config=TeX-AMS_CHTML"></script>
<link rel="stylesheet" href="../input/data/html4css1.css" type="text/css" />
Modified: trunk/docutils/test/functional/expected/math_output_mathml.html
===================================================================
--- trunk/docutils/test/functional/expected/math_output_mathml.html 2022-07-05 07:50:01 UTC (rev 9102)
+++ trunk/docutils/test/functional/expected/math_output_mathml.html 2022-07-05 20:04:21 UTC (rev 9103)
@@ -3,7 +3,7 @@
<head>
<meta charset="utf-8" />
<meta name="viewport" content="width=device-width, initial-scale=1" />
-<meta name="generator" content="Docutils 0.19b2.dev: https://docutils.sourceforge.io/" />
+<meta name="generator" content="Docutils 0.19: https://docutils.sourceforge.io/" />
<title>Mathematics</title>
<link rel="stylesheet" href="../input/data/minimal.css" type="text/css" />
<link rel="stylesheet" href="../input/data/plain.css" type="text/css" />
Modified: trunk/docutils/test/functional/expected/misc_rst_html4css1.html
===================================================================
--- trunk/docutils/test/functional/expected/misc_rst_html4css1.html 2022-07-05 07:50:01 UTC (rev 9102)
+++ trunk/docutils/test/functional/expected/misc_rst_html4css1.html 2022-07-05 20:04:21 UTC (rev 9103)
@@ -3,7 +3,7 @@
<html xmlns="http://www.w3.org/1999/xhtml" xml:lang="en" lang="en">
<head>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
-<meta name="generator" content="Docutils 0.19b2.dev: https://docutils.sourceforge.io/" />
+<meta name="generator" content="Docutils 0.19: https://docutils.sourceforge.io/" />
<title>Additional tests with html4css1</title>
<link rel="stylesheet" href="foo&bar.css" type="text/css" />
<link rel="stylesheet" href="../input/data/html4css1.css" type="text/css" />
Modified: trunk/docutils/test/functional/expected/misc_rst_html5.html
===================================================================
--- trunk/docutils/test/functional/expected/misc_rst_html5.html 2022-07-05 07:50:01 UTC (rev 9102)
+++ trunk/docutils/test/functional/expected/misc_rst_html5.html 2022-07-05 20:04:21 UTC (rev 9103)
@@ -3,7 +3,7 @@
<head>
<meta charset="utf-8" />
<meta name="viewport" content="width=device-width, initial-scale=1" />
-<meta name="generator" content="Docutils 0.19b2.dev: https://docutils.sourceforge.io/" />
+<meta name="generator" content="Docutils 0.19: https://docutils.sourceforge.io/" />
<title>Additional tests with HTML 5</title>
<link rel="stylesheet" href="../input/data/minimal.css" type="text/css" />
<link rel="stylesheet" href="../input/data/responsive.css" type="text/css" />
Modified: trunk/docutils/test/functional/expected/pep_html.html
===================================================================
--- trunk/docutils/test/functional/expected/pep_html.html 2022-07-05 07:50:01 UTC (rev 9102)
+++ trunk/docutils/test/functional/expected/pep_html.html 2022-07-05 20:04:21 UTC (rev 9103)
@@ -8,7 +8,7 @@
-->
<head>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
- <meta name="generator" content="Docutils 0.19b2.dev: https://docutils.sourceforge.io/" />
+ <meta name="generator" content="Docutils 0.19: https://docutils.sourceforge.io/" />
<title>PEP 100 - Test PEP</title>
<link rel="stylesheet" href="../input/data/html4css1.css" type="text/css" />
</head>
Modified: trunk/docutils/test/functional/expected/rst_html5_tuftig.html
===================================================================
--- trunk/docutils/test/functional/expected/rst_html5_tuftig.html 2022-07-05 07:50:01 UTC (rev 9102)
+++ trunk/docutils/test/functional/expected/rst_html5_tuftig.html 2022-07-05 20:04:21 UTC (rev 9103)
@@ -3,7 +3,7 @@
<head>
<meta charset="utf-8" />
<meta name="viewport" content="width=device-width, initial-scale=1" />
-<meta name="generator" content="Docutils 0.19b2.dev: https://docutils.sourceforge.io/" />
+<meta name="generator" content="Docutils 0.19: https://docutils.sourceforge.io/" />
<title>Special Features of the tuftig.css Stylesheet</title>
<link rel="stylesheet" href="../input/data/minimal.css" type="text/css" />
<link rel="stylesheet" href="../input/data/tuftig.css" type="text/css" />
Modified: trunk/docutils/test/functional/expected/standalone_rst_docutils_xml.xml
===================================================================
--- trunk/docutils/test/functional/expected/standalone_rst_docutils_xml.xml 2022-07-05 07:50:01 UTC (rev 9102)
+++ trunk/docutils/test/functional/expected/standalone_rst_docutils_xml.xml 2022-07-05 20:04:21 UTC (rev 9103)
@@ -1,6 +1,6 @@
<?xml version="1.0" encoding="utf-8"?>
<!DOCTYPE document PUBLIC "+//IDN docutils.sourceforge.net//DTD Docutils Generic//EN//XML" "http://docutils.sourceforge.net/docs/ref/docutils.dtd">
-<!-- Generated by Docutils 0.19b2.dev -->
+<!-- Generated by Docutils 0.19 -->
<document ids="restructuredtext-test-document doctitle" names="restructuredtext\ test\ document doctitle" source="functional/input/standalone_rst_docutils_xml.txt" title="reStructuredText Test Document">
<title>reStructuredText Test Document</title>
<subtitle ids="examples-of-syntax-constructs subtitle" names="examples\ of\ syntax\ constructs subtitle">Examples of Syntax Constructs</subtitle>
Modified: trunk/docutils/test/functional/expected/standalone_rst_html4css1.html
===================================================================
--- trunk/docutils/test/functional/expected/standalone_rst_html4css1.html 2022-07-05 07:50:01 UTC (rev 9102)
+++ trunk/docutils/test/functional/expected/standalone_rst_html4css1.html 2022-07-05 20:04:21 UTC (rev 9103)
@@ -3,7 +3,7 @@
<html xmlns="http://www.w3.org/1999/xhtml" xml:lang="en" lang="en">
<head>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
-<meta name="generator" content="Docutils 0.19b2.dev: https://docutils.sourceforge.io/" />
+<meta name="generator" content="Docutils 0.19: https://docutils.sourceforge.io/" />
<title>reStructuredText Test Document</title>
<meta content="reStructuredText, test, parser" name="keywords" />
<meta content="A test document, containing at least one example of each reStructuredText construct." lang="en" name="description" />
Modified: trunk/docutils/test/functional/expected/standalone_rst_html5.html
===================================================================
--- trunk/docutils/test/functional/expected/standalone_rst_html5.html 2022-07-05 07:50:01 UTC (rev 9102)
+++ trunk/docutils/test/functional/expected/standalone_rst_html5.html 2022-07-05 20:04:21 UTC (rev 9103)
@@ -3,7 +3,7 @@
<head>
<meta charset="utf-8" />
<meta name="viewport" content="width=device-width, initial-scale=1" />
-<meta name="generator" content="Docutils 0.19b2.dev: https://docutils.sourceforge.io/" />
+<meta name="generator" content="Docutils 0.19: https://docutils.sourceforge.io/" />
<title>reStructuredText Test Document</title>
<meta content="reStructuredText, test, parser" name="keywords" />
<meta content="A test document, containing at least one example of each reStructuredText construct." lang="en" name="description" xml:lang="en" />
Modified: trunk/docutils/test/functional/expected/standalone_rst_s5_html_1.html
===================================================================
--- trunk/docutils/test/functional/expected/standalone_rst_s5_html_1.html 2022-07-05 07:50:01 UTC (rev 9102)
+++ trunk/docutils/test/functional/expected/standalone_rst_s5_html_1.html 2022-07-05 20:04:21 UTC (rev 9103)
@@ -3,7 +3,7 @@
<html xmlns="http://www.w3.org/1999/xhtml" xml:lang="en" lang="en">
<head>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
-<meta name="generator" content="Docutils 0.19b2.dev: https://docutils.sourceforge.io/" />
+<meta name="generator" content="Docutils 0.19: https://docutils.sourceforge.io/" />
<meta name="version" content="S5 1.1" />
<title>Slide Shows</title>
<meta name="author" content="David Goodger" />
Modified: trunk/docutils/test/functional/expected/standalone_rst_s5_html_2.html
===================================================================
--- trunk/docutils/test/functional/expected/standalone_rst_s5_html_2.html 2022-07-05 07:50:01 UTC (rev 9102)
+++ trunk/docutils/test/functional/expected/standalone_rst_s5_html_2.html 2022-07-05 20:04:21 UTC (rev 9103)
@@ -3,7 +3,7 @@
<html xmlns="http://www.w3.org/1999/xhtml" xml:lang="en" lang="en">
<head>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
-<meta name="generator" content="Docutils 0.19b2.dev: https://docutils.sourceforge.io/" />
+<meta name="generator" content="Docutils 0.19: https://docutils.sourceforge.io/" />
<meta name="version" content="S5 1.1" />
<title>Slide Shows</title>
<meta name="author" content="David Goodger" />
This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site.
|
|
From: <gr...@us...> - 2022-07-05 20:43:11
|
Revision: 9105
http://sourceforge.net/p/docutils/code/9105
Author: grubert
Date: 2022-07-05 20:43:08 +0000 (Tue, 05 Jul 2022)
Log Message:
-----------
version 0.19.1b.dev
Modified Paths:
--------------
trunk/docutils/HISTORY.txt
trunk/docutils/README.txt
trunk/docutils/docutils/__init__.py
trunk/docutils/setup.py
trunk/docutils/test/functional/expected/compact_lists.html
trunk/docutils/test/functional/expected/dangerous.html
trunk/docutils/test/functional/expected/embed_images_html5.html
trunk/docutils/test/functional/expected/field_name_limit.html
trunk/docutils/test/functional/expected/footnotes_html5.html
trunk/docutils/test/functional/expected/math_output_html.html
trunk/docutils/test/functional/expected/math_output_latex.html
trunk/docutils/test/functional/expected/math_output_mathjax.html
trunk/docutils/test/functional/expected/math_output_mathml.html
trunk/docutils/test/functional/expected/misc_rst_html4css1.html
trunk/docutils/test/functional/expected/misc_rst_html5.html
trunk/docutils/test/functional/expected/pep_html.html
trunk/docutils/test/functional/expected/rst_html5_tuftig.html
trunk/docutils/test/functional/expected/standalone_rst_docutils_xml.xml
trunk/docutils/test/functional/expected/standalone_rst_html4css1.html
trunk/docutils/test/functional/expected/standalone_rst_html5.html
trunk/docutils/test/functional/expected/standalone_rst_s5_html_1.html
trunk/docutils/test/functional/expected/standalone_rst_s5_html_2.html
Modified: trunk/docutils/HISTORY.txt
===================================================================
--- trunk/docutils/HISTORY.txt 2022-07-05 20:06:00 UTC (rev 9104)
+++ trunk/docutils/HISTORY.txt 2022-07-05 20:43:08 UTC (rev 9105)
@@ -11,7 +11,11 @@
.. contents::
+Changes Since 0.19
+==================
+.
+
Release 0.19 (2022-07-05)
=========================
Modified: trunk/docutils/README.txt
===================================================================
--- trunk/docutils/README.txt 2022-07-05 20:06:00 UTC (rev 9104)
+++ trunk/docutils/README.txt 2022-07-05 20:43:08 UTC (rev 9105)
@@ -1,6 +1,6 @@
-=======================
- README: Docutils 0.19
-=======================
+==============================
+ README: Docutils 0.19.1b.dev
+==============================
:Author: David Goodger
:Contact: go...@py...
@@ -71,7 +71,7 @@
To run the code, Python_ must be installed.
(Python is pre-installed with most Linux distributions.)
-* Docutils 0.19 requires Python 3.7 or later.
+* Docutils 0.19.1b.dev requires Python 3.7 or later.
* Docutils 0.16 to 0.18 require Python 2.7 or 3.5+.
* Docutils 0.14 dropped Python 2.4, 2.5, 3.1 and 3.2 support.
Modified: trunk/docutils/docutils/__init__.py
===================================================================
--- trunk/docutils/docutils/__init__.py 2022-07-05 20:06:00 UTC (rev 9104)
+++ trunk/docutils/docutils/__init__.py 2022-07-05 20:43:08 UTC (rev 9105)
@@ -54,7 +54,7 @@
__docformat__ = 'reStructuredText'
-__version__ = '0.19'
+__version__ = '0.19.1b.dev'
"""Docutils version identifier (complies with PEP 440)::
major.minor[.micro][releaselevel[serial]][.dev]
@@ -117,10 +117,10 @@
__version_info__ = VersionInfo(
major=0,
minor=19,
- micro=0,
- releaselevel='final', # one of 'alpha', 'beta', 'candidate', 'final'
+ micro=1,
+ releaselevel='beta', # one of 'alpha', 'beta', 'candidate', 'final'
serial=0, # pre-release number (0 for final releases and snapshots)
- release=True # True for official releases and pre-releases
+ release=False # True for official releases and pre-releases
)
"""Comprehensive version information tuple.
Modified: trunk/docutils/setup.py
===================================================================
--- trunk/docutils/setup.py 2022-07-05 20:06:00 UTC (rev 9104)
+++ trunk/docutils/setup.py 2022-07-05 20:43:08 UTC (rev 9105)
@@ -33,7 +33,7 @@
input Docutils supports reStructuredText, an easy-to-read,
what-you-see-is-what-you-get plaintext markup syntax.""", # wrap at col 60
'url': 'https://docutils.sourceforge.io/',
- 'version': '0.19',
+ 'version': '0.19.1b.dev',
'author': 'David Goodger',
'author_email': 'go...@py...',
'maintainer': 'docutils-develop list',
Modified: trunk/docutils/test/functional/expected/compact_lists.html
===================================================================
--- trunk/docutils/test/functional/expected/compact_lists.html 2022-07-05 20:06:00 UTC (rev 9104)
+++ trunk/docutils/test/functional/expected/compact_lists.html 2022-07-05 20:43:08 UTC (rev 9105)
@@ -3,7 +3,7 @@
<html xmlns="http://www.w3.org/1999/xhtml" xml:lang="en" lang="en">
<head>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
-<meta name="generator" content="Docutils 0.19: https://docutils.sourceforge.io/" />
+<meta name="generator" content="Docutils 0.19.1b.dev: https://docutils.sourceforge.io/" />
<title>compact_lists.txt</title>
<link rel="stylesheet" href="../input/data/html4css1.css" type="text/css" />
</head>
Modified: trunk/docutils/test/functional/expected/dangerous.html
===================================================================
--- trunk/docutils/test/functional/expected/dangerous.html 2022-07-05 20:06:00 UTC (rev 9104)
+++ trunk/docutils/test/functional/expected/dangerous.html 2022-07-05 20:43:08 UTC (rev 9105)
@@ -3,7 +3,7 @@
<html xmlns="http://www.w3.org/1999/xhtml" xml:lang="en" lang="en">
<head>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
-<meta name="generator" content="Docutils 0.19: https://docutils.sourceforge.io/" />
+<meta name="generator" content="Docutils 0.19.1b.dev: https://docutils.sourceforge.io/" />
<title>dangerous.txt</title>
<link rel="stylesheet" href="../input/data/html4css1.css" type="text/css" />
</head>
Modified: trunk/docutils/test/functional/expected/embed_images_html5.html
===================================================================
--- trunk/docutils/test/functional/expected/embed_images_html5.html 2022-07-05 20:06:00 UTC (rev 9104)
+++ trunk/docutils/test/functional/expected/embed_images_html5.html 2022-07-05 20:43:08 UTC (rev 9105)
@@ -3,7 +3,7 @@
<head>
<meta charset="utf-8"/>
<meta name="viewport" content="width=device-width, initial-scale=1" />
-<meta name="generator" content="Docutils 0.19: https://docutils.sourceforge.io/" />
+<meta name="generator" content="Docutils 0.19.1b.dev: https://docutils.sourceforge.io/" />
<title>Embedded Images</title>
<link rel="stylesheet" href="../input/data/minimal.css" type="text/css" />
<link rel="stylesheet" href="../input/data/plain.css" type="text/css" />
Modified: trunk/docutils/test/functional/expected/field_name_limit.html
===================================================================
--- trunk/docutils/test/functional/expected/field_name_limit.html 2022-07-05 20:06:00 UTC (rev 9104)
+++ trunk/docutils/test/functional/expected/field_name_limit.html 2022-07-05 20:43:08 UTC (rev 9105)
@@ -3,7 +3,7 @@
<html xmlns="http://www.w3.org/1999/xhtml" xml:lang="en" lang="en">
<head>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
-<meta name="generator" content="Docutils 0.19: https://docutils.sourceforge.io/" />
+<meta name="generator" content="Docutils 0.19.1b.dev: https://docutils.sourceforge.io/" />
<title>field_list.txt</title>
<link rel="stylesheet" href="../input/data/html4css1.css" type="text/css" />
</head>
Modified: trunk/docutils/test/functional/expected/footnotes_html5.html
===================================================================
--- trunk/docutils/test/functional/expected/footnotes_html5.html 2022-07-05 20:06:00 UTC (rev 9104)
+++ trunk/docutils/test/functional/expected/footnotes_html5.html 2022-07-05 20:43:08 UTC (rev 9105)
@@ -3,7 +3,7 @@
<head>
<meta charset="utf-8" />
<meta name="viewport" content="width=device-width, initial-scale=1" />
-<meta name="generator" content="Docutils 0.19: https://docutils.sourceforge.io/" />
+<meta name="generator" content="Docutils 0.19.1b.dev: https://docutils.sourceforge.io/" />
<title>Test footnote and citation rendering</title>
<link rel="stylesheet" href="../input/data/minimal.css" type="text/css" />
<link rel="stylesheet" href="../input/data/responsive.css" type="text/css" />
Modified: trunk/docutils/test/functional/expected/math_output_html.html
===================================================================
--- trunk/docutils/test/functional/expected/math_output_html.html 2022-07-05 20:06:00 UTC (rev 9104)
+++ trunk/docutils/test/functional/expected/math_output_html.html 2022-07-05 20:43:08 UTC (rev 9105)
@@ -3,7 +3,7 @@
<html xmlns="http://www.w3.org/1999/xhtml" xml:lang="en" lang="en">
<head>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
-<meta name="generator" content="Docutils 0.19: https://docutils.sourceforge.io/" />
+<meta name="generator" content="Docutils 0.19.1b.dev: https://docutils.sourceforge.io/" />
<title>Mathematics</title>
<link rel="stylesheet" href="../input/data/html4css1.css" type="text/css" />
<link rel="stylesheet" href="../input/data/math.css" type="text/css" />
Modified: trunk/docutils/test/functional/expected/math_output_latex.html
===================================================================
--- trunk/docutils/test/functional/expected/math_output_latex.html 2022-07-05 20:06:00 UTC (rev 9104)
+++ trunk/docutils/test/functional/expected/math_output_latex.html 2022-07-05 20:43:08 UTC (rev 9105)
@@ -3,7 +3,7 @@
<html xmlns="http://www.w3.org/1999/xhtml" xml:lang="en" lang="en">
<head>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
-<meta name="generator" content="Docutils 0.19: https://docutils.sourceforge.io/" />
+<meta name="generator" content="Docutils 0.19.1b.dev: https://docutils.sourceforge.io/" />
<title>Mathematics</title>
<link rel="stylesheet" href="../input/data/html4css1.css" type="text/css" />
</head>
Modified: trunk/docutils/test/functional/expected/math_output_mathjax.html
===================================================================
--- trunk/docutils/test/functional/expected/math_output_mathjax.html 2022-07-05 20:06:00 UTC (rev 9104)
+++ trunk/docutils/test/functional/expected/math_output_mathjax.html 2022-07-05 20:43:08 UTC (rev 9105)
@@ -3,7 +3,7 @@
<html xmlns="http://www.w3.org/1999/xhtml" xml:lang="en" lang="en">
<head>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
-<meta name="generator" content="Docutils 0.19: https://docutils.sourceforge.io/" />
+<meta name="generator" content="Docutils 0.19.1b.dev: https://docutils.sourceforge.io/" />
<title>Mathematics</title>
<script type="text/javascript" src="/usr/share/javascript/mathjax/MathJax.js?config=TeX-AMS_CHTML"></script>
<link rel="stylesheet" href="../input/data/html4css1.css" type="text/css" />
Modified: trunk/docutils/test/functional/expected/math_output_mathml.html
===================================================================
--- trunk/docutils/test/functional/expected/math_output_mathml.html 2022-07-05 20:06:00 UTC (rev 9104)
+++ trunk/docutils/test/functional/expected/math_output_mathml.html 2022-07-05 20:43:08 UTC (rev 9105)
@@ -3,7 +3,7 @@
<head>
<meta charset="utf-8" />
<meta name="viewport" content="width=device-width, initial-scale=1" />
-<meta name="generator" content="Docutils 0.19: https://docutils.sourceforge.io/" />
+<meta name="generator" content="Docutils 0.19.1b.dev: https://docutils.sourceforge.io/" />
<title>Mathematics</title>
<link rel="stylesheet" href="../input/data/minimal.css" type="text/css" />
<link rel="stylesheet" href="../input/data/plain.css" type="text/css" />
Modified: trunk/docutils/test/functional/expected/misc_rst_html4css1.html
===================================================================
--- trunk/docutils/test/functional/expected/misc_rst_html4css1.html 2022-07-05 20:06:00 UTC (rev 9104)
+++ trunk/docutils/test/functional/expected/misc_rst_html4css1.html 2022-07-05 20:43:08 UTC (rev 9105)
@@ -3,7 +3,7 @@
<html xmlns="http://www.w3.org/1999/xhtml" xml:lang="en" lang="en">
<head>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
-<meta name="generator" content="Docutils 0.19: https://docutils.sourceforge.io/" />
+<meta name="generator" content="Docutils 0.19.1b.dev: https://docutils.sourceforge.io/" />
<title>Additional tests with html4css1</title>
<link rel="stylesheet" href="foo&bar.css" type="text/css" />
<link rel="stylesheet" href="../input/data/html4css1.css" type="text/css" />
Modified: trunk/docutils/test/functional/expected/misc_rst_html5.html
===================================================================
--- trunk/docutils/test/functional/expected/misc_rst_html5.html 2022-07-05 20:06:00 UTC (rev 9104)
+++ trunk/docutils/test/functional/expected/misc_rst_html5.html 2022-07-05 20:43:08 UTC (rev 9105)
@@ -3,7 +3,7 @@
<head>
<meta charset="utf-8" />
<meta name="viewport" content="width=device-width, initial-scale=1" />
-<meta name="generator" content="Docutils 0.19: https://docutils.sourceforge.io/" />
+<meta name="generator" content="Docutils 0.19.1b.dev: https://docutils.sourceforge.io/" />
<title>Additional tests with HTML 5</title>
<link rel="stylesheet" href="../input/data/minimal.css" type="text/css" />
<link rel="stylesheet" href="../input/data/responsive.css" type="text/css" />
Modified: trunk/docutils/test/functional/expected/pep_html.html
===================================================================
--- trunk/docutils/test/functional/expected/pep_html.html 2022-07-05 20:06:00 UTC (rev 9104)
+++ trunk/docutils/test/functional/expected/pep_html.html 2022-07-05 20:43:08 UTC (rev 9105)
@@ -8,7 +8,7 @@
-->
<head>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
- <meta name="generator" content="Docutils 0.19: https://docutils.sourceforge.io/" />
+ <meta name="generator" content="Docutils 0.19.1b.dev: https://docutils.sourceforge.io/" />
<title>PEP 100 - Test PEP</title>
<link rel="stylesheet" href="../input/data/html4css1.css" type="text/css" />
</head>
Modified: trunk/docutils/test/functional/expected/rst_html5_tuftig.html
===================================================================
--- trunk/docutils/test/functional/expected/rst_html5_tuftig.html 2022-07-05 20:06:00 UTC (rev 9104)
+++ trunk/docutils/test/functional/expected/rst_html5_tuftig.html 2022-07-05 20:43:08 UTC (rev 9105)
@@ -3,7 +3,7 @@
<head>
<meta charset="utf-8" />
<meta name="viewport" content="width=device-width, initial-scale=1" />
-<meta name="generator" content="Docutils 0.19: https://docutils.sourceforge.io/" />
+<meta name="generator" content="Docutils 0.19.1b.dev: https://docutils.sourceforge.io/" />
<title>Special Features of the tuftig.css Stylesheet</title>
<link rel="stylesheet" href="../input/data/minimal.css" type="text/css" />
<link rel="stylesheet" href="../input/data/tuftig.css" type="text/css" />
Modified: trunk/docutils/test/functional/expected/standalone_rst_docutils_xml.xml
===================================================================
--- trunk/docutils/test/functional/expected/standalone_rst_docutils_xml.xml 2022-07-05 20:06:00 UTC (rev 9104)
+++ trunk/docutils/test/functional/expected/standalone_rst_docutils_xml.xml 2022-07-05 20:43:08 UTC (rev 9105)
@@ -1,6 +1,6 @@
<?xml version="1.0" encoding="utf-8"?>
<!DOCTYPE document PUBLIC "+//IDN docutils.sourceforge.net//DTD Docutils Generic//EN//XML" "http://docutils.sourceforge.net/docs/ref/docutils.dtd">
-<!-- Generated by Docutils 0.19 -->
+<!-- Generated by Docutils 0.19.1b.dev -->
<document ids="restructuredtext-test-document doctitle" names="restructuredtext\ test\ document doctitle" source="functional/input/standalone_rst_docutils_xml.txt" title="reStructuredText Test Document">
<title>reStructuredText Test Document</title>
<subtitle ids="examples-of-syntax-constructs subtitle" names="examples\ of\ syntax\ constructs subtitle">Examples of Syntax Constructs</subtitle>
Modified: trunk/docutils/test/functional/expected/standalone_rst_html4css1.html
===================================================================
--- trunk/docutils/test/functional/expected/standalone_rst_html4css1.html 2022-07-05 20:06:00 UTC (rev 9104)
+++ trunk/docutils/test/functional/expected/standalone_rst_html4css1.html 2022-07-05 20:43:08 UTC (rev 9105)
@@ -3,7 +3,7 @@
<html xmlns="http://www.w3.org/1999/xhtml" xml:lang="en" lang="en">
<head>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
-<meta name="generator" content="Docutils 0.19: https://docutils.sourceforge.io/" />
+<meta name="generator" content="Docutils 0.19.1b.dev: https://docutils.sourceforge.io/" />
<title>reStructuredText Test Document</title>
<meta content="reStructuredText, test, parser" name="keywords" />
<meta content="A test document, containing at least one example of each reStructuredText construct." lang="en" name="description" />
Modified: trunk/docutils/test/functional/expected/standalone_rst_html5.html
===================================================================
--- trunk/docutils/test/functional/expected/standalone_rst_html5.html 2022-07-05 20:06:00 UTC (rev 9104)
+++ trunk/docutils/test/functional/expected/standalone_rst_html5.html 2022-07-05 20:43:08 UTC (rev 9105)
@@ -3,7 +3,7 @@
<head>
<meta charset="utf-8" />
<meta name="viewport" content="width=device-width, initial-scale=1" />
-<meta name="generator" content="Docutils 0.19: https://docutils.sourceforge.io/" />
+<meta name="generator" content="Docutils 0.19.1b.dev: https://docutils.sourceforge.io/" />
<title>reStructuredText Test Document</title>
<meta content="reStructuredText, test, parser" name="keywords" />
<meta content="A test document, containing at least one example of each reStructuredText construct." lang="en" name="description" xml:lang="en" />
Modified: trunk/docutils/test/functional/expected/standalone_rst_s5_html_1.html
===================================================================
--- trunk/docutils/test/functional/expected/standalone_rst_s5_html_1.html 2022-07-05 20:06:00 UTC (rev 9104)
+++ trunk/docutils/test/functional/expected/standalone_rst_s5_html_1.html 2022-07-05 20:43:08 UTC (rev 9105)
@@ -3,7 +3,7 @@
<html xmlns="http://www.w3.org/1999/xhtml" xml:lang="en" lang="en">
<head>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
-<meta name="generator" content="Docutils 0.19: https://docutils.sourceforge.io/" />
+<meta name="generator" content="Docutils 0.19.1b.dev: https://docutils.sourceforge.io/" />
<meta name="version" content="S5 1.1" />
<title>Slide Shows</title>
<meta name="author" content="David Goodger" />
Modified: trunk/docutils/test/functional/expected/standalone_rst_s5_html_2.html
===================================================================
--- trunk/docutils/test/functional/expected/standalone_rst_s5_html_2.html 2022-07-05 20:06:00 UTC (rev 9104)
+++ trunk/docutils/test/functional/expected/standalone_rst_s5_html_2.html 2022-07-05 20:43:08 UTC (rev 9105)
@@ -3,7 +3,7 @@
<html xmlns="http://www.w3.org/1999/xhtml" xml:lang="en" lang="en">
<head>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
-<meta name="generator" content="Docutils 0.19: https://docutils.sourceforge.io/" />
+<meta name="generator" content="Docutils 0.19.1b.dev: https://docutils.sourceforge.io/" />
<meta name="version" content="S5 1.1" />
<title>Slide Shows</title>
<meta name="author" content="David Goodger" />
This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site.
|
|
From: <mi...@us...> - 2022-07-08 21:30:56
|
Revision: 9109
http://sourceforge.net/p/docutils/code/9109
Author: milde
Date: 2022-07-08 21:30:53 +0000 (Fri, 08 Jul 2022)
Log Message:
-----------
Detail planned input-encoding changes.
Modified Paths:
--------------
trunk/docutils/RELEASE-NOTES.txt
trunk/docutils/docutils/io.py
trunk/docutils/test/test_io.py
Modified: trunk/docutils/RELEASE-NOTES.txt
===================================================================
--- trunk/docutils/RELEASE-NOTES.txt 2022-07-06 14:00:22 UTC (rev 9108)
+++ trunk/docutils/RELEASE-NOTES.txt 2022-07-08 21:30:53 UTC (rev 9109)
@@ -59,6 +59,8 @@
default and locale encoding, fail.
- Only remove BOM (U+FEFF ZWNBSP at start of data), no other ZWNBSPs.
+ Only remove BOM with `input_encoding` values None, '', 'utf-8-sig',
+ 'utf-16', and 'utf-32'.
* `html5` writer:
Modified: trunk/docutils/docutils/io.py
===================================================================
--- trunk/docutils/docutils/io.py 2022-07-06 14:00:22 UTC (rev 9108)
+++ trunk/docutils/docutils/io.py 2022-07-08 21:30:53 UTC (rev 9109)
@@ -122,6 +122,17 @@
locale.setlocale(locale.LC_ALL, '')
Raise UnicodeError if unsuccessful.
+
+ Provisional:
+ - Raise UnicodeError (instead of falling back to the locale
+ encoding) if decoding the source with the default encoding (UTF-8)
+ fails and Python is started in `UTF-8 mode`.
+
+ Raise UnicodeError (instead of falling back to "latin1") if both,
+ default and locale encoding, fail.
+
+ - Only remove BOM (U+FEFF ZWNBSP at start of data),
+ no other ZWNBSPs.
"""
if self.encoding and self.encoding.lower() == 'unicode':
assert isinstance(data, str), ('input encoding is "unicode" '
@@ -156,7 +167,8 @@
decoded = str(data, enc, self.error_handler)
self.successful_encoding = enc
# Return decoded, removing BOM and other ZWNBSPs.
- # TODO: only remove BOM (ZWNBSP at start of data, API change).
+ # TODO: only remove BOM (ZWNBSP at start of data)
+ # and only if 'self.encoding' is None. (API change)
return decoded.replace('\ufeff', '')
except (UnicodeError, LookupError) as err:
# keep exception instance for use outside of the "for" loop.
Modified: trunk/docutils/test/test_io.py
===================================================================
--- trunk/docutils/test/test_io.py 2022-07-06 14:00:22 UTC (rev 9108)
+++ trunk/docutils/test/test_io.py 2022-07-08 21:30:53 UTC (rev 9109)
@@ -81,14 +81,13 @@
def test_bom(self):
# Provisional:
- # TODO only remove BOM at start of data
- input = io.StringInput(source=b'\xef\xbb\xbf foo \xef\xbb\xbf bar',
- encoding='utf-8')
- # Assert BOMs are gone.
+ input = io.StringInput(source=b'\xef\xbb\xbf foo \xef\xbb\xbf bar')
+ # Assert BOM is gone.
+ # TODO: only remove BOM (ZWNBSP at start of data)
self.assertEqual(input.read(), ' foo bar')
- # With unicode input:
+ # Unicode input is left unchanged:
input = io.StringInput(source='\ufeff foo \ufeff bar')
- # Assert BOMs are still there.
+ # Assert ZWNBSPs are still there.
self.assertEqual(input.read(), '\ufeff foo \ufeff bar')
def test_coding_slug(self):
This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site.
|
|
From: <mi...@us...> - 2022-07-19 16:00:52
|
Revision: 9111
http://sourceforge.net/p/docutils/code/9111
Author: milde
Date: 2022-07-19 16:00:50 +0000 (Tue, 19 Jul 2022)
Log Message:
-----------
Add Ukrainian support
Modified Paths:
--------------
trunk/docutils/HISTORY.txt
Added Paths:
-----------
trunk/docutils/languages/
trunk/docutils/languages/uk.py
trunk/docutils/parsers/
trunk/docutils/parsers/rst/
trunk/docutils/parsers/rst/languages/
trunk/docutils/parsers/rst/languages/uk.py
Modified: trunk/docutils/HISTORY.txt
===================================================================
--- trunk/docutils/HISTORY.txt 2022-07-10 07:50:39 UTC (rev 9110)
+++ trunk/docutils/HISTORY.txt 2022-07-19 16:00:50 UTC (rev 9111)
@@ -14,8 +14,12 @@
Changes Since 0.19
==================
-.
+* docutils/languages/
+ docutils/parsers/rst/languages/
+ - Support Ukrainian. Patch by Dmytro Kazanzhy.
+
+
Release 0.19 (2022-07-05)
=========================
Added: trunk/docutils/languages/uk.py
===================================================================
--- trunk/docutils/languages/uk.py (rev 0)
+++ trunk/docutils/languages/uk.py 2022-07-19 16:00:50 UTC (rev 9111)
@@ -0,0 +1,59 @@
+# -*- coding: utf-8 -*-
+# $Id$
+# Author: Dmytro Kazanzhy <dka...@gm...>
+# Copyright: This module has been placed in the public domain.
+
+# New language mappings are welcome. Before doing a new translation, please
+# read <http://docutils.sf.net/docs/howto/i18n.html>. Two files must be
+# translated for each language: one in docutils/languages, the other in
+# docutils/parsers/rst/languages.
+
+"""
+Ukrainian-language mappings for language-dependent features of Docutils.
+"""
+
+__docformat__ = 'reStructuredText'
+
+labels = {
+ u'abstract': u'Анотація',
+ u'address': u'Адреса',
+ u'attention': u'Увага!',
+ u'author': u'Автор',
+ u'authors': u'Автори',
+ u'caution': u'Обережно!',
+ u'contact': u'Контакт',
+ u'contents': u'Зміст',
+ u'copyright': u'Права копіювання',
+ u'danger': u'НЕБЕЗПЕЧНО!',
+ u'date': u'Дата',
+ u'dedication': u'Посвячення',
+ u'error': u'Помилка',
+ u'hint': u'Порада',
+ u'important': u'Важливо',
+ u'note': u'Примітка',
+ u'organization': u'Організація',
+ u'revision': u'Редакція',
+ u'status': u'Статус',
+ u'tip': u'Підказка',
+ u'version': u'Версія',
+ u'warning': u'Попередження'}
+"""Mapping of node class name to label text."""
+
+bibliographic_fields = {
+ u'анотація': u'abstract',
+ u'адреса': u'address',
+ u'автор': u'author',
+ u'автори': u'authors',
+ u'контакт': u'contact',
+ u'права копіювання': u'copyright',
+ u'дата': u'date',
+ u'посвячення': u'dedication',
+ u'організація': u'organization',
+ u'редакція': u'revision',
+ u'статус': u'status',
+ u'версія': u'version'}
+"""Ukrainian (lowcased) to canonical name mapping for bibliographic fields."""
+
+author_separators = [';', ',']
+"""List of separator strings for the 'Authors' bibliographic field. Tried in
+order."""
Property changes on: trunk/docutils/languages/uk.py
___________________________________________________________________
Added: svn:eol-style
## -0,0 +1 ##
+native
\ No newline at end of property
Added: svn:keywords
## -0,0 +1 ##
+Author Date Id Revision
\ No newline at end of property
Added: trunk/docutils/parsers/rst/languages/uk.py
===================================================================
--- trunk/docutils/parsers/rst/languages/uk.py (rev 0)
+++ trunk/docutils/parsers/rst/languages/uk.py 2022-07-19 16:00:50 UTC (rev 9111)
@@ -0,0 +1,89 @@
+# -*- coding: utf-8 -*-
+# $Id$
+# Author: Dmytro Kazanzhy <dka...@gm...>
+# Copyright: This module has been placed in the public domain.
+
+# New language mappings are welcome. Before doing a new translation, please
+# read <http://docutils.sf.net/docs/howto/i18n.html>. Two files must be
+# translated for each language: one in docutils/languages, the other in
+# docutils/parsers/rst/languages.
+
+"""
+Ukrainian-language mappings for language-dependent features of
+reStructuredText.
+"""
+
+__docformat__ = 'reStructuredText'
+
+directives = {
+ u'блок-строк': u'line-block',
+ u'мета': u'meta',
+ u'математика': 'math',
+ u'оброблений-літерал': u'parsed-literal',
+ u'виділена-цитата': u'pull-quote',
+ u'код': 'code',
+ u'складений абзац': 'compound',
+ u'контейнер': 'container',
+ u'таблиця': 'table',
+ u'таблиця-csv': 'csv-table',
+ u'таблиця-списків': 'list-table',
+ u'сирий': u'raw',
+ u'заміна': u'replace',
+ u'тестова-директива-restructuredtext': u'restructuredtext-test-directive',
+ u'цільові-виноски': u'target-notes',
+ u'юнікод': u'unicode',
+ u'дата': u'date',
+ u'бічна-панель': u'sidebar',
+ u'важливо': u'important',
+ u'включати': u'include',
+ u'увага': u'attention',
+ u'виділення': u'highlights',
+ u'зауваження': u'admonition',
+ u'зображення': u'image',
+ u'клас': u'class',
+ u'роль': 'role',
+ u'роль-за-замовчуванням': 'default-role',
+ u'заголовок': 'title',
+ u'номер-розділу': u'sectnum',
+ u'нумерація-розділів': u'sectnum',
+ u'небезпечно': u'danger',
+ u'обережно': u'caution',
+ u'помилка': u'error',
+ u'підказка': u'tip',
+ u'попередження': u'warning',
+ u'примітка': u'note',
+ u'малюнок': u'figure',
+ u'рубрика': u'rubric',
+ u'порада': u'hint',
+ u'зміст': u'contents',
+ u'тема': u'topic',
+ u'епіграф': u'epigraph',
+ u'верхній колонтитул': 'header',
+ u'нижній колонтитул': 'footer',}
+"""Ukrainian name to registered (in directives/__init__.py) directive name
+mapping."""
+
+roles = {
+ u'акронім': 'acronym',
+ u'код': 'code',
+ u'анонімне-посилання': 'anonymous-reference',
+ u'буквально': 'literal',
+ u'математика': 'math',
+ u'верхній-індекс': 'superscript',
+ u'наголос': 'emphasis',
+ u'іменоване-посилання': 'named-reference',
+ u'індекс': 'index',
+ u'нижній-індекс': 'subscript',
+ u'жирне-накреслення': 'strong',
+ u'скорочення': 'abbreviation',
+ u'посилання-заміна': 'substitution-reference',
+ u'посилання-на-pep': 'pep-reference',
+ u'посилання-на-rfc': 'rfc-reference',
+ u'посилання-на-uri': 'uri-reference',
+ u'посилання-на-заголовок': 'title-reference',
+ u'посилання-на-зноску': 'footnote-reference',
+ u'посилання-на-цитату': 'citation-reference',
+ u'ціль': 'target',
+ u'сирий': 'raw',}
+"""Mapping of Ukrainian role names to canonical role names for interpreted text.
+"""
Property changes on: trunk/docutils/parsers/rst/languages/uk.py
___________________________________________________________________
Added: svn:eol-style
## -0,0 +1 ##
+native
\ No newline at end of property
Added: svn:keywords
## -0,0 +1 ##
+Author Date Id Revision
\ No newline at end of property
This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site.
|
|
From: <mi...@us...> - 2022-07-28 10:45:40
|
Revision: 9112
http://sourceforge.net/p/docutils/code/9112
Author: milde
Date: 2022-07-28 10:45:38 +0000 (Thu, 28 Jul 2022)
Log Message:
-----------
Update directives documentation
* Clarify the admonitions documentation (fixes bug #453).
* Provide hyperlink targets (anchors) for all directive names.
(Use anonymous targets for like-named "doctree" elements.)
Modified Paths:
--------------
trunk/docutils/docs/ref/doctree.txt
trunk/docutils/docs/ref/rst/directives.txt
trunk/docutils/docutils/parsers/rst/languages/de.py
Modified: trunk/docutils/docs/ref/doctree.txt
===================================================================
--- trunk/docutils/docs/ref/doctree.txt 2022-07-19 16:00:50 UTC (rev 9111)
+++ trunk/docutils/docs/ref/doctree.txt 2022-07-28 10:45:38 UTC (rev 9112)
@@ -424,6 +424,9 @@
:Analogues:
``admonition`` has no direct analogues in common DTDs. It can be
emulated with primitives and type effects.
+
+ The specific admonitions caution_, note_, tip_, and warning_
+ are analogous to the respective DocBook elements.
:Processing:
Rendered distinctly (inset and/or in a box, etc.).
@@ -4505,7 +4508,8 @@
The ``warning`` element is an admonition, a distinctive and
self-contained notice. Also see the other admonition elements
Docutils offers (in alphabetical order): attention_, caution_,
-danger_, error_, hint_, important_, note_, tip_.
+danger_, error_, hint_, important_, note_, tip_,
+and the generic admonition_.
Details
Modified: trunk/docutils/docs/ref/rst/directives.txt
===================================================================
--- trunk/docutils/docs/ref/rst/directives.txt 2022-07-19 16:00:50 UTC (rev 9111)
+++ trunk/docutils/docs/ref/rst/directives.txt 2022-07-28 10:45:38 UTC (rev 9112)
@@ -51,16 +51,14 @@
Admonitions
-------------
-.. From Webster's Revised Unabridged Dictionary (1913) [web1913]:
- Admonition
- Gentle or friendly reproof; counseling against a fault or
- error; expression of authoritative advice; friendly caution
- or warning.
+Admonitions ("safety messages" or "hazard statements") can appear anywhere
+an ordinary body element can. They contain arbitrary body elements.
+Typically, an admonition is rendered as an offset block in a document,
+sometimes outlined or shaded,
- Syn: {Admonition}, {Reprehension}, {Reproof}.
+Docutils defines a `generic admonition`_ as well as a set of
+`specific admonitions`_.
- Usage: Admonition is prospective, and relates to moral delinquencies;
- its object is to prevent further transgression.
.. _attention:
.. _caution:
@@ -76,18 +74,23 @@
====================
:Directive Types: "attention", "caution", "danger", "error", "hint",
- "important", "note", "tip", "warning", "admonition"
-:Doctree Elements: attention, caution, danger, error, hint, important,
- note, tip, warning, admonition_, title_
+ "important", "note", "tip", "warning"
+:Doctree Elements: `attention <../doctree.html#attention>`__,
+ `caution <../doctree.html#caution>`__ ,
+ `danger <../doctree.html#danger>`__,
+ `error <../doctree.html#error>`__,
+ `hint <../doctree.html#hint>`__,
+ `important <../doctree.html#important>`__,
+ `note <../doctree.html#note>`__,
+ `tip <../doctree.html#tip>`__,
+ `warning <../doctree.html#warning>`__
+
:Directive Arguments: None.
:Directive Options: class_, name_
:Directive Content: Interpreted as body elements.
-Admonitions are specially marked "topics" that can appear anywhere an
-ordinary body element can. They contain arbitrary body elements.
-Typically, an admonition is rendered as an offset block in a document,
-sometimes outlined or shaded, with a title matching the admonition
-type. For example::
+Specific admontions are rendered with a title matching the admonition type.
+For example::
.. DANGER::
Beware killer rabbits!
@@ -100,18 +103,6 @@
| Beware killer rabbits! |
+------------------------+
-The following admonition directives have been implemented:
-
-- attention
-- caution
-- danger
-- error
-- hint
-- important
-- note
-- tip
-- warning
-
Any text immediately following the directive indicator (on the same
line and/or indented on following lines) is interpreted as a directive
block and is parsed for normal body elements. For example, the
@@ -126,11 +117,14 @@
- It includes this bullet list.
+.. _admonition:
+
Generic Admonition
==================
:Directive Type: "admonition"
-:Doctree Elements: admonition_, title_
+:Doctree Elements: `admonition <../doctree.html#admonition>`__,
+ `title <../doctree.html#title>`__
:Directive Arguments: One, required (admonition title)
:Directive Options: class_, name_
:Directive Content: Interpreted as body elements.
@@ -139,9 +133,8 @@
author desires.
The author-supplied title is also used as a `"classes"`_ attribute value
-after being converted into a valid identifier form (down-cased;
-non-alphanumeric characters converted to single hyphens; "admonition-"
-prefixed). For example, this admonition::
+after `identifier normalization`_ and adding the prefix "admonition-".
+For example, this admonition::
.. admonition:: And, by the way...
@@ -156,8 +149,7 @@
<paragraph>
You can make up your own admonition too.
-The class_ option overrides the computed `"classes"`_ attribute
-value.
+The class_ option overrides the generated `"classes"`_ attribute value.
--------
@@ -164,7 +156,7 @@
Images
--------
-There are two image directives: "image" and "figure".
+There are two image directives: image_ and figure_.
.. attention::
@@ -212,7 +204,7 @@
=====
:Directive Type: "image"
-:Doctree Element: image_
+:Doctree Element: `image <../doctree.html#image>`__
:Directive Arguments: One, required (image URI).
:Directive Options: Possible (see below).
:Directive Content: None.
@@ -482,7 +474,6 @@
Love, Ewan.
-
.. _parsed-literal:
Parsed Literal Block
@@ -517,6 +508,7 @@
(docinfo_, transition_?)?,
`%structure.model;`_ )
+
Code
====
@@ -690,11 +682,13 @@
See Epigraph_ above for an analogous example.
+.. compound:
+
Compound Paragraph
==================
:Directive Type: "compound"
-:Doctree Element: compound_
+:Doctree Element: `compound <../doctree.html#compound>`__
:Directive Arguments: None.
:Directive Options: class_, name_
:Directive Content: Interpreted as body elements.
@@ -767,7 +761,6 @@
application-specific purposes.
-
--------
Tables
--------
@@ -783,7 +776,7 @@
=====
:Directive Type: "table"
-:Doctree Element: table_
+:Doctree Element: `table <../doctree.html#table>`__
:Directive Arguments: One, optional (table title).
:Directive Options: Possible (see below).
:Directive Content: A normal `reStructuredText table`_.
@@ -835,6 +828,7 @@
.. _reStructuredText table: restructuredtext.html#tables
.. _table_style: ../../user/config.html#table-style
+
.. _csv-table:
CSV Table
@@ -1241,19 +1235,18 @@
@@@
+.. ---------------
+ HTML-Specific
+ ---------------
----------------
- HTML-Specific
----------------
+ Imagemap
+ ========
-Imagemap
-========
+ **NOT IMPLEMENTED YET**
-**NOT IMPLEMENTED YET**
+ Non-standard element: imagemap.
-Non-standard element: imagemap.
-
-----------------------------------------
Directives for Substitution Definitions
-----------------------------------------
@@ -1266,6 +1259,7 @@
.. _substitution definitions:
.. _substitution definition: restructuredtext.html#substitution-definitions
+
.. _replace:
Replacement Text
@@ -1507,13 +1501,14 @@
text markers will be searched in the specified lines (further limiting the
included content).
-.. _raw-directive:
+.. _raw:
+
Raw Data Pass-Through
=====================
:Directive Type: "raw"
-:Doctree Element: raw_
+:Doctree Element: `raw <../doctree.html#raw>`__
:Directive Arguments: One or more, required (output format types).
:Directive Options: Possible (see below).
:Directive Content: Stored verbatim, uninterpreted. None (empty) if a
@@ -1591,7 +1586,6 @@
.. _"raw" role: roles.html#raw
-.. _classes:
Class
=====
@@ -1742,6 +1736,7 @@
.. _HTML 4.01 spec: https://www.w3.org/TR/html401/
.. _CSS1 spec: https://www.w3.org/TR/REC-CSS1
+
.. _role:
Custom Interpreted Text Roles
@@ -1879,11 +1874,13 @@
parser is "title-reference".
+.. _meta:
+
Metadata
========
:Directive Type: "meta"
-:Doctree Element: meta_
+:Doctree Element: `meta <../doctree.html#meta>`__
:Directive Arguments: None.
:Directive Options: None.
:Directive Content: Must contain a flat field list.
@@ -1955,6 +1952,8 @@
.. _bibliographic fields: restructuredtext.html#bibliographic-fields
+.. _title:
+
Metadata Document Title
=======================
@@ -1973,6 +1972,7 @@
.. _document title: restructuredtext.html#document-title
.. _"title" configuration setting: ../../user/config.html#title
+
Restructuredtext-Test-Directive
===============================
@@ -1988,6 +1988,7 @@
followed by a literal block containing the rest of the directive
block.
+
--------------
Common Options
--------------
@@ -2031,10 +2032,9 @@
.. _identifier keys: ../doctree.html#ids-type
.. _"ids": ../doctree.html#ids
.. _"names": ../doctree.html#names
-.. _admonition: ../doctree.html#admonition
.. _block_quote: ../doctree.html#block-quote
.. _caption: ../doctree.html#caption
-.. _compound: ../doctree.html#compound
+.. _classes: ../doctree.html#classes
.. _container element: ../doctree.html#container
.. _decoration: ../doctree.html#decoration
.. _figure: ../doctree.html#figure
@@ -2041,7 +2041,6 @@
.. _footnote: ../doctree.html#footnote
.. _footnote_reference: ../doctree.html#footnote-reference
.. _generated: ../doctree.html#generated
-.. _image: ../doctree.html#image
.. _inline elements: ../doctree.html#inline-elements
.. _interpreted text role: roles.html
.. _literal_block: ../doctree.html#literal-block
@@ -2049,14 +2048,10 @@
.. _length: restructuredtext.html#length-units
.. _line_block: ../doctree.html#line-block
.. _math_block: ../doctree.html#math-block
-.. _meta: ../doctree.html#meta
.. _pending: ../doctree.html#pending
.. _percentage: restructuredtext.html#percentage-units
-.. _raw: ../doctree.html#raw
.. _rubric: ../doctree.html#rubric
.. _sidebar: ../doctree.html#sidebar
-.. _table: ../doctree.html#table
-.. _title: ../doctree.html#title
.. _title attribute: ../doctree.html#title-attribute
.. _topic: ../doctree.html#topic
Modified: trunk/docutils/docutils/parsers/rst/languages/de.py
===================================================================
--- trunk/docutils/docutils/parsers/rst/languages/de.py 2022-07-19 16:00:50 UTC (rev 9111)
+++ trunk/docutils/docutils/parsers/rst/languages/de.py 2022-07-28 10:45:38 UTC (rev 9112)
@@ -27,7 +27,7 @@
'notiz': 'note',
'tipp': 'tip',
'warnung': 'warning',
- 'ermahnung': 'admonition',
+ 'ermahnung': 'admonition', # sic! Not used in this sense in rST.
'kasten': 'sidebar',
'seitenkasten': 'sidebar', # kept for backwards compatibiltity
'seitenleiste': 'sidebar',
This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site.
|
|
From: <mi...@us...> - 2022-07-28 17:06:12
|
Revision: 9114
http://sourceforge.net/p/docutils/code/9114
Author: milde
Date: 2022-07-28 17:06:10 +0000 (Thu, 28 Jul 2022)
Log Message:
-----------
Fix Ukrainean language support.
Move uk.py language files to the right directory.
Coding slug and "u" string prefix no longer required.
Fix flake8 warnings.
Added Paths:
-----------
trunk/docutils/docutils/languages/uk.py
trunk/docutils/docutils/parsers/rst/languages/uk.py
Removed Paths:
-------------
trunk/docutils/languages/
trunk/docutils/parsers/
Added: trunk/docutils/docutils/languages/uk.py
===================================================================
--- trunk/docutils/docutils/languages/uk.py (rev 0)
+++ trunk/docutils/docutils/languages/uk.py 2022-07-28 17:06:10 UTC (rev 9114)
@@ -0,0 +1,58 @@
+# $Id$
+# Author: Dmytro Kazanzhy <dka...@gm...>
+# Copyright: This module has been placed in the public domain.
+
+# New language mappings are welcome. Before doing a new translation, please
+# read <http://docutils.sf.net/docs/howto/i18n.html>. Two files must be
+# translated for each language: one in docutils/languages, the other in
+# docutils/parsers/rst/languages.
+
+"""
+Ukrainian-language mappings for language-dependent features of Docutils.
+"""
+
+__docformat__ = 'reStructuredText'
+
+labels = {
+ 'abstract': 'Анотація',
+ 'address': 'Адреса',
+ 'attention': 'Увага!',
+ 'author': 'Автор',
+ 'authors': 'Автори',
+ 'caution': 'Обережно!',
+ 'contact': 'Контакт',
+ 'contents': 'Зміст',
+ 'copyright': 'Права копіювання',
+ 'danger': 'НЕБЕЗПЕЧНО!',
+ 'date': 'Дата',
+ 'dedication': 'Посвячення',
+ 'error': 'Помилка',
+ 'hint': 'Порада',
+ 'important': 'Важливо',
+ 'note': 'Примітка',
+ 'organization': 'Організація',
+ 'revision': 'Редакція',
+ 'status': 'Статус',
+ 'tip': 'Підказка',
+ 'version': 'Версія',
+ 'warning': 'Попередження'}
+"""Mapping of node class name to label text."""
+
+bibliographic_fields = {
+ 'анотація': 'abstract',
+ 'адреса': 'address',
+ 'автор': 'author',
+ 'автори': 'authors',
+ 'контакт': 'contact',
+ 'права копіювання': 'copyright',
+ 'дата': 'date',
+ 'посвячення': 'dedication',
+ 'організація': 'organization',
+ 'редакція': 'revision',
+ 'статус': 'status',
+ 'версія': 'version'}
+"""Ukrainian (lowcased) to canonical name mapping for bibliographic fields."""
+
+author_separators = [';', ',']
+"""List of separator strings for the 'Authors' bibliographic field. Tried in
+order."""
Property changes on: trunk/docutils/docutils/languages/uk.py
___________________________________________________________________
Added: svn:eol-style
## -0,0 +1 ##
+native
\ No newline at end of property
Added: svn:keywords
## -0,0 +1 ##
+Author Date Id Revision
\ No newline at end of property
Added: trunk/docutils/docutils/parsers/rst/languages/uk.py
===================================================================
--- trunk/docutils/docutils/parsers/rst/languages/uk.py (rev 0)
+++ trunk/docutils/docutils/parsers/rst/languages/uk.py 2022-07-28 17:06:10 UTC (rev 9114)
@@ -0,0 +1,91 @@
+# $Id$
+# Author: Dmytro Kazanzhy <dka...@gm...>
+# Copyright: This module has been placed in the public domain.
+
+# New language mappings are welcome. Before doing a new translation, please
+# read <http://docutils.sf.net/docs/howto/i18n.html>. Two files must be
+# translated for each language: one in docutils/languages, the other in
+# docutils/parsers/rst/languages.
+
+"""
+Ukrainian-language mappings for language-dependent features of
+reStructuredText.
+"""
+
+__docformat__ = 'reStructuredText'
+
+directives = {
+ 'блок-строк': 'line-block',
+ 'мета': 'meta',
+ 'математика': 'math',
+ 'оброблений-літерал': 'parsed-literal',
+ 'виділена-цитата': 'pull-quote',
+ 'код': 'code',
+ 'складений абзац': 'compound',
+ 'контейнер': 'container',
+ 'таблиця': 'table',
+ 'таблиця-csv': 'csv-table',
+ 'таблиця-списків': 'list-table',
+ 'сирий': 'raw',
+ 'заміна': 'replace',
+ 'тестова-директива-restructuredtext': 'restructuredtext-test-directive',
+ 'цільові-виноски': 'target-notes',
+ 'юнікод': 'unicode',
+ 'дата': 'date',
+ 'бічна-панель': 'sidebar',
+ 'важливо': 'important',
+ 'включати': 'include',
+ 'увага': 'attention',
+ 'виділення': 'highlights',
+ 'зауваження': 'admonition',
+ 'зображення': 'image',
+ 'клас': 'class',
+ 'роль': 'role',
+ 'роль-за-замовчуванням': 'default-role',
+ 'заголовок': 'title',
+ 'номер-розділу': 'sectnum',
+ 'нумерація-розділів': 'sectnum',
+ 'небезпечно': 'danger',
+ 'обережно': 'caution',
+ 'помилка': 'error',
+ 'підказка': 'tip',
+ 'попередження': 'warning',
+ 'примітка': 'note',
+ 'малюнок': 'figure',
+ 'рубрика': 'rubric',
+ 'порада': 'hint',
+ 'зміст': 'contents',
+ 'тема': 'topic',
+ 'епіграф': 'epigraph',
+ 'верхній колонтитул': 'header',
+ 'нижній колонтитул': 'footer',
+ }
+"""Ukrainian name to registered (in directives/__init__.py) directive name
+mapping."""
+
+roles = {
+ 'акронім': 'acronym',
+ 'код': 'code',
+ 'анонімне-посилання': 'anonymous-reference',
+ 'буквально': 'literal',
+ 'математика': 'math',
+ 'верхній-індекс': 'superscript',
+ 'наголос': 'emphasis',
+ 'іменоване-посилання': 'named-reference',
+ 'індекс': 'index',
+ 'нижній-індекс': 'subscript',
+ 'жирне-накреслення': 'strong',
+ 'скорочення': 'abbreviation',
+ 'посилання-заміна': 'substitution-reference',
+ 'посилання-на-pep': 'pep-reference',
+ 'посилання-на-rfc': 'rfc-reference',
+ 'посилання-на-uri': 'uri-reference',
+ 'посилання-на-заголовок': 'title-reference',
+ 'посилання-на-зноску': 'footnote-reference',
+ 'посилання-на-цитату': 'citation-reference',
+ 'ціль': 'target',
+ 'сирий': 'raw',
+ }
+"""Mapping of Ukrainian role names to canonical role names
+for interpreted text.
+"""
Property changes on: trunk/docutils/docutils/parsers/rst/languages/uk.py
___________________________________________________________________
Added: svn:eol-style
## -0,0 +1 ##
+native
\ No newline at end of property
Added: svn:keywords
## -0,0 +1 ##
+Author Date Id Revision
\ No newline at end of property
This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site.
|
|
From: <mi...@us...> - 2022-07-29 11:57:03
|
Revision: 9118
http://sourceforge.net/p/docutils/code/9118
Author: milde
Date: 2022-07-29 11:56:58 +0000 (Fri, 29 Jul 2022)
Log Message:
-----------
Improve internationalisation documentation
Add links to documentation of translated terms.
Sort mappings to better match documentation
and keep related terms together.
Modified Paths:
--------------
trunk/docutils/docs/howto/i18n.txt
trunk/docutils/docs/ref/rst/roles.txt
trunk/docutils/docutils/parsers/rst/languages/en.py
Modified: trunk/docutils/docs/howto/i18n.txt
===================================================================
--- trunk/docutils/docs/howto/i18n.txt 2022-07-29 11:56:46 UTC (rev 9117)
+++ trunk/docutils/docs/howto/i18n.txt 2022-07-29 11:56:58 UTC (rev 9118)
@@ -88,10 +88,10 @@
``labels``
This is a mapping of node class names to language-dependent
boilerplate label text. The label text is used by Writer
- components when they encounter document tree elements whose class
- names are the mapping keys.
+ components when they encounter `document tree`_ elements whose
+ `class names`_ are the mapping keys.
- The entry values (*not* the keys) should be translated to the
+ The entry **values** (*not* the keys) should be translated to the
target language.
``bibliographic_fields``
@@ -98,12 +98,12 @@
This is a mapping of language-dependent field names (converted to
lower case) to canonical field names (keys of
``DocInfo.biblio_notes`` in ``docutils.transforms.frontmatter``).
- It is used when transforming bibliographic fields.
+ It is used when transforming `bibliographic fields`_.
- The keys should be translated to the target language.
+ The **keys** should be translated to the target language.
``author_separators``
- This is a list of strings used to parse the 'Authors'
+ This is a list of strings used to parse the 'Authors_'
bibliographic field. They separate individual authors' names, and
are tried in order (i.e., earlier items take priority, and the
first item that matches wins). The English-language module
@@ -112,7 +112,16 @@
Most languages won't have to "translate" this list.
+.. _document tree:
+ ../ref/doctree.html
+.. _class names:
+ ../ref/doctree.html#element-reference
+.. _authors:
+ .. ref/doctree.html#authors
+.. _bibliographic fields:
+ ../ref/rst/restructuredtext.html#bibliographic-fields
+
reStructuredText Language Module
================================
@@ -127,8 +136,9 @@
``directives``
This is a mapping from language-dependent directive names to
canonical directive names. The canonical directive names are
- registered in ``docutils/parsers/rst/directives/__init__.py``, in
- ``_directive_registry``.
+ registered in ``docutils/parsers/rst/directives/__init__.py``,
+ in ``_directive_registry`` and documented in
+ `reStructuredText Directives`_.
The keys should be translated to the target language. Synonyms
(multiple keys with the same values) are allowed; this is useful
@@ -136,15 +146,19 @@
``roles``
This is a mapping language-dependent role names to canonical role
- names for interpreted text. The canonical directive names are
+ names for interpreted text. The canonical role names are
registered in ``docutils/parsers/rst/states.py``, in
- ``Inliner._interpreted_roles`` (this may change).
+ ``Inliner._interpreted_roles`` (this may change) and documented
+ in `reStructuredText Interpreted Text Roles`_.
The keys should be translated to the target language. Synonyms
(multiple keys with the same values) are allowed; this is useful
for abbreviations.
+.. _reStructuredText Directives: ../ref/rst/directives.html
+.. _reStructuredText Interpreted Text Roles: ../ref/rst/roles.html
+
Testing the Language Modules
============================
Modified: trunk/docutils/docs/ref/rst/roles.txt
===================================================================
--- trunk/docutils/docs/ref/rst/roles.txt 2022-07-29 11:56:46 UTC (rev 9117)
+++ trunk/docutils/docs/ref/rst/roles.txt 2022-07-29 11:56:58 UTC (rev 9118)
@@ -9,10 +9,10 @@
:Revision: $Revision$
:Date: $Date$
:Copyright: This document has been placed in the public domain.
+:Abstract:
+ This document describes the interpreted text roles implemented in the
+ reference reStructuredText parser.
-This document describes the interpreted text roles implemented in the
-reference reStructuredText parser.
-
Interpreted text uses backquotes (`) around the text. An explicit
role marker may optionally appear before or after the text, delimited
with colons. For example::
@@ -66,51 +66,37 @@
Standard Roles
----------------
-``:emphasis:``
-==============
-:Aliases: None
-:DTD Element: emphasis
+``:abbreviation:``
+==================
+
+:Aliases: ``:ab:``
+:DTD Element: abbreviation_
:Customization:
:Options: class_.
:Content: None.
-Implements emphasis. These are equivalent::
+An abbreviation used in the document.
+An example of an abbreviation is ‘St’ being used instead of ‘Street’.
- *text*
- :emphasis:`text`
+``:acronym:``
+==================
-``:literal:``
-==============
-
-:Aliases: None
-:DTD Element: literal
+:Aliases: ``:ac:``
+:DTD Element: acronym_
:Customization:
:Options: class_.
:Content: None.
-Implements inline literal text. These are equivalent::
+An acronym.
- ``text``
- :literal:`text`
-Care must be taken with backslash-escapes though. These are *not*
-equivalent::
-
- ``text \ and \ backslashes``
- :literal:`text \ and \ backslashes`
-
-The backslashes in the first line are preserved (and do nothing),
-whereas the backslashes in the second line escape the following
-spaces.
-
-
``:code:``
==========
:Aliases: None
-:DTD Element: literal
+:DTD Element: literal_
:Customization:
:Options: class_, language
:Content: None.
@@ -143,11 +129,51 @@
.. _supported languages and markup formats: https://pygments.org/languages/
+``:emphasis:``
+==============
+
+:Aliases: None
+:DTD Element: emphasis_
+:Customization:
+ :Options: class_.
+ :Content: None.
+
+Implements emphasis. These are equivalent::
+
+ *text*
+ :emphasis:`text`
+
+
+``:literal:``
+==============
+
+:Aliases: None
+:DTD Element: literal_
+:Customization:
+ :Options: class_.
+ :Content: None.
+
+Implements inline literal text. These are equivalent::
+
+ ``text``
+ :literal:`text`
+
+Care must be taken with backslash-escapes though. These are *not*
+equivalent::
+
+ ``text \ and \ backslashes``
+ :literal:`text \ and \ backslashes`
+
+The backslashes in the first line are preserved (and do nothing),
+whereas the backslashes in the second line escape the following
+spaces.
+
+
``:math:``
==========
:Aliases: None
-:DTD Element: math
+:DTD Element: math_
:Customization:
:Options: class_
:Content: None.
@@ -172,7 +198,7 @@
===================
:Aliases: ``:PEP:``
-:DTD Element: reference
+:DTD Element: reference_
:Customization:
:Options: class_.
:Content: None.
@@ -194,7 +220,7 @@
===================
:Aliases: ``:RFC:``
-:DTD Element: reference
+:DTD Element: reference_
:Customization:
:Options: class_.
:Content: None.
@@ -227,7 +253,7 @@
============
:Aliases: None
-:DTD Element: strong
+:DTD Element: strong_
:Customization:
:Options: class_.
:Content: None.
@@ -242,7 +268,7 @@
===============
:Aliases: ``:sub:``
-:DTD Element: subscript
+:DTD Element: subscript_
:Customization:
:Options: class_.
:Content: None.
@@ -278,7 +304,7 @@
=================
:Aliases: ``:sup:``
-:DTD Element: superscript
+:DTD Element: superscript_
:Customization:
:Options: class_.
:Content: None.
@@ -290,7 +316,7 @@
=====================
:Aliases: ``:title:``, ``:t:``.
-:DTD Element: title_reference
+:DTD Element: title_reference_
:Customization:
:Options: class_.
:Content: None.
@@ -339,7 +365,7 @@
=======
:Aliases: None
-:DTD Element: raw
+:DTD Element: raw_
:Customization:
:Options: class_, format
:Content: None
@@ -391,3 +417,17 @@
``format`` : text
One or more space-separated output format names (Writer names).
+
+
+.. References
+
+.. _abbreviation: ../doctree.html#abbreviation
+.. _acronym: ../doctree.html#acronym
+.. _emphasis: ../doctree.html#emphasis
+.. _literal: ../doctree.html#literal
+.. _math: ../doctree.html#math
+.. _reference: ../doctree.html#reference
+.. _strong: ../doctree.html#strong
+.. _subscript: ../doctree.html#subscript
+.. _superscript: ../doctree.html#superscript
+.. _title_reference: ../doctree.html#title-reference
Modified: trunk/docutils/docutils/parsers/rst/languages/en.py
===================================================================
--- trunk/docutils/docutils/parsers/rst/languages/en.py 2022-07-29 11:56:46 UTC (rev 9117)
+++ trunk/docutils/docutils/parsers/rst/languages/en.py 2022-07-29 11:56:58 UTC (rev 9118)
@@ -19,9 +19,6 @@
# language-dependent: fixed
'attention': 'attention',
'caution': 'caution',
- 'code': 'code',
- 'code-block': 'code',
- 'sourcecode': 'code',
'danger': 'danger',
'error': 'error',
'hint': 'hint',
@@ -34,6 +31,10 @@
'topic': 'topic',
'line-block': 'line-block',
'parsed-literal': 'parsed-literal',
+ 'code': 'code',
+ 'code-block': 'code',
+ 'sourcecode': 'code',
+ 'math': 'math',
'rubric': 'rubric',
'epigraph': 'epigraph',
'highlights': 'highlights',
@@ -40,14 +41,10 @@
'pull-quote': 'pull-quote',
'compound': 'compound',
'container': 'container',
- # 'questions': 'questions',
'table': 'table',
'csv-table': 'csv-table',
'list-table': 'list-table',
- # 'qa': 'questions',
- # 'faq': 'questions',
'meta': 'meta',
- 'math': 'math',
# 'imagemap': 'imagemap',
'image': 'image',
'figure': 'figure',
@@ -69,9 +66,12 @@
# 'citations': 'citations',
'target-notes': 'target-notes',
'restructuredtext-test-directive': 'restructuredtext-test-directive'}
-"""English name to registered (in directives/__init__.py) directive name
-mapping."""
+"""Mapping of English directive name to registered directive names
+Cf. https://docutils.sourceforge.io/docs/ref/rst/directives.html
+and `_directive_registry` in ``directives/__init__.py``.
+"""
+
roles = {
# language-dependent: fixed
'abbreviation': 'abbreviation',
@@ -79,8 +79,14 @@
'acronym': 'acronym',
'ac': 'acronym',
'code': 'code',
- 'index': 'index',
- 'i': 'index',
+ 'emphasis': 'emphasis',
+ 'literal': 'literal',
+ 'math': 'math',
+ 'pep-reference': 'pep-reference',
+ 'pep': 'pep-reference',
+ 'rfc-reference': 'rfc-reference',
+ 'rfc': 'rfc-reference',
+ 'strong': 'strong',
'subscript': 'subscript',
'sub': 'subscript',
'superscript': 'superscript',
@@ -88,24 +94,21 @@
'title-reference': 'title-reference',
'title': 'title-reference',
't': 'title-reference',
- 'pep-reference': 'pep-reference',
- 'pep': 'pep-reference',
- 'rfc-reference': 'rfc-reference',
- 'rfc': 'rfc-reference',
- 'emphasis': 'emphasis',
- 'strong': 'strong',
- 'literal': 'literal',
- 'math': 'math',
- 'named-reference': 'named-reference',
+ 'raw': 'raw',
+ # the following roles are not implemented in Docutils
+ 'index': 'index',
+ 'i': 'index',
'anonymous-reference': 'anonymous-reference',
+ 'citation-reference': 'citation-reference',
'footnote-reference': 'footnote-reference',
- 'citation-reference': 'citation-reference',
+ 'named-reference': 'named-reference',
'substitution-reference': 'substitution-reference',
- 'target': 'target',
'uri-reference': 'uri-reference',
'uri': 'uri-reference',
'url': 'uri-reference',
- 'raw': 'raw',
+ 'target': 'target',
}
"""Mapping of English role names to canonical role names for interpreted text.
+
+Cf. https://docutils.sourceforge.io/docs/ref/rst/roles.html
"""
This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site.
|
|
From: <mi...@us...> - 2022-10-11 19:03:03
|
Revision: 9126
http://sourceforge.net/p/docutils/code/9126
Author: milde
Date: 2022-10-11 19:03:00 +0000 (Tue, 11 Oct 2022)
Log Message:
-----------
Fix previous_sibling() method.
Move from nodes.Node to nodes.Element
(requires features only present in the sub-class).
Return `None` if called from first child (cf. [patches:#195]).
Tests.
Modified Paths:
--------------
trunk/docutils/docutils/nodes.py
trunk/docutils/test/test_nodes.py
trunk/docutils/test/test_writers/test_html5_polyglot_parts.py
Modified: trunk/docutils/docutils/nodes.py
===================================================================
--- trunk/docutils/docutils/nodes.py 2022-10-07 09:35:20 UTC (rev 9125)
+++ trunk/docutils/docutils/nodes.py 2022-10-11 19:03:00 UTC (rev 9126)
@@ -325,14 +325,7 @@
except StopIteration:
return None
- def previous_sibling(self):
- """Return preceding sibling node or ``None``."""
- try:
- return self.parent[self.parent.index(self)-1]
- except (AttributeError, IndexError):
- return None
-
class reprunicode(str):
"""
Deprecated backwards compatibility stub. Use the standard `str` instead.
@@ -740,6 +733,14 @@
def index(self, item, start=0, stop=sys.maxsize):
return self.children.index(item, start, stop)
+ def previous_sibling(self):
+ """Return preceding sibling node or ``None``."""
+ try:
+ i = self.parent.index(self)
+ except (AttributeError):
+ return None
+ return self.parent[i-1] if i > 0 else None
+
def is_not_default(self, key):
if self[key] == [] and key in self.list_attributes:
return 0
Modified: trunk/docutils/test/test_nodes.py
===================================================================
--- trunk/docutils/test/test_nodes.py 2022-10-07 09:35:20 UTC (rev 9125)
+++ trunk/docutils/test/test_nodes.py 2022-10-11 19:03:00 UTC (rev 9126)
@@ -140,6 +140,16 @@
self.assertEqual(e.index(e[4]), 1)
self.assertEqual(e.index(e[4], start=2), 4)
+ def test_previous_sibling(self):
+ e = nodes.Element()
+ c1 = nodes.Element()
+ c2 = nodes.Element()
+ e += [c1, c2]
+ # print(c1 == c2)
+ self.assertEqual(e.previous_sibling(), None)
+ self.assertEqual(c1.previous_sibling(), None)
+ self.assertEqual(c2.previous_sibling(), c1)
+
def test_clear(self):
element = nodes.Element()
element += nodes.Element()
Modified: trunk/docutils/test/test_writers/test_html5_polyglot_parts.py
===================================================================
--- trunk/docutils/test/test_writers/test_html5_polyglot_parts.py 2022-10-07 09:35:20 UTC (rev 9125)
+++ trunk/docutils/test/test_writers/test_html5_polyglot_parts.py 2022-10-11 19:03:00 UTC (rev 9126)
@@ -52,8 +52,8 @@
totest = {}
-totest['Title promotion'] = ({'stylesheet_path': '',
- 'embed_stylesheet': 0}, [
+totest['standard'] = ({'stylesheet_path': '',
+ 'embed_stylesheet': 0}, [
["""\
Simple String
""",
@@ -125,6 +125,24 @@
</main>\\n''',
'html_head': '''...<title><string></title>\\n'''}
"""],
+[""".. [CIT2022] A citation.""",
+"""\
+{'fragment': '''<div role="list" class="citation-list">
+<div class="citation" id="cit2022" role="doc-biblioentry">
+<span class="label"><span class="fn-bracket">[</span>CIT2022<span class="fn-bracket">]</span></span>
+<p>A citation.</p>
+</div>
+</div>\\n''',
+ 'html_body': '''<main>
+<div role="list" class="citation-list">
+<div class="citation" id="cit2022" role="doc-biblioentry">
+<span class="label"><span class="fn-bracket">[</span>CIT2022<span class="fn-bracket">]</span></span>
+<p>A citation.</p>
+</div>
+</div>
+</main>\\n''',
+ 'html_head': '''...<title><string></title>\\n'''}
+"""],
["""\
+++++
Title
This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site.
|
|
From: <aa-...@us...> - 2022-10-20 17:15:42
|
Revision: 9127
http://sourceforge.net/p/docutils/code/9127
Author: aa-turner
Date: 2022-10-20 17:15:40 +0000 (Thu, 20 Oct 2022)
Log Message:
-----------
Resolve flake8 ``E275`` error
E275: missing whitespace after keyword
Modified Paths:
--------------
trunk/docutils/docutils/parsers/rst/__init__.py
trunk/docutils/docutils/transforms/universal.py
trunk/docutils/docutils/writers/_html_base.py
trunk/docutils/docutils/writers/html5_polyglot/__init__.py
trunk/docutils/docutils/writers/latex2e/__init__.py
trunk/docutils/docutils/writers/xetex/__init__.py
trunk/docutils/test/test_CLI.py
trunk/docutils/test/test_parsers/test_rst/test_directives/test_code.py
trunk/docutils/test/test_parsers/test_rst/test_directives/test_include.py
trunk/docutils/test/test_parsers/test_rst/test_interpreted.py
trunk/docutils/test/test_viewlist.py
Modified: trunk/docutils/docutils/parsers/rst/__init__.py
===================================================================
--- trunk/docutils/docutils/parsers/rst/__init__.py 2022-10-11 19:03:00 UTC (rev 9126)
+++ trunk/docutils/docutils/parsers/rst/__init__.py 2022-10-20 17:15:40 UTC (rev 9127)
@@ -384,7 +384,7 @@
if 'name' in self.options:
name = nodes.fully_normalize_name(self.options.pop('name'))
if 'name' in node:
- del(node['name'])
+ del node['name']
node['names'].append(name)
self.state.document.note_explicit_target(node, node)
Modified: trunk/docutils/docutils/transforms/universal.py
===================================================================
--- trunk/docutils/docutils/transforms/universal.py 2022-10-11 19:03:00 UTC (rev 9126)
+++ trunk/docutils/docutils/transforms/universal.py 2022-10-20 17:15:40 UTC (rev 9127)
@@ -153,7 +153,7 @@
if node['level'] < self.document.reporter.report_level:
node.parent.remove(node)
try: # also remove id-entry
- del(self.document.ids[node['ids'][0]])
+ del self.document.ids[node['ids'][0]]
except (IndexError):
pass
for node in tuple(self.document.findall(nodes.problematic)):
Modified: trunk/docutils/docutils/writers/_html_base.py
===================================================================
--- trunk/docutils/docutils/writers/_html_base.py 2022-10-11 19:03:00 UTC (rev 9126)
+++ trunk/docutils/docutils/writers/_html_base.py 2022-10-20 17:15:40 UTC (rev 9127)
@@ -544,7 +544,7 @@
self.body.append(self.context.pop() + '</p>\n')
def visit_author(self, node):
- if not(isinstance(node.parent, nodes.authors)):
+ if not isinstance(node.parent, nodes.authors):
self.visit_docinfo_item(node, 'author')
self.body.append('<p>')
@@ -1257,11 +1257,11 @@
elif converter == 'blahtexml':
math_code = tex2mathml_extern.blahtexml(
math_code,
- inline=not(math_env),
+ inline=(not math_env),
reporter=self.document.reporter)
elif not converter:
math_code = latex2mathml.tex2mathml(
- math_code, inline=not(math_env))
+ math_code, inline=(not math_env))
else:
self.document.reporter.error('option "%s" not supported '
'with math-output "MathML"')
Modified: trunk/docutils/docutils/writers/html5_polyglot/__init__.py
===================================================================
--- trunk/docutils/docutils/writers/html5_polyglot/__init__.py 2022-10-11 19:03:00 UTC (rev 9126)
+++ trunk/docutils/docutils/writers/html5_polyglot/__init__.py 2022-10-20 17:15:40 UTC (rev 9127)
@@ -319,7 +319,7 @@
and isinstance(node.parent, nodes.literal_block)
and 'code' in node.parent.get('classes')):
if self.body[-1] == '<code>':
- del(self.body[-1])
+ del self.body[-1]
else:
self.body.append('</code>')
node.html5tagname = 'small'
@@ -424,7 +424,7 @@
atts = {'classes': ['topic']}
if 'contents' in node['classes']:
node.html_tagname = 'nav'
- del(atts['classes'])
+ del atts['classes']
if isinstance(node.parent, nodes.document):
atts['role'] = 'doc-toc'
self.body_prefix[0] = '</head>\n<body class="with-toc">\n'
Modified: trunk/docutils/docutils/writers/latex2e/__init__.py
===================================================================
--- trunk/docutils/docutils/writers/latex2e/__init__.py 2022-10-11 19:03:00 UTC (rev 9126)
+++ trunk/docutils/docutils/writers/latex2e/__init__.py 2022-10-20 17:15:40 UTC (rev 9127)
@@ -1488,7 +1488,7 @@
table.update(CharMaps.special)
# keep the underscore in citation references
if self.inside_citation_reference_label and not self.alltt:
- del(table[ord('_')])
+ del table[ord('_')]
# Workarounds for OT1 font-encoding
if self.font_encoding in ['OT1', ''] and not self.is_xetex:
# * out-of-order characters in cmtt
@@ -3168,7 +3168,7 @@
'chapter': 'mini',
'section': 'sect'}
if 'chapter' in self.d_class.sections:
- del(minitoc_names['section'])
+ del minitoc_names['section']
try:
mtc_name = minitoc_names[section_name]
except KeyError:
Modified: trunk/docutils/docutils/writers/xetex/__init__.py
===================================================================
--- trunk/docutils/docutils/writers/xetex/__init__.py 2022-10-11 19:03:00 UTC (rev 9126)
+++ trunk/docutils/docutils/writers/xetex/__init__.py 2022-10-20 17:15:40 UTC (rev 9127)
@@ -108,7 +108,7 @@
'grc-ibycus', # 'ibycus', (Greek Ibycus encoding)
'sr-Latn', # 'serbian script=latin'
):
- del(language_codes[key.lower()])
+ del language_codes[key.lower()]
def __init__(self, language_code, reporter):
self.language_code = language_code
Modified: trunk/docutils/test/test_CLI.py
===================================================================
--- trunk/docutils/test/test_CLI.py 2022-10-11 19:03:00 UTC (rev 9126)
+++ trunk/docutils/test/test_CLI.py 2022-10-20 17:15:40 UTC (rev 9127)
@@ -10,7 +10,7 @@
#
# .. _2-Clause BSD license: https://opensource.org/licenses/BSD-2-Clause
-# :Id: $Id: $
+# :Id: $Id$
"""
Test module for the command line interface.
@@ -46,7 +46,7 @@
sys.stdout = StringIO() # re-direct sys.stdout
def tearDown(self):
- del(os.environ['DOCUTILSCONFIG'])
+ del os.environ['DOCUTILSCONFIG']
sys.stdout = self.orig_stdout
sys.argv = self.orig_argv
locale.setlocale(locale.LC_ALL, 'C') # restore default (C) locale
Modified: trunk/docutils/test/test_parsers/test_rst/test_directives/test_code.py
===================================================================
--- trunk/docutils/test/test_parsers/test_rst/test_directives/test_code.py 2022-10-11 19:03:00 UTC (rev 9126)
+++ trunk/docutils/test/test_parsers/test_rst/test_directives/test_code.py 2022-10-20 17:15:40 UTC (rev 9127)
@@ -17,7 +17,7 @@
def suite():
s = DocutilsTestSupport.ParserTestSuite()
if not with_pygments:
- del(totest['code-parsing'])
+ del totest['code-parsing']
s.generateTests(totest)
return s
Modified: trunk/docutils/test/test_parsers/test_rst/test_directives/test_include.py
===================================================================
--- trunk/docutils/test/test_parsers/test_rst/test_directives/test_include.py 2022-10-11 19:03:00 UTC (rev 9126)
+++ trunk/docutils/test/test_parsers/test_rst/test_directives/test_include.py 2022-10-20 17:15:40 UTC (rev 9127)
@@ -26,9 +26,9 @@
s = DocutilsTestSupport.ParserTestSuite()
# eventually skip optional parts:
if not with_pygments:
- del(totest['include-code'])
+ del totest['include-code']
if not md_parser_class:
- del(totest['include-markdown'])
+ del totest['include-markdown']
s.generateTests(totest)
return s
Modified: trunk/docutils/test/test_parsers/test_rst/test_interpreted.py
===================================================================
--- trunk/docutils/test/test_parsers/test_rst/test_interpreted.py 2022-10-11 19:03:00 UTC (rev 9126)
+++ trunk/docutils/test/test_parsers/test_rst/test_interpreted.py 2022-10-20 17:15:40 UTC (rev 9127)
@@ -17,7 +17,7 @@
def suite():
s = DocutilsTestSupport.ParserTestSuite()
if not with_pygments:
- del(totest['code-parsing'])
+ del totest['code-parsing']
s.generateTests(totest)
return s
Modified: trunk/docutils/test/test_viewlist.py
===================================================================
--- trunk/docutils/test/test_viewlist.py 2022-10-11 19:03:00 UTC (rev 9126)
+++ trunk/docutils/test/test_viewlist.py 2022-10-20 17:15:40 UTC (rev 9127)
@@ -54,7 +54,7 @@
self.assertEqual(repr(self.a), "ViewList(%s, items=%s)" %
(repr(self.a_list), repr(self.a.items)))
# `del` also deletes meta-data:
- del(self.c[1])
+ del self.c[1]
self.assertEqual(list(self.c.xitems()),
[('c', 0, 'X'), ('c', 2, 'Z')])
# operators with extended behaviour
This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site.
|
|
From: <aa-...@us...> - 2022-10-21 01:31:17
|
Revision: 9142
http://sourceforge.net/p/docutils/code/9142
Author: aa-turner
Date: 2022-10-21 01:31:15 +0000 (Fri, 21 Oct 2022)
Log Message:
-----------
Removed ``test/coverage.sh``, recommend coverage.py
Modified Paths:
--------------
trunk/docutils/HISTORY.txt
Removed Paths:
-------------
trunk/docutils/test/coverage.sh
Modified: trunk/docutils/HISTORY.txt
===================================================================
--- trunk/docutils/HISTORY.txt 2022-10-21 00:59:41 UTC (rev 9141)
+++ trunk/docutils/HISTORY.txt 2022-10-21 01:31:15 UTC (rev 9142)
@@ -19,7 +19,11 @@
- Support Ukrainian. Patch by Dmytro Kazanzhy.
+* Removed test/coverage.sh, use the coverage.py_ project instead,
+ ``coverage run test/alltests.py`` and ``coverage report``.
+.. _coverage.py: https://pypi.org/project/coverage/
+
Release 0.19 (2022-07-05)
=========================
Deleted: trunk/docutils/test/coverage.sh
===================================================================
--- trunk/docutils/test/coverage.sh 2022-10-21 00:59:41 UTC (rev 9141)
+++ trunk/docutils/test/coverage.sh 2022-10-21 01:31:15 UTC (rev 9142)
@@ -1,49 +0,0 @@
-#!/bin/bash
-
-# $Id$
-# Author: Lea Wiemann <LeW...@gm...>
-# Copyright: This script has been placed in the public domain.
-
-# Usage: ./coverage.sh [project, [module]]
-
-set -e
-# Resolve all symlinks in current path.
-cd -P .
-proj="${PWD##*/}"
-if test "$proj" == test; then
- cd ..
- proj="${PWD##*/}"
-fi
-if test "$1"; then
- proj="$1"
-fi
-module="${2:-alltests.py}"
-module="${module#test/}"
-echo "Performing code coverage test for project \"$proj\", test module \"$module\"..."
-echo
-echo "Please be patient; coverage tracking slows test execution down by more"
-echo "than factor 10."
-echo
-cd test
-rm -rf cover
-mkdir -p cover
-python -u -m trace --count --coverdir=cover --missing "$module"
-cd ..
-echo
-echo
-echo Uncovered lines
-echo ===============
-echo
-(
- find "$proj/" -name \*.py | while read i; do
- i="${i%.py}"
- test -f test/cover/"${i//\//.}".cover -o "${i##*/}" == Template || echo "${i//\//.}" "`cat "$i.py" | wc -l`"
- done
- cd test/cover
- find . \( -name . -o ! -name "$proj".\* -exec rm {} \; \)
- for i in *.cover; do
- sed 's/^>>>>>> \(.*"""\)/ \1/' < "$i" > "${i%.cover}"
- rm "$i"
- done
- for i in *; do echo -n "$i "; grep -c '^>>>>>> ' "$i" || true; done
-) | grep -v ' 0$' | sort -nk 2
This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site.
|
|
From: <aa-...@us...> - 2022-10-21 14:18:08
|
Revision: 9167
http://sourceforge.net/p/docutils/code/9167
Author: aa-turner
Date: 2022-10-21 14:18:05 +0000 (Fri, 21 Oct 2022)
Log Message:
-----------
Simplify ``CustomTestCase.compare_output``
Ensure that the ``core.publish_string`` always returns a string,
introduce ``core.publish_bytes`` for binary output.
Modified Paths:
--------------
trunk/docutils/docutils/core.py
trunk/docutils/docutils/io.py
trunk/docutils/test/DocutilsTestSupport.py
trunk/docutils/test/test_parsers/test_recommonmark/test_misc.py
trunk/docutils/test/test_parsers/test_rst/test_directives/test_code_parsing.py
trunk/docutils/test/test_publisher.py
trunk/docutils/test/test_writers/test_docutils_xml.py
trunk/docutils/test/test_writers/test_html4css1_misc.py
trunk/docutils/test/test_writers/test_html5_polyglot_misc.py
trunk/docutils/test/test_writers/test_odt.py
Modified: trunk/docutils/docutils/core.py
===================================================================
--- trunk/docutils/docutils/core.py 2022-10-21 13:50:56 UTC (rev 9166)
+++ trunk/docutils/docutils/core.py 2022-10-21 14:18:05 UTC (rev 9167)
@@ -429,23 +429,50 @@
enable_exit_status=False):
"""
Set up & run a `Publisher` for programmatic use with string I/O. Return
- the encoded string or Unicode string output.
+ Unicode string output.
- For encoded string output, be sure to set the 'output_encoding' setting to
- the desired encoding. Set it to 'unicode' for unencoded Unicode string
- output. Here's one way::
+ Parameters: see `publish_programmatically`.
+ """
+ output, pub = publish_programmatically(
+ source_class=io.StringInput, source=source, source_path=source_path,
+ destination_class=io.StringOutput,
+ destination=None, destination_path=destination_path,
+ reader=reader, reader_name=reader_name,
+ parser=parser, parser_name=parser_name,
+ writer=writer, writer_name=writer_name,
+ settings=settings, settings_spec=settings_spec,
+ settings_overrides=settings_overrides,
+ config_section=config_section,
+ enable_exit_status=enable_exit_status)
+ return output
- publish_string(..., settings_overrides={'output_encoding': 'unicode'})
- Similarly for Unicode string input (`source`)::
+def publish_bytes(source, source_path=None, destination_path=None,
+ reader=None, reader_name='standalone',
+ parser=None, parser_name='restructuredtext',
+ writer=None, writer_name='pseudoxml',
+ settings=None, settings_spec=None,
+ settings_overrides=None, config_section=None,
+ enable_exit_status=False):
+ """
+ Set up & run a `Publisher` for programmatic use with string I/O. Return
+ the encoded bytes.
- publish_string(..., settings_overrides={'input_encoding': 'unicode'})
+ Be sure to set the 'output_encoding' setting to the desired encoding.::
+ publish_bytes(..., settings_overrides={'output_encoding': 'latin1'})
+
+ Similarly for bytes input (`source`)::
+
+ publish_bytes(..., settings_overrides={'input_encoding': 'latin1'})
+
Parameters: see `publish_programmatically`.
+
+ Provisional.
"""
output, pub = publish_programmatically(
source_class=io.StringInput, source=source, source_path=source_path,
- destination_class=io.StringOutput,
+ destination_class=io.BytesOutput,
destination=None, destination_path=destination_path,
reader=reader, reader_name=reader_name,
parser=parser, parser_name=parser_name,
Modified: trunk/docutils/docutils/io.py
===================================================================
--- trunk/docutils/docutils/io.py 2022-10-21 13:50:56 UTC (rev 9166)
+++ trunk/docutils/docutils/io.py 2022-10-21 14:18:05 UTC (rev 9167)
@@ -555,6 +555,25 @@
mode = 'wb'
+class BytesOutput(Output):
+
+ """
+ Direct string output.
+ """
+
+ default_destination_path = '<bytes>'
+
+ def write(self, data):
+ """Encode `data`, store it in `self.destination`, and return it."""
+ self.destination = self.encode(data)
+ return self.destination
+
+ def encode(self, data):
+ if isinstance(data, bytes):
+ return data
+ return str(data).encode(self.encoding, self.error_handler)
+
+
class StringInput(Input):
"""
@@ -581,7 +600,12 @@
self.destination = self.encode(data)
return self.destination
+ def encode(self, data):
+ if isinstance(data, bytes):
+ return data.decode(self.encoding, self.error_handler)
+ return str(data)
+
class NullInput(Input):
"""
Modified: trunk/docutils/test/DocutilsTestSupport.py
===================================================================
--- trunk/docutils/test/DocutilsTestSupport.py 2022-10-21 13:50:56 UTC (rev 9166)
+++ trunk/docutils/test/DocutilsTestSupport.py 2022-10-21 14:18:05 UTC (rev 9167)
@@ -149,16 +149,13 @@
# empties that dictionary.
roles._roles = {}
- def compare_output(self, _input, output, expected):
- """`output` and `expected` should be strings."""
- if isinstance(expected, bytes):
- expected = expected.decode('utf-8')
- if isinstance(output, bytes):
- output = output.decode('utf-8')
+ def compare_output(self, _input, output: str, expected: str) -> None:
+ """`output` and `expected` are strings."""
# Normalise line endings:
- expected = expected and '\n'.join(expected.splitlines())
- output = output and '\n'.join(output.splitlines())
- self.assertEqual(output, expected)
+ self.assertEqual(
+ '\n'.join(str(output).splitlines()),
+ '\n'.join(str(expected).splitlines())
+ )
class CustomTestSuite(unittest.TestSuite):
Modified: trunk/docutils/test/test_parsers/test_recommonmark/test_misc.py
===================================================================
--- trunk/docutils/test/test_parsers/test_recommonmark/test_misc.py 2022-10-21 13:50:56 UTC (rev 9166)
+++ trunk/docutils/test/test_parsers/test_recommonmark/test_misc.py 2022-10-21 14:18:05 UTC (rev 9167)
@@ -53,9 +53,9 @@
output = publish_string(sample_with_html, parser=parser,
settings_overrides={'warning_stream': '',
'raw_enabled': False})
- self.assertNotIn(b'<raw>', output)
- self.assertIn(b'<system_message', output)
- self.assertIn(b'Raw content disabled.', output)
+ self.assertNotIn('<raw>', output)
+ self.assertIn('<system_message', output)
+ self.assertIn('Raw content disabled.', output)
def test_raw_disabled_inline(self):
output = publish_string('foo <a href="uri">', parser=parser,
@@ -62,9 +62,9 @@
settings_overrides={'warning_stream': '',
'raw_enabled': False,
})
- self.assertNotIn(b'<raw>', output)
- self.assertIn(b'<system_message', output)
- self.assertIn(b'Raw content disabled.', output)
+ self.assertNotIn('<raw>', output)
+ self.assertIn('<system_message', output)
+ self.assertIn('Raw content disabled.', output)
@unittest.skipIf(parser, 'Optional "recommonmark" module found.')
Modified: trunk/docutils/test/test_parsers/test_rst/test_directives/test_code_parsing.py
===================================================================
--- trunk/docutils/test/test_parsers/test_rst/test_directives/test_code_parsing.py 2022-10-21 13:50:56 UTC (rev 9166)
+++ trunk/docutils/test/test_parsers/test_rst/test_directives/test_code_parsing.py 2022-10-21 14:18:05 UTC (rev 9167)
@@ -46,16 +46,16 @@
def test_lexer_error(self):
output = publish_string(unknown_language, settings_overrides=settings)
- self.assertIn(b'<system_message level="2"', output)
- self.assertIn(b'Cannot analyze code. '
- b'No Pygments lexer found for "s-lang".', output)
- self.assertIn(b'<literal_block xml:space="preserve">', output)
+ self.assertIn('<system_message level="2"', output)
+ self.assertIn('Cannot analyze code. '
+ 'No Pygments lexer found for "s-lang".', output)
+ self.assertIn('<literal_block xml:space="preserve">', output)
def test_lexer_error_workaround(self):
output = publish_string(workaround, settings_overrides=settings)
- self.assertNotIn(b'<system_message', output)
- self.assertIn(b'<literal_block classes="code s-lang"', output)
- self.assertIn(b'autoload("abc_mode", "abc");', output)
+ self.assertNotIn('<system_message', output)
+ self.assertIn('<literal_block classes="code s-lang"', output)
+ self.assertIn('autoload("abc_mode", "abc");', output)
if __name__ == '__main__':
Modified: trunk/docutils/test/test_publisher.py
===================================================================
--- trunk/docutils/test/test_publisher.py 2022-10-21 13:50:56 UTC (rev 9166)
+++ trunk/docutils/test/test_publisher.py 2022-10-21 14:18:05 UTC (rev 9167)
@@ -21,7 +21,7 @@
This is a test document with a broken reference: nonexistent_
"""
-pseudoxml_output = b"""\
+pseudoxml_output = """\
<document ids="test-document" names="test\\ document" source="<string>" title="Test Document">
<title>
Test Document
@@ -36,7 +36,7 @@
<paragraph>
Unknown target name: "nonexistent".
"""
-exposed_pseudoxml_output = b"""\
+exposed_pseudoxml_output = """\
<document ids="test-document" internal:refnames="{'nonexistent': [<reference: <#text: 'nonexistent'>>]}" names="test\\ document" source="<string>" title="Test Document">
<title>
Test Document
Modified: trunk/docutils/test/test_writers/test_docutils_xml.py
===================================================================
--- trunk/docutils/test/test_writers/test_docutils_xml.py 2022-10-21 13:50:56 UTC (rev 9166)
+++ trunk/docutils/test/test_writers/test_docutils_xml.py 2022-10-21 14:18:05 UTC (rev 9167)
@@ -124,7 +124,8 @@
return docutils.core.publish_string(source=source.encode('utf-8'),
reader_name='standalone',
writer_name='docutils_xml',
- settings_overrides=settings)
+ settings_overrides=settings
+ ).encode('latin1', 'xmlcharrefreplace')
# XML Test Case
Modified: trunk/docutils/test/test_writers/test_html4css1_misc.py
===================================================================
--- trunk/docutils/test/test_writers/test_html4css1_misc.py 2022-10-21 13:50:56 UTC (rev 9166)
+++ trunk/docutils/test/test_writers/test_html4css1_misc.py 2022-10-21 14:18:05 UTC (rev 9167)
@@ -24,7 +24,7 @@
'stylesheet': '',
'_disable_config': True,
}
- result = core.publish_string(
+ result = core.publish_bytes(
'EUR = \u20ac', writer_name='html4css1',
settings_overrides=settings_overrides)
# Encoding a euro sign with latin1 doesn't work, so the
@@ -53,7 +53,7 @@
"""
result = core.publish_string(data, writer_name='html4css1',
settings_overrides=self.mys)
- self.assertIn(b'<dt class="for the second item">second term:</dt>',
+ self.assertIn('<dt class="for the second item">second term:</dt>',
result)
def test_definition_list_item_name(self):
@@ -70,7 +70,7 @@
"""
result = core.publish_string(data, writer_name='html4css1',
settings_overrides=self.mys)
- self.assertIn(b'<dt id="second-item">second term:</dt>',
+ self.assertIn('<dt id="second-item">second term:</dt>',
result)
Modified: trunk/docutils/test/test_writers/test_html5_polyglot_misc.py
===================================================================
--- trunk/docutils/test/test_writers/test_html5_polyglot_misc.py 2022-10-21 13:50:56 UTC (rev 9166)
+++ trunk/docutils/test/test_writers/test_html5_polyglot_misc.py 2022-10-21 14:18:05 UTC (rev 9167)
@@ -23,7 +23,7 @@
'output_encoding': 'latin1',
'stylesheet': '',
'_disable_config': True}
- result = core.publish_string(
+ result = core.publish_bytes(
'EUR = \u20ac', writer_name='html5_polyglot',
settings_overrides=settings_overrides)
# Encoding a euro sign with latin1 doesn't work, so the
@@ -52,7 +52,7 @@
"""
result = core.publish_string(data, writer_name='html5_polyglot',
settings_overrides=self.mys)
- self.assertIn(b'<dt class="for the second item">second term:</dt>',
+ self.assertIn('<dt class="for the second item">second term:</dt>',
result)
def test_definition_list_item_name(self):
@@ -69,7 +69,7 @@
"""
result = core.publish_string(data, writer_name='html5_polyglot',
settings_overrides=self.mys)
- self.assertIn(b'<dt id="second-item">second term:</dt>',
+ self.assertIn('<dt id="second-item">second term:</dt>',
result)
Modified: trunk/docutils/test/test_writers/test_odt.py
===================================================================
--- trunk/docutils/test/test_writers/test_odt.py 2022-10-21 13:50:56 UTC (rev 9166)
+++ trunk/docutils/test/test_writers/test_odt.py 2022-10-21 14:18:05 UTC (rev 9167)
@@ -63,7 +63,7 @@
settings_overrides['_disable_config'] = True
settings_overrides['language_code'] = 'en-US'
- result = docutils.core.publish_string(
+ result = docutils.core.publish_bytes(
source=input,
reader_name='standalone',
writer_name='odf_odt',
This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site.
|
|
From: <aa-...@us...> - 2022-10-21 14:58:31
|
Revision: 9174
http://sourceforge.net/p/docutils/code/9174
Author: aa-turner
Date: 2022-10-21 14:58:26 +0000 (Fri, 21 Oct 2022)
Log Message:
-----------
Fix flake8 errors ``E127`` and ``F401``
Modified Paths:
--------------
trunk/docutils/docutils/core.py
trunk/docutils/test/DocutilsTestSupport.py
Modified: trunk/docutils/docutils/core.py
===================================================================
--- trunk/docutils/docutils/core.py 2022-10-21 14:57:20 UTC (rev 9173)
+++ trunk/docutils/docutils/core.py 2022-10-21 14:58:26 UTC (rev 9174)
@@ -448,12 +448,12 @@
def publish_bytes(source, source_path=None, destination_path=None,
- reader=None, reader_name='standalone',
- parser=None, parser_name='restructuredtext',
- writer=None, writer_name='pseudoxml',
- settings=None, settings_spec=None,
- settings_overrides=None, config_section=None,
- enable_exit_status=False):
+ reader=None, reader_name='standalone',
+ parser=None, parser_name='restructuredtext',
+ writer=None, writer_name='pseudoxml',
+ settings=None, settings_spec=None,
+ settings_overrides=None, config_section=None,
+ enable_exit_status=False):
"""
Set up & run a `Publisher` for programmatic use with string I/O. Return
the encoded bytes.
Modified: trunk/docutils/test/DocutilsTestSupport.py
===================================================================
--- trunk/docutils/test/DocutilsTestSupport.py 2022-10-21 14:57:20 UTC (rev 9173)
+++ trunk/docutils/test/DocutilsTestSupport.py 2022-10-21 14:58:26 UTC (rev 9174)
@@ -43,7 +43,6 @@
import difflib
import inspect
import os
-import pdb
import sys
import traceback
import unittest
This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site.
|
|
From: <gr...@us...> - 2022-11-02 16:05:02
|
Revision: 9198
http://sourceforge.net/p/docutils/code/9198
Author: grubert
Date: 2022-11-02 16:04:50 +0000 (Wed, 02 Nov 2022)
Log Message:
-----------
add python 3.11 to setup.py and tox.ini. Patch by hugovk.
Modified Paths:
--------------
trunk/docutils/HISTORY.txt
trunk/docutils/setup.py
trunk/docutils/tox.ini
Modified: trunk/docutils/HISTORY.txt
===================================================================
--- trunk/docutils/HISTORY.txt 2022-11-01 00:15:11 UTC (rev 9197)
+++ trunk/docutils/HISTORY.txt 2022-11-02 16:04:50 UTC (rev 9198)
@@ -14,6 +14,8 @@
Changes Since 0.19
==================
+* add python 3.11 to setup.py and tox.ini. Patch by hugovk.
+
* docutils/languages/
docutils/parsers/rst/languages/
Modified: trunk/docutils/setup.py
===================================================================
--- trunk/docutils/setup.py 2022-11-01 00:15:11 UTC (rev 9197)
+++ trunk/docutils/setup.py 2022-11-02 16:04:50 UTC (rev 9198)
@@ -101,6 +101,7 @@
'Programming Language :: Python :: 3.8',
'Programming Language :: Python :: 3.9',
'Programming Language :: Python :: 3.10',
+ 'Programming Language :: Python :: 3.11',
'Topic :: Documentation',
'Topic :: Software Development :: Documentation',
'Topic :: Text Processing',
Modified: trunk/docutils/tox.ini
===================================================================
--- trunk/docutils/tox.ini 2022-11-01 00:15:11 UTC (rev 9197)
+++ trunk/docutils/tox.ini 2022-11-02 16:04:50 UTC (rev 9198)
@@ -1,6 +1,6 @@
[tox]
minversion = 2.0
-envlist = py{37,38,39,310}
+envlist = py{37,38,39,310,311}
[testenv]
whitelist_externals =
This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site.
|
|
From: <gr...@us...> - 2022-11-02 17:08:11
|
Revision: 9199
http://sourceforge.net/p/docutils/code/9199
Author: grubert
Date: 2022-11-02 17:08:08 +0000 (Wed, 02 Nov 2022)
Log Message:
-----------
manpage writer: Do not output empty "manual" in ``.TH``
Modified Paths:
--------------
trunk/docutils/HISTORY.txt
trunk/docutils/docutils/writers/manpage.py
Modified: trunk/docutils/HISTORY.txt
===================================================================
--- trunk/docutils/HISTORY.txt 2022-11-02 16:04:50 UTC (rev 9198)
+++ trunk/docutils/HISTORY.txt 2022-11-02 17:08:08 UTC (rev 9199)
@@ -14,6 +14,10 @@
Changes Since 0.19
==================
+* docutils/writers/manpage.py
+
+ - Do not output empty "manual" in ``.TH``
+
* add python 3.11 to setup.py and tox.ini. Patch by hugovk.
* docutils/languages/
Modified: trunk/docutils/docutils/writers/manpage.py
===================================================================
--- trunk/docutils/docutils/writers/manpage.py 2022-11-02 16:04:50 UTC (rev 9198)
+++ trunk/docutils/docutils/writers/manpage.py 2022-11-02 17:08:08 UTC (rev 9199)
@@ -375,11 +375,14 @@
self._list_char.pop()
def header(self):
- tmpl = (".TH \"%(title_upper)s\" %(manual_section)s"
- " \"%(date)s\" \"%(version)s\" \"%(manual_group)s\"\n"
- ".SH NAME\n"
+ th = (".TH \"%(title_upper)s\" %(manual_section)s"
+ " \"%(date)s\" \"%(version)s\"") % self._docinfo
+ if self._docinfo["manual_group"]:
+ th += " \"%(manual_group)s\"" % self._docinfo
+ th += "\n"
+ sh_tmpl = (".SH NAME\n"
"%(title)s \\- %(subtitle)s\n")
- return tmpl % self._docinfo
+ return th + sh_tmpl % self._docinfo
def append_header(self):
"""append header with .TH and .SH NAME"""
This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site.
|
|
From: <aa-...@us...> - 2022-11-02 22:39:20
|
Revision: 9201
http://sourceforge.net/p/docutils/code/9201
Author: aa-turner
Date: 2022-11-02 22:39:16 +0000 (Wed, 02 Nov 2022)
Log Message:
-----------
Move ``quicktest`` to ``tools/dev``
The quicktest tool has not been substantively modified since 2006.
It may still be useful for generating test-cases, so move it to the
developer tools section and do not advertise it as a front-end tool.
Update documentation where relevant to remove mention of quicktest
as a front-end tool, and remove obsolete "EasyDialogs" code path.
Modified Paths:
--------------
trunk/docutils/docs/dev/hacking.txt
trunk/docutils/docs/dev/todo.txt
trunk/docutils/docs/user/tools.txt
Added Paths:
-----------
trunk/docutils/tools/dev/quicktest.py
Removed Paths:
-------------
trunk/docutils/tools/quicktest.py
Modified: trunk/docutils/docs/dev/hacking.txt
===================================================================
--- trunk/docutils/docs/dev/hacking.txt 2022-11-02 17:08:51 UTC (rev 9200)
+++ trunk/docutils/docs/dev/hacking.txt 2022-11-02 22:39:16 UTC (rev 9201)
@@ -259,7 +259,6 @@
.. _Docutils-develop: ../user/mailing-lists.html#docutils-develop
-.. _quicktest.py: ../user/tools.html#quicktest-py
.. |---| unicode:: 8212 .. em-dash
:trim:
Modified: trunk/docutils/docs/dev/todo.txt
===================================================================
--- trunk/docutils/docs/dev/todo.txt 2022-11-02 17:08:51 UTC (rev 9200)
+++ trunk/docutils/docs/dev/todo.txt 2022-11-02 22:39:16 UTC (rev 9201)
@@ -2285,7 +2285,7 @@
The advantage of the current way of doing things is that parse-time
system messages don't require a transform; they're already in the
document. This is valuable for testing (unit tests,
- tools/quicktest.py). So if we do decide to make a change, I think
+ tools/dev/quicktest.py). So if we do decide to make a change, I think
the insertion of parse-time system messages ought to remain as-is
and the Messages transform ought to move all parse-time system
messages (remove from their originally inserted positions, insert in
Modified: trunk/docutils/docs/user/tools.txt
===================================================================
--- trunk/docutils/docs/user/tools.txt 2022-11-02 17:08:51 UTC (rev 9200)
+++ trunk/docutils/docs/user/tools.txt 2022-11-02 22:39:16 UTC (rev 9201)
@@ -49,8 +49,7 @@
used for the destination. If no arguments are specified, the standard
input (stdin) is used for the source.
-.. [#] The exceptions are buildhtml.py_, quicktest.py_ and
- rst2odt_prepstyles.py_.
+.. [#] The exceptions are buildhtml.py_ and rst2odt_prepstyles.py_.
Getting Help
============
@@ -524,33 +523,6 @@
attributes for any leftover "pending" elements are also given.
-quicktest.py
-------------
-
-:Reader: N/A
-:Parser: reStructuredText
-:Writer: N/A
-
-The ``quicktest.py`` tool is used for testing the reStructuredText
-parser. It does not use a Docutils Reader or Writer or the standard
-Docutils command-line options. Rather, it does its own I/O and calls
-the parser directly. No transforms are applied to the parsed
-document. Possible output forms output include:
-
---pretty Pretty-printed pseudo-XML (default)
-
---test Test data (Python list of input and pseudo-XML output strings;
- useful for creating new test cases)
---xml Pretty-printed native XML
---rawxml Raw native XML (with or without a stylesheet reference)
---help Usage hint and complete list of supported options.
-
-.. Caution:: ``quicktest.py`` uses Python's default encoding.
- Input and output encoding depend on UTF-8 mode,
- Python version, locale setting, and operating system
- (cf. :PEP:`540`, :PEP:`538`, :PEP:`597`, and :PEP:`686`).
-
-
---------------
Customization
---------------
@@ -560,7 +532,7 @@
(reader, writer, parser). [#]_
Some front-end tools also add application-specific settings.
-.. [#] The exceptions are quicktest.py_ and rst2odt_prepstyles.py_.
+.. [#] The exception is rst2odt_prepstyles.py_.
Command-Line Options
Copied: trunk/docutils/tools/dev/quicktest.py (from rev 9200, trunk/docutils/tools/quicktest.py)
===================================================================
--- trunk/docutils/tools/dev/quicktest.py (rev 0)
+++ trunk/docutils/tools/dev/quicktest.py 2022-11-02 22:39:16 UTC (rev 9201)
@@ -0,0 +1,221 @@
+#!/usr/bin/env python3
+
+# $Id$
+# Authors: Garth Kidd <ga...@de...>;
+# David Goodger <go...@py...>
+# Copyright: This module has been placed in the public domain.
+
+"""
+The ``quicktest.py`` tool is used for testing the reStructuredText
+parser. It does not use a Docutils Reader or Writer or the standard
+Docutils command-line options. Rather, it does its own I/O and calls
+the parser directly. No transforms are applied to the parsed
+document. Possible output forms output include:
+
+--pretty Pretty-printed pseudo-XML (default)
+
+--test Test data (Python list of input and pseudo-XML output strings;
+ useful for creating new test cases)
+--xml Pretty-printed native XML
+--rawxml Raw native XML (with or without a stylesheet reference)
+--help Usage hint and complete list of supported options.
+
+.. Caution:: ``quicktest.py`` uses Python's default encoding.
+ Input and output encoding depend on UTF-8 mode,
+ Python version, locale setting, and operating system
+ (cf. :PEP:`540`, :PEP:`538`, :PEP:`597`, and :PEP:`686`).
+"""
+
+try:
+ import locale
+ locale.setlocale(locale.LC_ALL, '')
+except Exception:
+ pass
+
+import sys
+import getopt
+import docutils
+from docutils import frontend
+from docutils.utils import new_document
+from docutils.parsers.rst import Parser
+
+
+usage_header = """\
+quicktest.py: Quickly test the reStructuredText parser. This is not an
+interface to the full functionality of Docutils. Use one of the ``rst2*.py``
+front-end tools instead.
+
+Usage::
+
+ quicktest.py [options] [<source> [<destination>]]
+
+``source`` is the name of the file to use as input (default is stdin).
+``destination`` is the name of the file to create as output (default is
+stdout).
+
+Options:
+"""
+
+options = [('pretty', 'p',
+ 'output pretty pseudo-xml: no "&abc;" entities (default)'),
+ ('test', 't', 'output test-ready data (input & expected output, '
+ 'ready to be copied to a parser test module)'),
+ ('rawxml', 'r', 'output raw XML'),
+ ('styledxml=', 's', 'output raw XML with XSL style sheet '
+ 'reference (filename supplied in the option argument)'),
+ ('xml', 'x', 'output pretty XML (indented)'),
+ ('attributes', 'A', 'dump document attributes after processing'),
+ ('debug', 'd', 'debug mode (lots of output)'),
+ ('version', 'V', 'show Docutils version then exit'),
+ ('help', 'h', 'show help text then exit')]
+"""See ``distutils.fancy_getopt.FancyGetopt.__init__`` for a description of
+the data structure: (long option, short option, description)."""
+
+
+def usage():
+ print(usage_header)
+ for longopt, shortopt, description in options:
+ if longopt[-1:] == '=':
+ opts = '-%s arg, --%sarg' % (shortopt, longopt)
+ else:
+ opts = '-%s, --%s' % (shortopt, longopt)
+ sys.stdout.write('%-15s' % opts)
+ if len(opts) > 14:
+ sys.stdout.write('%-16s' % '\n')
+ while len(description) > 60:
+ limit = description.rindex(' ', 0, 60)
+ print(description[:limit].strip())
+ description = description[limit + 1:]
+ sys.stdout.write('%-15s' % ' ')
+ print(description)
+
+
+def _pretty(input, document, optargs):
+ return document.pformat()
+
+
+def _rawxml(input, document, optargs):
+ return document.asdom().toxml()
+
+
+def _styledxml(input, document, optargs):
+ docnode = document.asdom().childNodes[0]
+ return '\n'.join(('<?xml version="1.0" encoding="ISO-8859-1"?>',
+ '<?xml-stylesheet type="text/xsl" href="%s"?>'
+ % optargs['styledxml'],
+ docnode.toxml()))
+
+
+def _prettyxml(input, document, optargs):
+ return document.asdom().toprettyxml(' ', '\n')
+
+
+def _test(input, document, optargs):
+ tq = '"""'
+ output = document.pformat() # same as _pretty()
+ return """\
+ totest['change_this_test_name'] = [
+[%s\\
+%s
+%s,
+%s\\
+%s
+%s],
+]
+""" % (tq, escape(input.rstrip()), tq, tq, escape(output.rstrip()), tq)
+
+
+def escape(text):
+ """
+ Return `text` in triple-double-quoted Python string form.
+ """
+ text = text.replace('\\', '\\\\') # escape backslashes
+ text = text.replace('"""', '""\\"') # break up triple-double-quotes
+ text = text.replace(' \n', ' \\n\\\n') # protect trailing whitespace
+ return text
+
+
+_outputFormatters = {
+ 'rawxml': _rawxml,
+ 'styledxml': _styledxml,
+ 'xml': _prettyxml,
+ 'pretty': _pretty,
+ 'test': _test}
+
+
+def format(outputFormat, input, document, optargs):
+ formatter = _outputFormatters[outputFormat]
+ return formatter(input, document, optargs)
+
+
+def posixGetArgs(argv):
+ outputFormat = 'pretty'
+ # convert fancy_getopt style option list to getopt.getopt() arguments
+ shortopts = ''.join(option[1] + ':' * (option[0][-1:] == '=')
+ for option in options if option[1])
+ longopts = [option[0] for option in options if option[0]]
+ try:
+ opts, args = getopt.getopt(argv, shortopts, longopts)
+ except getopt.GetoptError:
+ usage()
+ sys.exit(2)
+ optargs = {'debug': 0, 'attributes': 0}
+ for o, a in opts:
+ if o in ['-h', '--help']:
+ usage()
+ sys.exit()
+ elif o in ['-V', '--version']:
+ sys.stderr.write('quicktest.py (Docutils %s%s)\n' %
+ (docutils.__version__,
+ docutils.__version_details__
+ and ' [%s]'%docutils.__version_details__ or ''))
+ sys.exit()
+ elif o in ['-r', '--rawxml']:
+ outputFormat = 'rawxml'
+ elif o in ['-s', '--styledxml']:
+ outputFormat = 'styledxml'
+ optargs['styledxml'] = a
+ elif o in ['-x', '--xml']:
+ outputFormat = 'xml'
+ elif o in ['-p', '--pretty']:
+ outputFormat = 'pretty'
+ elif o in ['-t', '--test']:
+ outputFormat = 'test'
+ elif o in ['--attributes', '-A']:
+ optargs['attributes'] = 1
+ elif o in ['-d', '--debug']:
+ optargs['debug'] = 1
+ else:
+ raise getopt.GetoptError("getopt should have saved us!")
+ if len(args) > 2:
+ print('Maximum 2 arguments allowed.')
+ usage()
+ sys.exit(1)
+ inputFile = sys.stdin
+ outputFile = sys.stdout
+ if args:
+ inputFile = open(args.pop(0))
+ if args:
+ outputFile = open(args.pop(0), 'w')
+ return inputFile, outputFile, outputFormat, optargs
+
+
+def main():
+ # process cmdline arguments:
+ inputFile, outputFile, outputFormat, optargs = posixGetArgs(sys.argv[1:])
+ settings = frontend.get_default_settings(Parser)
+ settings.debug = optargs['debug']
+ parser = Parser()
+ input = inputFile.read()
+ document = new_document(inputFile.name, settings)
+ parser.parse(input, document)
+ output = format(outputFormat, input, document, optargs)
+ outputFile.write(output)
+ if optargs['attributes']:
+ import pprint
+ pprint.pprint(document.__dict__)
+
+
+if __name__ == '__main__':
+ sys.stderr = sys.stdout
+ main()
Deleted: trunk/docutils/tools/quicktest.py
===================================================================
--- trunk/docutils/tools/quicktest.py 2022-11-02 17:08:51 UTC (rev 9200)
+++ trunk/docutils/tools/quicktest.py 2022-11-02 22:39:16 UTC (rev 9201)
@@ -1,224 +0,0 @@
-#!/usr/bin/env python3
-
-# $Id$
-# Authors: Garth Kidd <ga...@de...>;
-# David Goodger <go...@py...>
-# Copyright: This module has been placed in the public domain.
-
-try:
- import locale
- locale.setlocale(locale.LC_ALL, '')
-except Exception:
- pass
-
-import sys
-import os
-import getopt
-import docutils
-from docutils import frontend
-from docutils.utils import new_document
-from docutils.parsers.rst import Parser
-
-
-usage_header = """\
-quicktest.py: Quickly test the reStructuredText parser. This is not an
-interface to the full functionality of Docutils. Use one of the ``rst2*.py``
-front-end tools instead.
-
-Usage::
-
- quicktest.py [options] [<source> [<destination>]]
-
-``source`` is the name of the file to use as input (default is stdin).
-``destination`` is the name of the file to create as output (default is
-stdout).
-
-Options:
-"""
-
-options = [('pretty', 'p',
- 'output pretty pseudo-xml: no "&abc;" entities (default)'),
- ('test', 't', 'output test-ready data (input & expected output, '
- 'ready to be copied to a parser test module)'),
- ('rawxml', 'r', 'output raw XML'),
- ('styledxml=', 's', 'output raw XML with XSL style sheet '
- 'reference (filename supplied in the option argument)'),
- ('xml', 'x', 'output pretty XML (indented)'),
- ('attributes', 'A', 'dump document attributes after processing'),
- ('debug', 'd', 'debug mode (lots of output)'),
- ('version', 'V', 'show Docutils version then exit'),
- ('help', 'h', 'show help text then exit')]
-"""See ``distutils.fancy_getopt.FancyGetopt.__init__`` for a description of
-the data structure: (long option, short option, description)."""
-
-
-def usage():
- print(usage_header)
- for longopt, shortopt, description in options:
- if longopt[-1:] == '=':
- opts = '-%s arg, --%sarg' % (shortopt, longopt)
- else:
- opts = '-%s, --%s' % (shortopt, longopt)
- sys.stdout.write('%-15s' % opts)
- if len(opts) > 14:
- sys.stdout.write('%-16s' % '\n')
- while len(description) > 60:
- limit = description.rindex(' ', 0, 60)
- print(description[:limit].strip())
- description = description[limit + 1:]
- sys.stdout.write('%-15s' % ' ')
- print(description)
-
-
-def _pretty(input, document, optargs):
- return document.pformat()
-
-
-def _rawxml(input, document, optargs):
- return document.asdom().toxml()
-
-
-def _styledxml(input, document, optargs):
- docnode = document.asdom().childNodes[0]
- return '\n'.join(('<?xml version="1.0" encoding="ISO-8859-1"?>',
- '<?xml-stylesheet type="text/xsl" href="%s"?>'
- % optargs['styledxml'],
- docnode.toxml()))
-
-
-def _prettyxml(input, document, optargs):
- return document.asdom().toprettyxml(' ', '\n')
-
-
-def _test(input, document, optargs):
- tq = '"""'
- output = document.pformat() # same as _pretty()
- return """\
- totest['change_this_test_name'] = [
-[%s\\
-%s
-%s,
-%s\\
-%s
-%s],
-]
-""" % (tq, escape(input.rstrip()), tq, tq, escape(output.rstrip()), tq)
-
-
-def escape(text):
- """
- Return `text` in triple-double-quoted Python string form.
- """
- text = text.replace('\\', '\\\\') # escape backslashes
- text = text.replace('"""', '""\\"') # break up triple-double-quotes
- text = text.replace(' \n', ' \\n\\\n') # protect trailing whitespace
- return text
-
-
-_outputFormatters = {
- 'rawxml': _rawxml,
- 'styledxml': _styledxml,
- 'xml': _prettyxml,
- 'pretty': _pretty,
- 'test': _test}
-
-
-def format(outputFormat, input, document, optargs):
- formatter = _outputFormatters[outputFormat]
- return formatter(input, document, optargs)
-
-
-def getArgs():
- if os.name == 'mac' and len(sys.argv) <= 1:
- return macGetArgs()
- else:
- return posixGetArgs(sys.argv[1:])
-
-
-def posixGetArgs(argv):
- outputFormat = 'pretty'
- # convert fancy_getopt style option list to getopt.getopt() arguments
- shortopts = ''.join(option[1] + ':' * (option[0][-1:] == '=')
- for option in options if option[1])
- longopts = [option[0] for option in options if option[0]]
- try:
- opts, args = getopt.getopt(argv, shortopts, longopts)
- except getopt.GetoptError:
- usage()
- sys.exit(2)
- optargs = {'debug': 0, 'attributes': 0}
- for o, a in opts:
- if o in ['-h', '--help']:
- usage()
- sys.exit()
- elif o in ['-V', '--version']:
- sys.stderr.write('quicktest.py (Docutils %s%s)\n' %
- (docutils.__version__,
- docutils.__version_details__
- and ' [%s]'%docutils.__version_details__ or ''))
- sys.exit()
- elif o in ['-r', '--rawxml']:
- outputFormat = 'rawxml'
- elif o in ['-s', '--styledxml']:
- outputFormat = 'styledxml'
- optargs['styledxml'] = a
- elif o in ['-x', '--xml']:
- outputFormat = 'xml'
- elif o in ['-p', '--pretty']:
- outputFormat = 'pretty'
- elif o in ['-t', '--test']:
- outputFormat = 'test'
- elif o in ['--attributes', '-A']:
- optargs['attributes'] = 1
- elif o in ['-d', '--debug']:
- optargs['debug'] = 1
- else:
- raise getopt.GetoptError("getopt should have saved us!")
- if len(args) > 2:
- print('Maximum 2 arguments allowed.')
- usage()
- sys.exit(1)
- inputFile = sys.stdin
- outputFile = sys.stdout
- if args:
- inputFile = open(args.pop(0))
- if args:
- outputFile = open(args.pop(0), 'w')
- return inputFile, outputFile, outputFormat, optargs
-
-
-def macGetArgs():
- import EasyDialogs
- EasyDialogs.Message("""\
-Use the next dialog to build a command line:
-
-1. Choose an output format from the [Option] list
-2. Click [Add]
-3. Choose an input file: [Add existing file...]
-4. Save the output: [Add new file...]
-5. [OK]""")
- optionlist = [(longopt, description)
- for (longopt, shortopt, description) in options]
- argv = EasyDialogs.GetArgv(optionlist=optionlist, addfolder=0)
- return posixGetArgs(argv)
-
-
-def main():
- # process cmdline arguments:
- inputFile, outputFile, outputFormat, optargs = getArgs()
- settings = frontend.get_default_settings(Parser)
- settings.debug = optargs['debug']
- parser = Parser()
- input = inputFile.read()
- document = new_document(inputFile.name, settings)
- parser.parse(input, document)
- output = format(outputFormat, input, document, optargs)
- outputFile.write(output)
- if optargs['attributes']:
- import pprint
- pprint.pprint(document.__dict__)
-
-
-if __name__ == '__main__':
- sys.stderr = sys.stdout
- main()
This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site.
|
|
From: <aa-...@us...> - 2022-11-02 23:28:52
|
Revision: 9202
http://sourceforge.net/p/docutils/code/9202
Author: aa-turner
Date: 2022-11-02 23:28:49 +0000 (Wed, 02 Nov 2022)
Log Message:
-----------
Partially revert r9167
``docutils.core.publish_string`` uses Python 2 notion of a
bytestring, such that in the general case it returns Python 3's
``bytes`` type. Revision 9167 attempted to address this distinction
by introducing ``publish_bytes`` and changing ``publish_string`` to
always return unicode text data as Python's ``str`` type. This is a
backwards compatibility break, so in this commit we restore the
previous behaviour, whilst simultaneously deprecating support for
returning binary data from the ``docutils.core.publish_string``
function for at least two releases of Docutils.
As part of this, we also deprecate returning binary data from the
``docutils.io.StringOutput.encode`` method, docutils.io.BytesOutput``
should be used in its stead.
Finally, we update tests for the reversion to the previous behaviour.
Revision Links:
--------------
http://sourceforge.net/p/docutils/code/9167
Modified Paths:
--------------
trunk/docutils/docutils/core.py
trunk/docutils/docutils/io.py
trunk/docutils/docutils/writers/_html_base.py
trunk/docutils/docutils/writers/docutils_xml.py
trunk/docutils/docutils/writers/html5_polyglot/__init__.py
trunk/docutils/docutils/writers/latex2e/__init__.py
trunk/docutils/docutils/writers/s5_html/__init__.py
trunk/docutils/test/DocutilsTestSupport.py
trunk/docutils/test/alltests.py
trunk/docutils/test/test_parsers/test_recommonmark/test_misc.py
trunk/docutils/test/test_parsers/test_rst/test_directives/test_code_parsing.py
trunk/docutils/test/test_publisher.py
trunk/docutils/test/test_writers/test_docutils_xml.py
trunk/docutils/test/test_writers/test_html4css1_misc.py
trunk/docutils/test/test_writers/test_html5_polyglot_misc.py
trunk/docutils/test/test_writers/test_latex2e_misc.py
trunk/docutils/test/test_writers/test_null.py
Modified: trunk/docutils/docutils/core.py
===================================================================
--- trunk/docutils/docutils/core.py 2022-11-02 22:39:16 UTC (rev 9201)
+++ trunk/docutils/docutils/core.py 2022-11-02 23:28:49 UTC (rev 9202)
@@ -429,10 +429,22 @@
enable_exit_status=False):
"""
Set up & run a `Publisher` for programmatic use with string I/O. Return
- Unicode string output.
+ the encoded string or Unicode string output.
+ For encoded string output, be sure to set the 'output_encoding' setting to
+ the desired encoding. Set it to 'unicode' for unencoded Unicode string
+ output. Here's one way::
+
+ publish_string(..., settings_overrides={'output_encoding': 'unicode'})
+
+ Similarly for Unicode string input (`source`)::
+
+ publish_string(..., settings_overrides={'input_encoding': 'unicode'})
+
Parameters: see `publish_programmatically`.
"""
+ warnings.warn('The return type of publish_string will change to '
+ '"str" from Docutils 0.21.', FutureWarning, stacklevel=2)
output, pub = publish_programmatically(
source_class=io.StringInput, source=source, source_path=source_path,
destination_class=io.StringOutput,
Modified: trunk/docutils/docutils/io.py
===================================================================
--- trunk/docutils/docutils/io.py 2022-11-02 22:39:16 UTC (rev 9201)
+++ trunk/docutils/docutils/io.py 2022-11-02 23:28:49 UTC (rev 9202)
@@ -558,7 +558,8 @@
class BytesOutput(Output):
"""
- Direct string output.
+ Direct binary output.
+ Provisional.
"""
default_destination_path = '<bytes>'
@@ -601,9 +602,12 @@
return self.destination
def encode(self, data):
- if isinstance(data, bytes):
- return data.decode(self.encoding, self.error_handler)
- return str(data)
+ data = super().encode(data)
+ if not isinstance(data, str):
+ warnings.warn("StringOutput.encode()'s return type will change to "
+ f'``str`` from Docutils 0.21, got type {type(data)}',
+ FutureWarning, stacklevel=2)
+ return data
class NullInput(Input):
Modified: trunk/docutils/docutils/writers/_html_base.py
===================================================================
--- trunk/docutils/docutils/writers/_html_base.py 2022-11-02 22:39:16 UTC (rev 9201)
+++ trunk/docutils/docutils/writers/_html_base.py 2022-11-02 23:28:49 UTC (rev 9202)
@@ -286,7 +286,7 @@
self.html_prolog = []
if settings.xml_declaration:
self.head_prefix.append(self.xml_declaration
- % settings.output_encoding)
+ % _output_encoding(settings))
# self.content_type = ""
# encoding not interpolated:
self.html_prolog.append(self.xml_declaration)
@@ -812,8 +812,8 @@
self.head_prefix_template %
{'lang': self.settings.language_code}])
self.html_prolog.append(self.doctype)
- self.meta.insert(0, self.content_type % self.settings.output_encoding)
- self.head.insert(0, self.content_type % self.settings.output_encoding)
+ self.meta.insert(0, self.content_type % _output_encoding(self.settings))
+ self.head.insert(0, self.content_type % _output_encoding(self.settings))
if 'name="dcterms.' in ''.join(self.meta):
self.head.append('<link rel="schema.dcterms"'
'href="http://purl.org/dc/terms/"/>')
@@ -1779,3 +1779,10 @@
visit_substitution_definition = ignore_node
visit_target = ignore_node
visit_pending = ignore_node
+
+
+def _output_encoding(settings):
+ """TEMPORARY, remove in Docutils 0.21"""
+ if settings.output_encoding == 'unicode':
+ return 'utf-8'
+ return settings.output_encoding
Modified: trunk/docutils/docutils/writers/docutils_xml.py
===================================================================
--- trunk/docutils/docutils/writers/docutils_xml.py 2022-11-02 22:39:16 UTC (rev 9201)
+++ trunk/docutils/docutils/writers/docutils_xml.py 2022-11-02 23:28:49 UTC (rev 9202)
@@ -101,7 +101,7 @@
self.output = []
if settings.xml_declaration:
self.output.append(
- self.xml_declaration % settings.output_encoding)
+ self.xml_declaration % _output_encoding(settings))
if settings.doctype_declaration:
self.output.append(self.doctype)
self.output.append(self.generator % docutils.__version__)
@@ -186,3 +186,10 @@
def setDocumentLocator(self, locator):
self.locator = locator
+
+
+def _output_encoding(settings):
+ """TEMPORARY, remove in Docutils 0.21"""
+ if settings.output_encoding == 'unicode':
+ return 'utf-8'
+ return settings.output_encoding
Modified: trunk/docutils/docutils/writers/html5_polyglot/__init__.py
===================================================================
--- trunk/docutils/docutils/writers/html5_polyglot/__init__.py 2022-11-02 22:39:16 UTC (rev 9201)
+++ trunk/docutils/docutils/writers/html5_polyglot/__init__.py 2022-11-02 23:28:49 UTC (rev 9202)
@@ -205,8 +205,8 @@
self.html_prolog.append(self.doctype)
self.meta.insert(0, self.viewport)
self.head.insert(0, self.viewport)
- self.meta.insert(0, self.content_type % self.settings.output_encoding)
- self.head.insert(0, self.content_type % self.settings.output_encoding)
+ self.meta.insert(0, self.content_type % _output_encoding(self))
+ self.head.insert(0, self.content_type % _output_encoding(self))
if 'name="dcterms.' in ''.join(self.meta):
self.head.append('<link rel="schema.dcterms"'
' href="http://purl.org/dc/terms/"/>')
@@ -452,3 +452,10 @@
f' href="#{ids[0]}"></a>')
close_tag = close_tag.replace('</h', self_link + '</h')
return start_tag, close_tag
+
+
+def _output_encoding(self):
+ """TEMPORARY, remove in Docutils 0.21"""
+ if self.settings.output_encoding == 'unicode':
+ return 'utf-8'
+ return self.settings.output_encoding
Modified: trunk/docutils/docutils/writers/latex2e/__init__.py
===================================================================
--- trunk/docutils/docutils/writers/latex2e/__init__.py 2022-11-02 22:39:16 UTC (rev 9201)
+++ trunk/docutils/docutils/writers/latex2e/__init__.py 2022-11-02 23:28:49 UTC (rev 9202)
@@ -1460,6 +1460,7 @@
# 'iso-8859-7': '' # greek
# 'iso-8859-8': '' # hebrew
# 'iso-8859-10': '' # latin6, more complete iso-8859-4
+ 'unicode': 'utf8', # TEMPORARY, remove in Docutils 0.21
}
encoding = docutils_encoding.lower()
if encoding in tr:
Modified: trunk/docutils/docutils/writers/s5_html/__init__.py
===================================================================
--- trunk/docutils/docutils/writers/s5_html/__init__.py 2022-11-02 22:39:16 UTC (rev 9201)
+++ trunk/docutils/docutils/writers/s5_html/__init__.py 2022-11-02 23:28:49 UTC (rev 9202)
@@ -282,8 +282,8 @@
self.head_prefix_template %
{'lang': self.settings.language_code}])
self.html_prolog.append(self.doctype)
- self.meta.insert(0, self.content_type % self.settings.output_encoding)
- self.head.insert(0, self.content_type % self.settings.output_encoding)
+ self.meta.insert(0, self.content_type % _output_encoding(self))
+ self.head.insert(0, self.content_type % _output_encoding(self))
if self.math_header:
if self.math_output == 'mathjax':
self.head.extend(self.math_header)
@@ -350,3 +350,10 @@
def visit_title(self, node):
html4css1.HTMLTranslator.visit_title(self, node)
+
+
+def _output_encoding(self):
+ """TEMPORARY, remove in Docutils 0.21"""
+ if self.settings.output_encoding == 'unicode':
+ return 'utf-8'
+ return self.settings.output_encoding
Modified: trunk/docutils/test/DocutilsTestSupport.py
===================================================================
--- trunk/docutils/test/DocutilsTestSupport.py 2022-11-02 22:39:16 UTC (rev 9201)
+++ trunk/docutils/test/DocutilsTestSupport.py 2022-11-02 23:28:49 UTC (rev 9202)
@@ -492,7 +492,8 @@
"""
settings_default_overrides = {'_disable_config': True,
- 'strict_visitor': True}
+ 'strict_visitor': True,
+ 'output_encoding': 'unicode'}
writer_name = '' # set in subclasses or constructor
def __init__(self, *args, writer_name='', **kwargs):
@@ -508,7 +509,7 @@
writer_name=self.writer_name,
settings_spec=self,
settings_overrides=self.suite_settings)
- self.assertEqual(output, str(self.expected))
+ self.assertEqual(str(output), str(self.expected))
class PublishTestSuite(CustomTestSuite):
Modified: trunk/docutils/test/alltests.py
===================================================================
--- trunk/docutils/test/alltests.py 2022-11-02 22:39:16 UTC (rev 9201)
+++ trunk/docutils/test/alltests.py 2022-11-02 23:28:49 UTC (rev 9202)
@@ -22,11 +22,19 @@
import glob # noqa: E402
import os # noqa: E402
import platform # noqa: E402
+import warnings # noqa: E402
from importlib import import_module # noqa: E402
import DocutilsTestSupport # noqa: E402 must be imported before docutils
import docutils # noqa: E402
+warnings.filterwarnings('ignore',
+ message='.*return type of publish_string.*',
+ category=FutureWarning)
+warnings.filterwarnings('ignore',
+ message=r".*StringOutput.encode\(\)'s return type.*",
+ category=FutureWarning)
+
class Tee:
"""Write to a file and a stream (default: stdout) simultaneously."""
Modified: trunk/docutils/test/test_parsers/test_recommonmark/test_misc.py
===================================================================
--- trunk/docutils/test/test_parsers/test_recommonmark/test_misc.py 2022-11-02 22:39:16 UTC (rev 9201)
+++ trunk/docutils/test/test_parsers/test_recommonmark/test_misc.py 2022-11-02 23:28:49 UTC (rev 9202)
@@ -51,8 +51,11 @@
def test_raw_disabled(self):
output = publish_string(sample_with_html, parser=parser,
- settings_overrides={'warning_stream': '',
- 'raw_enabled': False})
+ settings_overrides={
+ 'warning_stream': '',
+ 'raw_enabled': False,
+ 'output_encoding': 'unicode',
+ })
self.assertNotIn('<raw>', output)
self.assertIn('<system_message', output)
self.assertIn('Raw content disabled.', output)
@@ -59,9 +62,11 @@
def test_raw_disabled_inline(self):
output = publish_string('foo <a href="uri">', parser=parser,
- settings_overrides={'warning_stream': '',
- 'raw_enabled': False,
- })
+ settings_overrides={
+ 'warning_stream': '',
+ 'raw_enabled': False,
+ 'output_encoding': 'unicode',
+ })
self.assertNotIn('<raw>', output)
self.assertIn('<system_message', output)
self.assertIn('Raw content disabled.', output)
@@ -73,7 +78,8 @@
def test_missing_parser_message(self):
with self.assertRaisesRegex(ImportError,
'requires the package .*recommonmark'):
- publish_string(sample_with_html, parser_name='recommonmark')
+ publish_string(sample_with_html, parser_name='recommonmark',
+ settings_overrides={'output_encoding': 'unicode'})
if __name__ == '__main__':
Modified: trunk/docutils/test/test_parsers/test_rst/test_directives/test_code_parsing.py
===================================================================
--- trunk/docutils/test/test_parsers/test_rst/test_directives/test_code_parsing.py 2022-11-02 22:39:16 UTC (rev 9201)
+++ trunk/docutils/test/test_parsers/test_rst/test_directives/test_code_parsing.py 2022-11-02 23:28:49 UTC (rev 9202)
@@ -38,7 +38,7 @@
autoload("abc_mode", "abc");
"""
-settings = {'warning_stream': ''}
+settings = {'warning_stream': '', 'output_encoding': 'unicode'}
@unittest.skipUnless(with_pygments, 'optional module "pygments" not found')
Modified: trunk/docutils/test/test_publisher.py
===================================================================
--- trunk/docutils/test/test_publisher.py 2022-11-02 22:39:16 UTC (rev 9201)
+++ trunk/docutils/test/test_publisher.py 2022-11-02 23:28:49 UTC (rev 9202)
@@ -106,7 +106,8 @@
settings_spec=self,
settings_overrides={'expose_internals':
['refnames', 'do_not_expose'],
- 'report_level': 1})
+ 'report_level': 1,
+ 'output_encoding': 'unicode'})
self.assertEqual(output, exposed_pseudoxml_output)
# Test publishing parts using document as the source.
@@ -150,7 +151,7 @@
# Write out the document:
output = core.publish_from_doctree(
doctree_zombie, writer_name='pseudoxml',
- settings_spec=self)
+ settings_spec=self).decode('utf-8')
self.assertEqual(output, pseudoxml_output)
Modified: trunk/docutils/test/test_writers/test_docutils_xml.py
===================================================================
--- trunk/docutils/test/test_writers/test_docutils_xml.py 2022-11-02 22:39:16 UTC (rev 9201)
+++ trunk/docutils/test/test_writers/test_docutils_xml.py 2022-11-02 23:28:49 UTC (rev 9202)
@@ -121,11 +121,10 @@
def publish_xml(settings, source):
- return docutils.core.publish_string(source=source.encode('utf-8'),
- reader_name='standalone',
- writer_name='docutils_xml',
- settings_overrides=settings
- ).encode('latin1', 'xmlcharrefreplace')
+ return docutils.core.publish_bytes(source=source.encode('utf-8'),
+ reader_name='standalone',
+ writer_name='docutils_xml',
+ settings_overrides=settings)
# XML Test Case
Modified: trunk/docutils/test/test_writers/test_html4css1_misc.py
===================================================================
--- trunk/docutils/test/test_writers/test_html4css1_misc.py 2022-11-02 22:39:16 UTC (rev 9201)
+++ trunk/docutils/test/test_writers/test_html4css1_misc.py 2022-11-02 23:28:49 UTC (rev 9202)
@@ -37,6 +37,7 @@
mys = {'stylesheet_path': '',
# 'embed_stylesheet': False,
'_disable_config': True,
+ 'output_encoding': 'unicode',
}
def test_definition_list_item_classes(self):
Modified: trunk/docutils/test/test_writers/test_html5_polyglot_misc.py
===================================================================
--- trunk/docutils/test/test_writers/test_html5_polyglot_misc.py 2022-11-02 22:39:16 UTC (rev 9201)
+++ trunk/docutils/test/test_writers/test_html5_polyglot_misc.py 2022-11-02 23:28:49 UTC (rev 9202)
@@ -36,6 +36,7 @@
mys = {'stylesheet_path': '',
# 'embed_stylesheet': False,
'_disable_config': True,
+ 'output_encoding': 'unicode',
}
def test_definition_list_item_classes(self):
@@ -139,6 +140,7 @@
"""Warn about deprecated setting name."""
my_settings = {'_disable_config': True,
'embed_images': False,
+ 'output_encoding': 'unicode',
}
with self.assertWarnsRegex(FutureWarning,
'"embed_images" will be removed'):
Modified: trunk/docutils/test/test_writers/test_latex2e_misc.py
===================================================================
--- trunk/docutils/test/test_writers/test_latex2e_misc.py 2022-11-02 22:39:16 UTC (rev 9201)
+++ trunk/docutils/test/test_writers/test_latex2e_misc.py 2022-11-02 23:28:49 UTC (rev 9202)
@@ -61,6 +61,7 @@
mysettings = {'_disable_config': True,
# 'use_latex_citations': False,
# 'legacy_column_widths': True,
+ 'output_encoding': 'unicode',
}
with self.assertWarnsRegex(FutureWarning,
'"legacy_column_widths" will change'):
Modified: trunk/docutils/test/test_writers/test_null.py
===================================================================
--- trunk/docutils/test/test_writers/test_null.py 2022-11-02 22:39:16 UTC (rev 9201)
+++ trunk/docutils/test/test_writers/test_null.py 2022-11-02 23:28:49 UTC (rev 9202)
@@ -12,7 +12,8 @@
def suite():
- s = DocutilsTestSupport.PublishTestSuite('null')
+ s = DocutilsTestSupport.PublishTestSuite(
+ 'null', suite_settings={'output_encoding': 'utf-8'})
s.generateTests(totest)
return s
This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site.
|