|
From: <mi...@us...> - 2025-04-25 14:29:58
|
Revision: 10105
http://sourceforge.net/p/docutils/code/10105
Author: milde
Date: 2025-04-25 14:29:41 +0000 (Fri, 25 Apr 2025)
Log Message:
-----------
Documentation update.
Unify naming of Docutils library objects in RELEASE NOTES:
skip the initial `docutils`.
Simplify docstring for `nodes.document.set_name_id_map()`.
Modified Paths:
--------------
trunk/docutils/RELEASE-NOTES.rst
trunk/docutils/docutils/nodes.py
Modified: trunk/docutils/RELEASE-NOTES.rst
===================================================================
--- trunk/docutils/RELEASE-NOTES.rst 2025-04-25 13:13:48 UTC (rev 10104)
+++ trunk/docutils/RELEASE-NOTES.rst 2025-04-25 14:29:41 UTC (rev 10105)
@@ -295,21 +295,21 @@
Provisional.
Removed objects
- `docutils.core.Publisher.setup_option_parser()`
+ `core.Publisher.setup_option_parser()`
internal, obsolete,
- `docutils.frontend.OptionParser.set_defaults_from_dict()`
+ `frontend.OptionParser.set_defaults_from_dict()`
obsolete,
- `docutils.nodes.Element.set_class()`
+ `nodes.Element.set_class()`
obsolete, append to Element['classes'] directly,
- `docutils.parsers.rst.directives.tables.CSVTable.decode_from_csv()`
+ `parsers.rst.directives.tables.CSVTable.decode_from_csv()`
not required with Python 3,
- `docutils.parsers.rst.directives.tables.CSVTable.encode_from_csv()`
+ `parsers.rst.directives.tables.CSVTable.encode_from_csv()`
not required with Python 3,
- `docutils.transforms.writer_aux.Compound`
+ `transforms.writer_aux.Compound`
not used since Dec 2010,
- `docutils.utils.error_reporting`
+ `utils.error_reporting`
obsolete in Python 3,
- `docutils.utils.Reporter.set_conditions()`
+ `utils.Reporter.set_conditions()`
obsolete, set attributes via configuration settings or directly.
Removed localisations:
@@ -321,7 +321,7 @@
Removed files
``tools/rst2odt_prepstyles.py``
- Obsoleted by `docutils.writers.odf_odt.prepstyles`.
+ Obsoleted by `writers.odf_odt.prepstyles`.
``docutils/utils/roman.py``
Obsoleted by ``docutils/utils/_roman_numerals.py``
@@ -419,9 +419,9 @@
* Removed objects:
- `docutils.nodes.reprunicode`, `docutils.nodes.ensure_str()`
+ `nodes.reprunicode`, `nodes.ensure_str()`
Python 2 compatibility hacks
- `docutils.utils.Reporter.set_conditions()`
+ `utils.Reporter.set_conditions()`
obsolete
`writers.latex2e.Table.get_caption`
obsolete
Modified: trunk/docutils/docutils/nodes.py
===================================================================
--- trunk/docutils/docutils/nodes.py 2025-04-25 13:13:48 UTC (rev 10104)
+++ trunk/docutils/docutils/nodes.py 2025-04-25 14:29:41 UTC (rev 10105)
@@ -1857,31 +1857,29 @@
) -> None:
"""
`self.nameids` maps names to IDs, while `self.nametypes` maps names to
- booleans representing hyperlink type (True==explicit,
+ booleans representing hyperlink target type (True==explicit,
False==implicit). This method updates the mappings.
The following state transition table shows how `self.nameids` items
("id") and `self.nametypes` items ("type") change with new input
- (a call to this method), and what actions are performed
- ("implicit"-type system messages are INFO/1, and
- "explicit"-type system messages are ERROR/3):
+ (a call to this method), and what actions are performed:
- ==== ===== ======== ======== ======= ==== ===== =====
- Old State Input Action New State Notes
- ----------- -------- ----------------- ----------- -----
- id type new type sys.msg. dupname id type
- ==== ===== ======== ======== ======= ==== ===== =====
- - - explicit - - new True
- - - implicit - - new False
- - False explicit - - new True
- old False explicit implicit old new True
- - True explicit explicit new - True
- old True explicit explicit new,old - True [#]_
- - False implicit implicit new - False
- old False implicit implicit new,old - False
- - True implicit implicit new - True
- old True implicit implicit new old True
- ==== ===== ======== ======== ======= ==== ===== =====
+ ==== ======== ======== ======== ======= ==== ======== =====
+ Old State Input Action New State Notes
+ -------------- -------- ----------------- -------------- -----
+ id type new type sys.msg. dupname id type
+ ==== ======== ======== ======== ======= ==== ======== =====
+ - - explicit - - new explicit
+ - - implicit - - new implicit
+ - implicit explicit - - new explicit
+ old implicit explicit INFO old new explicit
+ - explicit explicit ERROR new - explicit
+ old explicit explicit ERROR new,old - explicit [#]_
+ - implicit implicit INFO new - implicit
+ old implicit implicit INFO new,old - implicit
+ - explicit implicit INFO new - explicit
+ old explicit implicit INFO new old explicit
+ ==== ======== ======== ======== ======= ==== ======== =====
.. [#] Do not clear the name-to-id map or invalidate the old target if
both old and new targets are external and refer to identical URIs.
This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site.
|
|
From: <mi...@us...> - 2025-04-25 14:30:40
|
Revision: 10106
http://sourceforge.net/p/docutils/code/10106
Author: milde
Date: 2025-04-25 14:30:22 +0000 (Fri, 25 Apr 2025)
Log Message:
-----------
Remove `frontend.ConfigParser.get_section()`.
Obsoleted by the configparser's "Mapping Protocol Access".
Modified Paths:
--------------
trunk/docutils/RELEASE-NOTES.rst
trunk/docutils/docutils/frontend.py
Modified: trunk/docutils/RELEASE-NOTES.rst
===================================================================
--- trunk/docutils/RELEASE-NOTES.rst 2025-04-25 14:29:41 UTC (rev 10105)
+++ trunk/docutils/RELEASE-NOTES.rst 2025-04-25 14:30:22 UTC (rev 10106)
@@ -297,6 +297,8 @@
Removed objects
`core.Publisher.setup_option_parser()`
internal, obsolete,
+ `frontend.ConfigParser.get_section()`
+ obsoleted by the configparser's "Mapping Protocol Access",
`frontend.OptionParser.set_defaults_from_dict()`
obsolete,
`nodes.Element.set_class()`
Modified: trunk/docutils/docutils/frontend.py
===================================================================
--- trunk/docutils/docutils/frontend.py 2025-04-25 14:29:41 UTC (rev 10105)
+++ trunk/docutils/docutils/frontend.py 2025-04-25 14:30:22 UTC (rev 10106)
@@ -1107,7 +1107,10 @@
def handle_old_config(self, filename: str) -> None:
warnings.warn_explicit(self.old_warning, ConfigDeprecationWarning,
filename, 0)
- options = self.get_section('options')
+ try:
+ options = dict(self['options'])
+ except KeyError:
+ options = {}
if not self.has_section('general'):
self.add_section('general')
for key, value in options.items():
@@ -1157,24 +1160,7 @@
"""
return optionstr.lower().replace('-', '_')
- def get_section(self, section: str) -> dict[str, str]:
- """
- Return a given section as a dictionary.
- Return empty dictionary if the section doesn't exist.
-
- Deprecated. Use the configparser "Mapping Protocol Access" and
- catch KeyError.
- """
- warnings.warn('frontend.OptionParser.get_section() '
- 'will be removed in Docutils 0.21 or later.',
- DeprecationWarning, stacklevel=2)
- try:
- return dict(self[section])
- except KeyError:
- return {}
-
-
class ConfigDeprecationWarning(FutureWarning):
"""Warning for deprecated configuration file features."""
This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site.
|
|
From: <mi...@us...> - 2025-04-27 20:43:32
|
Revision: 10112
http://sourceforge.net/p/docutils/code/10112
Author: milde
Date: 2025-04-27 20:43:12 +0000 (Sun, 27 Apr 2025)
Log Message:
-----------
New "standard definition file" with additional role definition.
The new file "html-roles.txt" provides role definitions for
"semantic HTML inline markup elements" and
"tags for representation of edits to the document".
The additional roles "b", "bdi", "del", "dfn", "i", "ins",
"kbd", "mark", "q", "samp", "small", "u", "s", and "var"
work out of the box with the "html5" writer.
LaTeX styling definitions are inlcuded.
Modified Paths:
--------------
trunk/docutils/docs/dev/todo.rst
trunk/docutils/docs/ref/rst/definitions.rst
Added Paths:
-----------
trunk/docutils/docutils/parsers/rst/include/html-roles.txt
Modified: trunk/docutils/docs/dev/todo.rst
===================================================================
--- trunk/docutils/docs/dev/todo.rst 2025-04-25 22:52:19 UTC (rev 10111)
+++ trunk/docutils/docs/dev/todo.rst 2025-04-27 20:43:12 UTC (rev 10112)
@@ -1994,6 +1994,9 @@
.. |reST| acronym:: reST
:text: reStructuredText
+ 5. Use square brackets for positional and named options like AsciiDoc
+ (cf. https://sourceforge.net/p/docutils/feature-requests/68/).
+
What do we do for other formats than HTML which do not support
tool tips? Put the full text in parentheses?
Modified: trunk/docutils/docs/ref/rst/definitions.rst
===================================================================
--- trunk/docutils/docs/ref/rst/definitions.rst 2025-04-25 22:52:19 UTC (rev 10111)
+++ trunk/docutils/docs/ref/rst/definitions.rst 2025-04-27 20:43:12 UTC (rev 10112)
@@ -1,4 +1,5 @@
.. include:: ../../header2.rst
+.. include:: <html-roles.txt>
============================================
reStructuredText Standard Definition Files
@@ -161,8 +162,66 @@
.. _xhtml1-symbol.txt: ../../../docutils/parsers/rst/include/xhtml1-symbol.txt
+Role Definitions
+================
+
+Role definitions use the `"role" directive`_ to provide additional
+`reStructuredText interpreted text roles`_.
+
+.. _"role" directive: directives.html#role
+.. _reStructuredText interpreted text roles: roles.html
+
+
+Additional roles for HTML
+-------------------------
+
+The "html-roles.txt_" standard definitions file provides role
+definitions for semantic `HTML inline markup elements`__ and
+`tags for representation of edits to the document`__ that
+do not have a corresponding standard rST role
+(except for elements requiring an additional attribute).
+
+The additional roles work out of the box with the `"html5" writer`_
+that selects the corresponding HTML element.
+LaTeX styling definitions are included. For best results add
+the LaTeX packages soul_ and xcolor_ to the `stylesheet setting`__.
+
+.. _html-roles.txt: ../../../docutils/parsers/rst/include/html-roles.txt
+__ https://html.spec.whatwg.org/multipage/text-level-semantics.html
+__ https://html.spec.whatwg.org/multipage/edits.html
+__ ../../user/config.html#stylesheet-2
+.. _soul: https://ctan.org/pkg/soul
+.. _xcolor: https://ctan.org/pkg/xcolor
+
+.. class:: field-indent-4em
+
+:b: highlight :b:`key words` without marking them up as important
+:bdi: text :bdi:`directionality` isolation [#attribute-optional]_
+:del: :del:`represents` removed content [#attribute-optional]_
+:dfn: :dfn:`dfn` represents the defining instance of a term
+ [#attribute-optional]_
+:i: :i:`voix alternative`
+:ins: :ins:`editional` additions [#attribute-optional]_
+:kbd: user input like :kbd:`Ctrl X`
+:mark: :mark:`highlight` a run of text
+:q: represents :q:`phrasing content quoted from another source`
+ [#attribute-optional]_
+:s: text that is no longer accurate, :s:`or no longer relevant`
+:samp: computer output like :samp:`hello world!`
+:small: side comments :small:`like this`
+:u: unarticulated annotations of, e.g, :u:`mispellings`
+:var: variables (or constants like :var:`c`)
+
+.. [#attribute-optional] Would gain from support for attributes/arguments
+ to inline roles (see TODO_).
+
+.. _TODO: https://docutils.sourceforge.io/docs/dev/todo.html
+ #acronym-and-abbreviation
+.. _"html5" writer: ../../user/html.html#html5
+
+
S5/HTML Definitions
-===================
+-------------------
The "s5defs.txt_" standard definition file contains interpreted text
roles (classes) and other definitions for documents destined to become
Added: trunk/docutils/docutils/parsers/rst/include/html-roles.txt
===================================================================
--- trunk/docutils/docutils/parsers/rst/include/html-roles.txt (rev 0)
+++ trunk/docutils/docutils/parsers/rst/include/html-roles.txt 2025-04-27 20:43:12 UTC (rev 10112)
@@ -0,0 +1,45 @@
+.. Standard definition file for additonal roles matching HTML tags.
+
+ :Copyright: © 2025 Günter Milde.
+ :License: Released under the terms of the
+ `2-Clause BSD license <http://www.spdx.org/licenses/BSD-2-Clause>`__
+
+.. role:: b
+.. role:: bdi
+.. role:: del
+.. role:: dfn
+.. role:: i
+.. role:: ins
+.. role:: kbd(literal)
+.. role:: mark
+.. role:: q
+.. role:: samp(literal)
+.. role:: small
+.. role:: u
+.. role:: s
+.. role:: var
+
+.. raw:: latex
+
+ % Definitions for semantic HTML inline markup and representation of edits
+ % (standard definition file "html-roles.txt").
+ % Add "soul" to the "stylesheet" setting for markup test that wraps
+ % and "xcolor" for yellow highlighting with :mark:`me`.
+ \providecommand{\DUroleb}{\textbf}
+ \providecommand{\DUroledel}{\st}
+ \providecommand{\DUroledfn}{\emph}
+ \providecommand{\DUrolei}{\textit}
+ \providecommand{\DUroleins}{\ul}
+ \providecommand{\DUrolekbd}{\texttt}
+ \providecommand{\DUrolemark}{\hl}
+ \providecommand{\DUroleq}[1]{“#1”}
+ \providecommand{\DUroles}{\st}
+ \providecommand{\DUrolesmall}[1]{{\footnotesize #1}}
+ \providecommand{\DUroleu}{\underline}
+ \providecommand{\DUrolevar}{\textit}
+ % fallback definitions
+ \providecommand{\ul}{\underline}
+ \providecommand{\hl}{\underline} % highlight/mark
+ \providecommand{\st}[1]{% strikethrough
+ \raisebox{1ex}{\underline{\smash{\raisebox{-1ex}{#1}}}}%
+ }
Property changes on: trunk/docutils/docutils/parsers/rst/include/html-roles.txt
___________________________________________________________________
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...> - 2025-04-29 20:36:24
|
Revision: 10113
http://sourceforge.net/p/docutils/code/10113
Author: milde
Date: 2025-04-29 20:36:06 +0000 (Tue, 29 Apr 2025)
Log Message:
-----------
Documentation fixes and update.
alternatives.rst:
* "standard definition files" are now included as part of Docutils.
* the "dfn" role (defined in the "html-roles.txt" standard definition file
corresponds to the HTML `<dfn>` element for the defining term.
It can be used instead of a simple emphasis for a more semantic markup.
todo.rst:
* tools/buildhtml.py has now an "--ignore" option for files,
* "container" directive now reports an error if the :class: option is used
(classes are passed as argument),
* definition list line numbers are fixed,
* `frontend.filter_settings_spec` is not suited to filter command line options
that don't apply,
* the `--section-numbering` command line option is implemented,
* front-end tools will accept more than one source document in Docutils 2.0
(see RELEASE-NOTES).
Modified Paths:
--------------
trunk/docutils/FAQ.rst
trunk/docutils/RELEASE-NOTES.rst
trunk/docutils/docs/api/transforms.rst
trunk/docutils/docs/dev/rst/alternatives.rst
trunk/docutils/docs/dev/todo.rst
trunk/docutils/docs/eps/ep-001.rst
trunk/docutils/docs/ref/rst/directives.rst
trunk/docutils/docutils/parsers/rst/include/html-roles.txt
Modified: trunk/docutils/FAQ.rst
===================================================================
--- trunk/docutils/FAQ.rst 2025-04-27 20:43:12 UTC (rev 10112)
+++ trunk/docutils/FAQ.rst 2025-04-29 20:36:06 UTC (rev 10113)
@@ -690,6 +690,16 @@
:A: Answer.
+How can I mark up a TODO list?
+------------------------------
+
+You may use a field list with class argument and some CSS styling.
+For an example see `Docutils TODO lists`_ and its source todo-lists.rst_.
+
+.. _Docutils TODO lists: docs/user/todo-lists.html
+.. _todo-lists.rst: docs/user/todo-lists.rst
+
+
.. _bidi:
Can I produce documents in right-to-left languages?
@@ -809,16 +819,6 @@
.. [#] The "x-" prefix means it's an unregistered MIME type.
-How can I mark up a TODO list?
-------------------------------
-
-You may use a field list with class argument and some CSS styling.
-For an example see `Docutils TODO lists`_ and its source todo-lists.rst_.
-
-.. _Docutils TODO lists: docs/user/todo-lists.html
-.. _todo-lists.rst: docs/user/todo-lists.rst
-
-
How can I specify an image grid?
--------------------------------
Modified: trunk/docutils/RELEASE-NOTES.rst
===================================================================
--- trunk/docutils/RELEASE-NOTES.rst 2025-04-27 20:43:12 UTC (rev 10112)
+++ trunk/docutils/RELEASE-NOTES.rst 2025-04-29 20:36:06 UTC (rev 10113)
@@ -40,8 +40,6 @@
For the rationale, see https://clig.dev/#arguments-and-flags.
-.. _entry points:
- https://packaging.python.org/en/latest/specifications/entry-points/
Document Tree / Docutils DTD
----------------------------
@@ -314,7 +312,7 @@
`utils.Reporter.set_conditions()`
obsolete, set attributes via configuration settings or directly.
-Removed localisations:
+Removed localisations
Mistranslations of the "admonition" directive name:
Use "advies" (af), "varsel" (da), "warnhinweis" (de), "aviso" (es),
"sciigo" (eo), "annonce" (fr), "avviso" (it), "advies" (nl),
@@ -321,6 +319,10 @@
"zauważenie" (pl) (introduced in Docutils 0.21)
or the English name "admonition".
+New files
+ ``docutils/parsers/rst/include/html-roles.txt``
+ `Standard definition file`_ for additional roles matching HTML tags.
+
Removed files
``tools/rst2odt_prepstyles.py``
Obsoleted by `writers.odf_odt.prepstyles`.
@@ -367,12 +369,14 @@
- Use ``python -m docutils.writers.odf_odt.prepstyles``
to `strip the page size`__ from an ODT writer stylesheet.
- __ docs/user/odt.html#page-size
-
.. [#] Some Linux distributions already use the short names.
.. [#] The final rendering is done by a Sphinx-based build system
(cf. :PEP:`676`).
+ .. _entry points:
+ https://packaging.python.org/en/latest/specifications/entry-points/
+ __ docs/user/odt.html#page-size
+
* reStructuredText:
- Use the same CSV format for the ``:header:`` option and the main data
@@ -1424,6 +1428,7 @@
docs/ref/rst/directives.html#including-an-external-document-fragment
.. _"widths" option: docs/ref/rst/directives.html#table
+.. _Standard definition file: docs/ref/rst/definitions.html
.. _LaTeX syntax for mathematics: docs/ref/rst/mathematics.html
.. _configuration settings: docs/user/config.html
Modified: trunk/docutils/docs/api/transforms.rst
===================================================================
--- trunk/docutils/docs/api/transforms.rst 2025-04-27 20:43:12 UTC (rev 10112)
+++ trunk/docutils/docs/api/transforms.rst 2025-04-29 20:36:06 UTC (rev 10113)
@@ -216,7 +216,9 @@
Transforms Reference
====================
-Incomplete. See also `Transforms Listed in Priority Order`_
+.. Note:: This section is still incomplete.
+
+See also `Transforms Listed in Priority Order`_
and the sources in `docutils/transforms`__.
__ https://docutils.sourceforge.io/docutils/transforms/
Modified: trunk/docutils/docs/dev/rst/alternatives.rst
===================================================================
--- trunk/docutils/docs/dev/rst/alternatives.rst 2025-04-27 20:43:12 UTC (rev 10112)
+++ trunk/docutils/docs/dev/rst/alternatives.rst 2025-04-29 20:36:06 UTC (rev 10113)
@@ -254,6 +254,25 @@
Syntax #3 was chosen for reStructuredText.
+``term`` Role
+=============
+
+Add a "term" role for unfamiliar or specialized terminology?
+Probably not as a standard role; there is no real use case, and emphasis
+is enough for most cases.
+For semantic markup, authors may define a `custom role`_ or include the
+"html-roles.txt" `standard definition file`_ that defines (`amongst
+others`__) the "dfn" role (the "html5" writer selects the corresponding
+`HTML <dfn> element`_).
+
+.. _custom role: ../../ref/rst/directives.html#role
+.. _standard definition file: ../../ref/rst/definitions.html
+__ ../../ref/rst/definitions.html#additional-roles-for-html
+.. _HTML <dfn> element:
+ https://html.spec.whatwg.org/multipage/text-level-semantics.html
+ #the-dfn-element
+
+
Comments
========
@@ -2740,8 +2759,11 @@
Literal block?
Hmm... Non-strict indentation isn't such a good idea.
+Except for `field lists`_.
+.. _field lists: ../../ref/rst/restructuredtext.html#field-lists
+
Lazy Indentation of List Items
==============================
@@ -3010,15 +3032,9 @@
A "unicode" directive has been implemented to allow direct
specification of esoteric characters. In combination with the
-substitution construct, "include" files defining common sets of
-character entities can be defined and used. `A set of character
-entity set definition files have been defined`__ (`tarball`__).
-There's also `a description and instructions for use`__.
+substitution construct, `standard definition files`_ for common
+sets of character entities are provided for inclusion.
-__ https://docutils.sourceforge.io/tmp/charents/
-__ https://docutils.sourceforge.io/tmp/charents.tgz
-__ https://docutils.sourceforge.io/tmp/charents/README.html
-
To allow for `character-level inline markup`_, a limited form of
character processing has been added to the spec and parser: escaped
whitespace characters are removed from the processed document. Any
@@ -3025,6 +3041,7 @@
further character processing will be of this functional type, rather
than of the character-encoding type.
+.. _standard definition files: ../../ref/rst/definitions.html
.. _character-level inline markup:
../../ref/rst/restructuredtext.html#character-level-inline-markup
@@ -3109,7 +3126,7 @@
However, superscripts are seldom needed, and new syntax would break
existing documents. When it's needed, the ``:superscript:``
-(``:sup:``) role can we used as well.
+(``:sup:``) role can be used as well.
Code Execution
@@ -3164,18 +3181,20 @@
required to associate annotations with the original text (by name, or
positionally as in anonymous targets?).
-There have not been many requests for such feature, though. Also,
+There have not been many requests for such feature, though. [#]_ Also,
cluttering WYSIWYG plaintext with annotations may not seem like a good
-idea, and there is no "tool tip" in formats other than HTML.
+idea, and there is no "tool tip" in formats other than HTML. [#]_
+.. [#] But see the `feature-request ticket #108`__.
-``term`` Role
-=============
+.. [#] As of 2025, there are also annotations in the output formats
+ OpenDocument and PDF/LaTeX (the LaTeX package "pdfcomment" provides a
+ \pdftooltip macro that creates pop-ups in PDF output).
-Add a "term" role for unfamiliar or specialized terminology? Probably
-not; there is no real use case, and emphasis is enough for most cases.
+ __ https://sourceforge.net/p/docutils/feature-requests/108/
+
Object references
=================
Modified: trunk/docutils/docs/dev/todo.rst
===================================================================
--- trunk/docutils/docs/dev/todo.rst 2025-04-27 20:43:12 UTC (rev 10112)
+++ trunk/docutils/docs/dev/todo.rst 2025-04-29 20:36:06 UTC (rev 10113)
@@ -65,10 +65,10 @@
Move to a Git repository.
-* This is a long standing `feature request`__
- (with pointers to Sphinx issues and discussion).
+See `feature requests #58`__
+(with pointers to Sphinx issues and discussion).
- __ https://sourceforge.net/p/docutils/feature-requests/58/
+__ https://sourceforge.net/p/docutils/feature-requests/58/
* From a `post by David Goodger`__
@@ -111,8 +111,8 @@
Sourceforge supports multiple Git repositories per project, so we can
switch the version control system independent of the decision on an
-eventual switch of the host.
-Cf. https://sourceforge.net/p/forge/documentation/Git/
+eventual switch of the host
+(cf. https://sourceforge.net/p/forge/documentation/Git/).
General
@@ -516,11 +516,6 @@
.. _traits: http://code.enthought.com/traits/
.. _SciPy: http://www.scipy.org/
-* tools/buildhtml.py: Extend the --prune option ("prune" config
- setting) to accept file names (generic path) in addition to
- directories (e.g. --prune=docs/user/rst/cheatsheet.rst, which should
- *not* be converted to HTML).
-
* Add support for _`plugins`.
* _`Config directories`: Currently, ~/.docutils, ./docutils.conf/, &
@@ -673,7 +668,7 @@
they do.
* Document the transforms_ (perhaps in docstrings?): how they're used,
- what they do, dependencies & order considerations.
+ what they do, dependencies & order considerations. In progress.
* Document the HTML classes used by html4css1.py.
@@ -833,16 +828,11 @@
__ rst/alternatives.html#or-not-to-do
-Bugs
-----
-* A container directive with ``:class:`` option gets the spurious
- class value "class".
-
Misc
----
-* Another list problem::
+* A list problem::
* foo
* bar
@@ -1146,40 +1136,17 @@
(explicitly), just implicitly/automatically. See rev. 1.74 of
docutils/parsers/rst/states.py for an example of how to set.
- - The line numbers of definition list items are wrong::
+ - See also `feature requests #41`__
- $ rst2pseudoxml --expose-internal-attribute line
- 1
- 2
- 3
+ __ https://sourceforge.net/p/docutils/feature-requests/41/
- 5
- 6
- 7
+* Unprintable characters like NULL in the rST source are in most cases
+ an indication of a problem (corrupt source file, wrong encoding, ...).
+ The same goes for combining characters at the start of a line, etc.
+ It may be helpful, if Docutils issued a Warning for problematic
+ characters in the source (except for literals).
- <document source="<stdin>">
- <definition_list>
- <definition_list_item internal:line="3">
- <term>
- 1
- <definition>
- <paragraph internal:line="2">
- 2
- 3
- <definition_list_item internal:line="6">
- <term>
- 5
- <definition>
- <paragraph internal:line="6">
- 6
- 7
-* .. _none source:
-
- Quite a few nodes are getting a "None" source attribute as well. In
- particular, see the bodies of definition lists.
-
-
Adaptable file extensions
-------------------------
@@ -1337,15 +1304,11 @@
Math Markup
-----------
-Since Docutils 0.8, a "math" role and directive using LaTeX math
-syntax as input format is part of reStructuredText.
+* Use a "Transform" for math format conversions as extensively discussed
+ in the `math directive issues`__ thread in May 2008?
-Open issues:
+ __ http://osdir.com/ml/text.docutils.devel/2008-05/threads.html
-* Use a "Transform" for math format conversions as extensively discussed in
- the "math directive issues" thread in May 2008
- (http://osdir.com/ml/text.docutils.devel/2008-05/threads.html)?
-
* Generic `math-output setting`_ (currently specific to HTML).
(List of math-output preferences?)
@@ -1501,15 +1464,7 @@
.. _Hevea: http://para.inria.fr/~maranget/hevea/
.. _KaTeX: https://katex.org
-client side JavaScript conversion
- Use TeX notation in the web page and JavaScript in the displaying browser.
- (implemented as `math-output setting`_ "mathjax").
- * jqMath_ (faster and lighter than MathJax_)
-
- .. _MathJax: http://www.mathjax.org/
- .. _jqMath: http://mathscribe.com/author/jqmath.html
-
OpenOffice output
`````````````````
@@ -2034,15 +1989,6 @@
[DG 2017-01-02:] +0.
- Discussion
- The syntax could be left in reST (for a set period of time?).
-
- [DG 2017-01-02:] The syntax must be left in reST, practically
- forever. Removing it would introduce a huge backwards
- incompatibility. Any syntax removal must be preceded by a thorough
- review and planning, including a deprecation warning process. My
- opinion: it's not worth it.
-
* "Normalize" special admonitions (note, hint, warning, ...) during parsing
(similar to _`transforms.writer_aux.Admonitions`). There is no need to
keep them as distinct elements in the doctree specification.
@@ -2059,8 +2005,8 @@
+1 reduce the complexity of the doctree
(there is no 1:1 rST syntax element <-> doctree node mapping anyway).
- +2 every writer needs 9 visit_*/depart_* method pairs to handle the 9
- subtypes of an admonition, i.e. we could but also remove 36 redundant
+ +1 every writer needs 9 visit_*/depart_* method pairs to handle the 9
+ subtypes of an admonition, i.e. we could remove 72 redundant
methods (HTML, LaTeX, Manpage, ODF).
-1 the most unfortunately named of these directives will survive. [#]_
@@ -2234,7 +2180,7 @@
omitting ``<p>`` tags. List compacting would need to be done by
adjusting CSS margins instead.
- :2015-04-02: The new html writer no longer strips <p> tags but adds the
+ :2015-04-02: The "html5" writer no longer strips <p> tags but adds the
class value ``simple`` to the list.
Formatting is done by CSS --- configurable by a custom style
sheet.
@@ -2250,7 +2196,7 @@
If the first item of a field body is not a paragraph,
it would begin on the following line.
- :2015-04-02: The new html writer writes field-lists as definition lists
+ :2015-04-02: The "html5" writer writes field-lists as definition lists
with class ``field-list``.
Formatting is done by CSS --- configurable by a custom style
sheet. The default style sheet has some examples, including a
@@ -2396,6 +2342,7 @@
.. _latex-variants:
../../../sandbox/latex-variants/README.html
+
Bug fixes
---------
@@ -2431,6 +2378,7 @@
+ pointers to advanced packages and their use in the `latex writer
documentation`_.
+
Configurable placement of figure and table floats
`````````````````````````````````````````````````
@@ -2523,6 +2471,7 @@
.. _enumitem: https://www.ctan.org/pkg/enumitem
+
Default layout
--------------
@@ -2558,6 +2507,7 @@
.. _compound paragraph:
../ref/rst/directives.html#compound-paragraph
+
Tables
``````
@@ -2613,6 +2563,7 @@
table title. In analogy to the 'figure' directive this should map to a
table float.
+
Image and figure directives
```````````````````````````
@@ -2646,8 +2597,6 @@
a figure in LaTeX is 100 % of the text width, setting the 'align'
argument has currently no effect on the LaTeX output.
-* Multiple author entries in docinfo (same thing as in html).
-
* Consider supporting the "compact" option and class argument (from
rst2html) as some lists look better compact and others need the space.
@@ -2757,8 +2706,6 @@
--stylesheet-path second.css ...
-
-
Front-End Tools
===============
@@ -2766,20 +2713,12 @@
initialize ``settings_spec`` in ``__init__`` or ``init_options``?
* Disable common options that don't apply?
- (This should now be easier with ``frontend.filter_settings_spec``.)
-* Add ``--section-numbering`` command line option. The "sectnum"
- directive should override the ``--no-section-numbering`` command
- line option then.
+* Implement the following suggestion from clig.dev?
-* Implement the following suggestions from clig.dev?
-
Display output on success, but keep it brief.
provide a --quiet option to suppress all non-essential output.
- Consider chaining several args as input and use --output
- (or redirection) for output.
-
-- https://clig.dev/#help
.. _partial parsing:
Modified: trunk/docutils/docs/eps/ep-001.rst
===================================================================
--- trunk/docutils/docs/eps/ep-001.rst 2025-04-27 20:43:12 UTC (rev 10112)
+++ trunk/docutils/docs/eps/ep-001.rst 2025-04-29 20:36:06 UTC (rev 10113)
@@ -244,6 +244,9 @@
.. Link to any existing implementation and details about its state, e.g.
proof-of-concept.
+Since 2025-04-29, enhancement proposals are available as part of the
+Docutils Documentation under https://docutils.sourceforge.io/docs/eps/.
+
The sandbox_ contains a directory for
`enhancement proposals in "pre-draft" stage`_.
Modified: trunk/docutils/docs/ref/rst/directives.rst
===================================================================
--- trunk/docutils/docs/ref/rst/directives.rst 2025-04-27 20:43:12 UTC (rev 10112)
+++ trunk/docutils/docs/ref/rst/directives.rst 2025-04-29 20:36:06 UTC (rev 10113)
@@ -395,6 +395,7 @@
``figname`` : text_
Add *text* to the `names attribute`_ of the <figure> element
(the "name_" option is applied to the nested <image>).
+ New in Docutils 0.22.
``figwidth`` : "image", length_, or percentage_ of current line width
The width of the figure.
Modified: trunk/docutils/docutils/parsers/rst/include/html-roles.txt
===================================================================
--- trunk/docutils/docutils/parsers/rst/include/html-roles.txt 2025-04-27 20:43:12 UTC (rev 10112)
+++ trunk/docutils/docutils/parsers/rst/include/html-roles.txt 2025-04-29 20:36:06 UTC (rev 10113)
@@ -1,4 +1,4 @@
-.. Standard definition file for additonal roles matching HTML tags.
+.. Standard definition file for additional roles matching HTML tags.
:Copyright: © 2025 Günter Milde.
:License: Released under the terms of the
This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site.
|
|
From: <mi...@us...> - 2025-04-30 15:16:24
|
Revision: 10114
http://sourceforge.net/p/docutils/code/10114
Author: milde
Date: 2025-04-30 15:16:04 +0000 (Wed, 30 Apr 2025)
Log Message:
-----------
Documentation update.
Smaller formatting issues.
config.rst
Add [manpage writer] section.
Document aliases for 3rd-party markdown parsers.
Add cross-links.
Modified Paths:
--------------
trunk/docutils/HISTORY.rst
trunk/docutils/docs/user/config.rst
Modified: trunk/docutils/HISTORY.rst
===================================================================
--- trunk/docutils/HISTORY.rst 2025-04-29 20:36:06 UTC (rev 10113)
+++ trunk/docutils/HISTORY.rst 2025-04-30 15:16:04 UTC (rev 10114)
@@ -218,8 +218,7 @@
* docutils/writers/manpage.py
- Remove code for unused emdash bullets.
- - Feature-request #105 more informative document comments.
- docutils version in header
+ - Print Docutils version in header comment (feature-request #105).
- Stop converting text to full capitals (bug #481).
- Add module function insert_URI_breakpoints.
- Add command line option ``--macro-references``/``--text-references``
Modified: trunk/docutils/docs/user/config.rst
===================================================================
--- trunk/docutils/docs/user/config.rst 2025-04-29 20:36:06 UTC (rev 10113)
+++ trunk/docutils/docs/user/config.rst 2025-04-30 15:16:04 UTC (rev 10114)
@@ -838,7 +838,7 @@
~~~~~~~~~~~~~~
Recognize and link to standalone PEP references (like "PEP 258").
-:Default: None (disabled); True in PEP Reader.
+:Default: None (disabled); True in the `PEP Reader`_.
:Option: ``--pep-references``.
pep_base_url
@@ -859,7 +859,7 @@
~~~~~~~~~~~~~~
Recognize and link to standalone RFC references (like "RFC 822").
-:Default: None (disabled); True in PEP Reader.
+:Default: None (disabled); True in the `PEP Reader`_.
:Option: ``--rfc-references``.
rfc_base_url
@@ -959,9 +959,11 @@
Parser for Markdown (CommonMark_) with rST-compatibility extensions
provided by the 3rd party package `myst-docutils`_.
-See `MyST with Docutils`_ and MyST's `Sphinx configuration options`_
-(some settings are not applicable with Docutils).
+See `MyST with Docutils`_ and MyST's `Sphinx configuration options`_.
+(Some settings are not applicable with Docutils,
+``docutils --parser=myst --help`` shows available options.)
+.. _CommonMark: https://spec.commonmark.org/current/
.. _myst-docutils: https://pypi.org/project/myst-docutils/
.. _MyST with Docutils:
https://myst-parser.readthedocs.io/en/latest/docutils.html
@@ -1041,13 +1043,20 @@
:Options: ``--section-subtitles``, ``--no-section-subtitles``.
+.. _PEP Reader:
+
[pep reader]
------------
-The `pep_references`_ and `rfc_references`_ settings
-(`[restructuredtext parser]`_) are set on by default.
+Writer Specific Defaults
+~~~~~~~~~~~~~~~~~~~~~~~~
+.. class:: run-in
+:`pep_references`_: True
+:`rfc_references`_: True
+
+
.. [python reader]
---------------
@@ -2086,6 +2095,18 @@
__ `template [latex writers]`_
+[manpage writer]
+----------------
+
+The `manpage writer`_ generates documents in the "roff" format
+for processing into UNIX `manual pages`_ with mandoc_ or groff_.
+
+.. _manpage Writer: manpage.html
+.. _manual pages: https://en.wikipedia.org/wiki/Man_page
+.. _mandoc: http://mandoc.bsd.lv/
+.. _groff: https://gnu.org/software/groff/
+
+
.. _ODF/ODT Writer:
[odf_odt writer]
@@ -2334,8 +2355,9 @@
Docutils' `generic front end`_ tool allows combining "reader", "parser",
and "writer" components from the Docutils package or 3rd party plug-ins.
-| New in 0.17. Config file support added in 0.18. Renamed in 0.19
- (the old section name "docutils-cli application" is kept as alias).
+| New in 0.17. Config file support added in 0.18.
+| Renamed in 0.19 (the old section name "docutils-cli application"
+ is kept as alias).
| Support for reader/parser import names added in 0.19.
.. _generic front end: tools.html#generic-command-line-front-end
@@ -2352,16 +2374,17 @@
~~~~~~
Parser component name.
Either "`rst <[restructuredtext parser]_>`__", "`xml <[xml parser]_>`__",
-or the import name of a plug-in parser module.
+or the import name of a plug-in parser module. [#]_
-Parsers for CommonMark_ known to work with Docutils include
-"`pycmark <[pycmark parser]_>`__", "`myst <[myst parser]_>`__",
-and "`recommonmark <[recommonmark parser]_>`__".
-
*Default*: "rst".
*Option*: ``--parser``
-.. _CommonMark: https://spec.commonmark.org/current/
+.. [#] Docutils recognizes the aliases
+ "`pycmark <[pycmark parser]_>`__", "`myst <[myst parser]_>`__",
+ and "`recommonmark <[recommonmark parser]_>`__" and selects the
+ corresponding 3rd-party Markdown parser (if it is installed).
+ The aliases "markdown" and "commonmark" select the first available
+ parser from this list.
.. _writer [docutils application]:
This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site.
|
|
From: <gr...@us...> - 2025-05-01 09:32:48
|
Revision: 10116
http://sourceforge.net/p/docutils/code/10116
Author: grubert
Date: 2025-05-01 09:32:29 +0000 (Thu, 01 May 2025)
Log Message:
-----------
code/comment cleanup
Modified Paths:
--------------
trunk/docutils/docutils/writers/manpage.py
trunk/docutils/test/functional/expected/standalone_rst_manpage.man
trunk/docutils/test/test_writers/test_manpage.py
Modified: trunk/docutils/docutils/writers/manpage.py
===================================================================
--- trunk/docutils/docutils/writers/manpage.py 2025-05-01 09:30:28 UTC (rev 10115)
+++ trunk/docutils/docutils/writers/manpage.py 2025-05-01 09:32:29 UTC (rev 10116)
@@ -121,12 +121,11 @@
None,
(('Use man macros .UR/.UE and .MT/.ME for references ',
['--macro-references'],
- {'dest': 'use_reference_macros',
- 'default': False, 'action': 'store_true',
+ {'default': False, 'action': 'store_true',
'validator': frontend.validate_boolean}),
('Put references in plain text form.',
['--text-references'],
- {'dest': 'use_reference_macros',
+ {'dest': 'macro_references',
'action': 'store_false',
'validator': frontend.validate_boolean}),
),
@@ -213,14 +212,14 @@
words_and_spaces = re.compile(r'\S+| +|\n')
possibly_a_roff_command = re.compile(r'\.\w')
document_start = (
- 'Man page generated from reStructuredText by manpage writer\n'
- f'from docutils {docutils.__version__}.'
+ 'Man page generated from reStructuredText\n'
+ f'by the Docutils {docutils.__version__} manpage writer.'
)
def __init__(self, document) -> None:
nodes.NodeVisitor.__init__(self, document)
self.settings = settings = document.settings
- if settings.use_reference_macros:
+ if settings.macro_references:
self.visit_reference = self._visit_reference_with_macro
self.depart_reference = self._depart_reference_with_macro
else:
Modified: trunk/docutils/test/functional/expected/standalone_rst_manpage.man
===================================================================
--- trunk/docutils/test/functional/expected/standalone_rst_manpage.man 2025-05-01 09:30:28 UTC (rev 10115)
+++ trunk/docutils/test/functional/expected/standalone_rst_manpage.man 2025-05-01 09:32:29 UTC (rev 10116)
@@ -1,5 +1,5 @@
-.\" Man page generated from reStructuredText by manpage writer
-.\" from docutils 0.22b.dev.
+.\" Man page generated from reStructuredText
+.\" by the Docutils 0.22b.dev manpage writer.
.
.
.nr rst2man-indent-level 0
Modified: trunk/docutils/test/test_writers/test_manpage.py
===================================================================
--- trunk/docutils/test/test_writers/test_manpage.py 2025-05-01 09:30:28 UTC (rev 10115)
+++ trunk/docutils/test/test_writers/test_manpage.py 2025-05-01 09:32:29 UTC (rev 10116)
@@ -55,6 +55,7 @@
settings_overrides={
'_disable_config': True,
'strict_visitor': True,
+ 'use_reference_macros': False,
}).decode()
self.assertEqual(case_expected, output)
@@ -68,8 +69,9 @@
settings_overrides={
'_disable_config': True,
'strict_visitor': True,
- 'use_reference_macros': True,
- }).decode()
+ 'macro_references': True,
+ 'output_encoding': "unicode",
+ })
self.assertEqual(case_expected, output)
def test_system_msgs(self):
@@ -85,7 +87,8 @@
'strict_visitor': True,
'report_level': 1,
'warning_stream': warnings,
- }).decode()
+ 'output_encoding': "unicode",
+ })
self.assertEqual(case_expected, output)
warnings.seek(0)
self.assertEqual(
@@ -93,8 +96,8 @@
warnings.readlines())
-document_start = r""".\" Man page generated from reStructuredText by manpage writer
-.\" from docutils 0.22b.dev.
+document_start = r""".\" Man page generated from reStructuredText
+.\" by the Docutils 0.22b.dev manpage writer.
.
"""
This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site.
|
|
From: <mi...@us...> - 2025-05-05 13:52:14
|
Revision: 10120
http://sourceforge.net/p/docutils/code/10120
Author: milde
Date: 2025-05-05 13:51:57 +0000 (Mon, 05 May 2025)
Log Message:
-----------
Documentation and formatting fixes (includes renaming of a config setting).
Rename settings variable "macro_references" to the match the (future)
non-standard behaviour "text_references". Command line options remain as-is.
Announce change of "text_references" to False in Docutils 1.0.
Add `writers.manpage.Writer.config_section_dependencies` so that
entries in section [manpage writer] override entries in section [writer].
Fix flake8 issues in manpage.py
Adapt tests.
Fix links and typos. Small edits for easier reading.
Modified Paths:
--------------
trunk/docutils/HISTORY.rst
trunk/docutils/RELEASE-NOTES.rst
trunk/docutils/docs/user/config.rst
trunk/docutils/docutils/writers/manpage.py
trunk/docutils/test/test_writers/test_manpage.py
Modified: trunk/docutils/HISTORY.rst
===================================================================
--- trunk/docutils/HISTORY.rst 2025-05-01 10:01:14 UTC (rev 10119)
+++ trunk/docutils/HISTORY.rst 2025-05-05 13:51:57 UTC (rev 10120)
@@ -48,7 +48,7 @@
- Drop short options ``-i`` and ``-o`` for ``--input-encoding``
and ``--output-encoding``.
- Change the default input encoding from ``None`` (auto-detect) to "utf-8".
- - Change the default value of the _root_prefix setting to the empty string
+ - Change the default value of the root_prefix_ setting to the empty string
(no change to the behaviour).
* docutils/io.py
@@ -86,7 +86,7 @@
* docutils/parsers/rst/languages/
- - Removed mistranslations of the "admonition" directive name.
+ - Remove mistranslations of the "admonition" directive name.
* docutils/parsers/rst/directives/__init__.py
@@ -156,7 +156,7 @@
* docutils/utils/_roman_numerals.py
- New implementation or Roman numeral support.
- Replaces the local copy of docutils/utils/roman.py.
+ Replaces the local copy of the roman.py package.
* docutils/utils/error_reporting.py
@@ -220,10 +220,11 @@
- Remove code for unused emdash bullets.
- Print Docutils version in header comment (feature-request #105).
- Stop converting text to full capitals (bug #481).
- - Add module function insert_URI_breakpoints.
- - Add command line option ``--macro-references``/``--text-references``
- to enable/disable usage of *man* macros .UR/.UE.
- - Proper reference output.
+ - Fix reference output (bug #497).
+ - Use macros .UR/.UE for hyperlink references unless the new
+ configuration setting text_references_ is True.
+ The current default is True (text references), it will change
+ to False (macro references) in Docutils 1.0.
* docutils/writers/null.py
@@ -4669,6 +4670,7 @@
.. _stylesheet_path: docs/user/config.html#stylesheet-path
.. _syntax_highlight: docs/user/config.html#syntax-highlight
.. _table_style: docs/user/config.html#table-style
+.. _text_references: docs/user/config.html#text_references
.. _theme: docs/user/config.html#theme
.. _theme_url: docs/user/config.html#theme-url
.. _toc_backlinks: docs/user/config.html#toc-backlinks
Modified: trunk/docutils/RELEASE-NOTES.rst
===================================================================
--- trunk/docutils/RELEASE-NOTES.rst 2025-05-01 10:01:14 UTC (rev 10119)
+++ trunk/docutils/RELEASE-NOTES.rst 2025-05-05 13:51:57 UTC (rev 10120)
@@ -115,6 +115,10 @@
__ docs/user/latex.html#length-units
+* "manpage" writer:
+
+ - Change default of the text_references_ setting to False in Docutils 1.0.
+
* "odt" writer:
- Align adjustment of relative image paths with the behaviour of HTML
@@ -247,6 +251,9 @@
- Rename configuration setting "output" to "output_path_".
+ - The manpage writer now recognizes the sections [writers] and
+ [manpage writer] with the new setting `text_references`_.
+
Output changes
LaTeX:
Don't wrap references with custom reference-label_ in a ``\hyperref``
@@ -266,6 +273,7 @@
manpage:
Don't UPPERCASE section headings.
+ Handle hyperlink references (see text_references_).
null:
The "null" writer output changed from None to the empty string.
@@ -1444,6 +1452,7 @@
.. _input_encoding: docs/user/config.html#input-encoding
.. _[latex writers]: docs/user/config.html#latex-writers
.. _legacy_column_widths: docs/user/config.html#legacy-column-widths
+.. _text_references: docs/user/config.html#text-references
.. _math_output: docs/user/config.html#math-output
.. _old-format configuration files:
docs/user/config.html#old-format-configuration-files
Modified: trunk/docutils/docs/user/config.rst
===================================================================
--- trunk/docutils/docs/user/config.rst 2025-05-01 10:01:14 UTC (rev 10119)
+++ trunk/docutils/docs/user/config.rst 2025-05-05 13:51:57 UTC (rev 10120)
@@ -2098,29 +2098,32 @@
[manpage writer]
----------------
-The `manpage writer`_ generates documents in the "roff" format
-for processing into UNIX `manual pages`_ with mandoc_ or groff_.
+The `manpage writer`_ generates documents in the roff_ markup language
+for processing into UNIX `manual pages`_ with, e.g., mandoc_ or groff_.
.. _manpage Writer: manpage.html
+.. _roff: https://en.wikipedia.org/wiki/Roff_(software)
.. _manual pages: https://en.wikipedia.org/wiki/Man_page
.. _mandoc: http://mandoc.bsd.lv/
.. _groff: https://gnu.org/software/groff/
-macro-references
+text_references
~~~~~~~~~~~~~~~~
-Output man-macros ``.UR``/``.UE`` for uri references
-and ``.MT``/``.ME`` for email-addresses.
-If False rendering of references is done by the manpage writer.
+Use a text rendering instead of the macros ``UR`` and ``MT`` for
+reference targets (URI references and email addresses).
+Some systems (e.g. Solaris troff) do not support these macros.
+Text references also prevent problems when groff_ is used on a
+terminal emulator that does not `support OSC8 sequences`__
+(alternatively, call groff_ with the option `-rU0`__).
-The option exists because 2024 or so, the man macros began to support
-OSC8 terminals, that became more available. But not everyone, every
-system supports OSC8, e.g. mandoc_ macros do not output OSC8.
+:Default: True (will change to False in Docutils 1.0).
+:Options: ``--macro-references``, ``--text-references``.
-:Default: False. ... will be True ... soon.
-:Options: ``--macro-references`` to set True, ``--text-references`` to set
- False.
+__ https://github.com/Alhadis/OSC8-Adoption/
+__ https://www.man7.org/linux/man-pages/man7/groff_man.7.html#Options
+
.. _ODF/ODT Writer:
[odf_odt writer]
Modified: trunk/docutils/docutils/writers/manpage.py
===================================================================
--- trunk/docutils/docutils/writers/manpage.py 2025-05-01 10:01:14 UTC (rev 10119)
+++ trunk/docutils/docutils/writers/manpage.py 2025-05-05 13:51:57 UTC (rev 10120)
@@ -17,7 +17,7 @@
7 miscellaneous
8 system administration
-Man pages are written *troff*, a text file formatting system.
+Man pages are written in the *roff* markup language.
See https://www.tldp.org/HOWTO/Man-Page for a start.
@@ -104,7 +104,8 @@
def insert_URI_breakpoints(s):
# TODO only for long URIs ?
- return NONBREAKING_INSERT_RE2.sub(r'\1' + NONPRINTING_BREAKPOINT,
+ return NONBREAKING_INSERT_RE2.sub(
+ r'\1' + NONPRINTING_BREAKPOINT,
NONBREAKING_INSERT_RE.sub(r'\1' + NONPRINTING_BREAKPOINT, s))
@@ -117,20 +118,23 @@
"""Formats this writer supports."""
settings_spec = (
- 'Manpage-Specific Options',
+ 'Manpage Writer Options',
None,
- (('Use man macros .UR/.UE and .MT/.ME for references ',
+ (('Write references in plain text form. (default)',
+ ['--text-references'],
+ {'action': 'store_true',
+ 'default': True, # remove in Docutils 1.0
+ 'validator': frontend.validate_boolean}),
+ ('Use man macros UR and MT for references.',
['--macro-references'],
- {'default': False, 'action': 'store_true',
- 'validator': frontend.validate_boolean}),
- ('Put references in plain text form.',
- ['--text-references'],
- {'dest': 'macro_references',
+ {'dest': 'text_references',
'action': 'store_false',
'validator': frontend.validate_boolean}),
),
)
+ config_section_dependencies = ('writers',)
+
output = None
"""Final translated form of `document`."""
@@ -219,12 +223,12 @@
def __init__(self, document) -> None:
nodes.NodeVisitor.__init__(self, document)
self.settings = settings = document.settings
- if settings.macro_references:
+ if settings.text_references:
+ self.visit_reference = self._visit_reference_no_macro
+ self.depart_reference = self._depart_reference_no_macro
+ else:
self.visit_reference = self._visit_reference_with_macro
self.depart_reference = self._depart_reference_with_macro
- else:
- self.visit_reference = self._visit_reference_no_macro
- self.depart_reference = self._depart_reference_no_macro
lcode = settings.language_code
self.language = languages.get_language(lcode, document.reporter)
self.head = []
@@ -238,8 +242,7 @@
self.compact_simple = None
# the list style "*" bullet or "#" numbered
self._list_char = []
- # writing the header .TH and .SH Name is postboned after
- # docinfo.
+ # writing the header .TH and .SH Name is postponed after docinfo.
self._docinfo = {
"title": "",
"subtitle": "",
@@ -352,13 +355,13 @@
):
self.body[i] = '.\n'
elif self.body[i][:4] in ('.UE\n', '.ME\n'):
- # if next item starts with
+ # if next item starts with
# a) a line end, disable it
if self.body[i+1][0] in ('\n', '\r'):
self.body[i+1] = '.' + self.body[i+1]
# b) with a separator: move the 1st char to current item
else:
- self.body[i] = "%s \\c\n" % ( self.body[i][:3])
+ self.body[i] = "%s \\c\n" % (self.body[i][:3])
return ''.join(self.head + self.body + self.foot)
def deunicode(self, text):
@@ -1108,16 +1111,17 @@
def _depart_reference_no_macro(self, node) -> None:
if 'refuri' in node:
- self.body.append(r" \%%<%s>" % insert_URI_breakpoints(node['refuri']))
+ self.body.append(r" \%%<%s>"
+ % insert_URI_breakpoints(node['refuri']))
# elif 'refid' in node:
def _visit_reference_with_macro(self, node) -> None:
# use UR/UE or MT/ME
if 'refuri' in node:
- self.ensure_c_eol() # c_eol avoids space before the refuri
+ self.ensure_c_eol() # c_eol avoids space before the refuri
_uri = node['refuri']
if _uri.startswith('mailto:'):
- _uri = _uri[7:] # remove "mailto:"
+ _uri = _uri[7:] # remove "mailto:"
# groff macro in an.tmac adds "mailto:"
# mandoc does not.
self.body.append(".MT ")
Modified: trunk/docutils/test/test_writers/test_manpage.py
===================================================================
--- trunk/docutils/test/test_writers/test_manpage.py 2025-05-01 10:01:14 UTC (rev 10119)
+++ trunk/docutils/test/test_writers/test_manpage.py 2025-05-05 13:51:57 UTC (rev 10120)
@@ -55,7 +55,6 @@
settings_overrides={
'_disable_config': True,
'strict_visitor': True,
- 'use_reference_macros': False,
}).decode()
self.assertEqual(case_expected, output)
@@ -69,7 +68,7 @@
settings_overrides={
'_disable_config': True,
'strict_visitor': True,
- 'macro_references': True,
+ 'text_references': False,
'output_encoding': "unicode",
})
self.assertEqual(case_expected, output)
This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site.
|
|
From: <gr...@us...> - 2025-05-06 17:03:51
|
Revision: 10122
http://sourceforge.net/p/docutils/code/10122
Author: grubert
Date: 2025-05-06 17:03:27 +0000 (Tue, 06 May 2025)
Log Message:
-----------
version 0.22rc1
Modified Paths:
--------------
trunk/docutils/HISTORY.rst
trunk/docutils/README.rst
trunk/docutils/RELEASE-NOTES.rst
trunk/docutils/docutils/__init__.py
trunk/docutils/test/functional/expected/buggy_mathml.html
trunk/docutils/test/functional/expected/buggy_mathml_blahtexml.html
trunk/docutils/test/functional/expected/buggy_mathml_pandoc.html
trunk/docutils/test/functional/expected/buggy_mathml_ttm.html
trunk/docutils/test/functional/expected/compact_lists.html
trunk/docutils/test/functional/expected/dangerous.html
trunk/docutils/test/functional/expected/field_name_limit.html
trunk/docutils/test/functional/expected/footnotes_html5.html
trunk/docutils/test/functional/expected/length_units_html5.html
trunk/docutils/test/functional/expected/math_experiments_mathml.html
trunk/docutils/test/functional/expected/math_experiments_mathml_blahtexml.html
trunk/docutils/test/functional/expected/math_experiments_mathml_pandoc.html
trunk/docutils/test/functional/expected/math_experiments_mathml_ttm.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/mathematics_mathml.html
trunk/docutils/test/functional/expected/mathematics_mathml_blahtexml.html
trunk/docutils/test/functional/expected/mathematics_mathml_pandoc.html
trunk/docutils/test/functional/expected/mathematics_mathml_ttm.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_manpage.man
trunk/docutils/test/functional/expected/standalone_rst_s5_html_1.html
trunk/docutils/test/functional/expected/standalone_rst_s5_html_2.html
trunk/docutils/test/test_writers/test_manpage.py
Modified: trunk/docutils/HISTORY.rst
===================================================================
--- trunk/docutils/HISTORY.rst 2025-05-05 21:14:44 UTC (rev 10121)
+++ trunk/docutils/HISTORY.rst 2025-05-06 17:03:27 UTC (rev 10122)
@@ -14,8 +14,8 @@
.. contents::
-Release 0.22b.dev (unpublished)
-===============================
+Release 0.22rc1 (2025-05-06)
+============================
* General
Modified: trunk/docutils/README.rst
===================================================================
--- trunk/docutils/README.rst 2025-05-05 21:14:44 UTC (rev 10121)
+++ trunk/docutils/README.rst 2025-05-06 17:03:27 UTC (rev 10122)
@@ -1,6 +1,6 @@
-=============================
- README: Docutils 0.22b.dev
-=============================
+==========================
+ README: Docutils 0.22rc1
+==========================
:Author: David Goodger
:Contact: go...@py...
Modified: trunk/docutils/RELEASE-NOTES.rst
===================================================================
--- trunk/docutils/RELEASE-NOTES.rst 2025-05-05 21:14:44 UTC (rev 10121)
+++ trunk/docutils/RELEASE-NOTES.rst 2025-05-06 17:03:27 UTC (rev 10122)
@@ -219,8 +219,8 @@
__ https://packages.debian.org/source/trixie/python-docutils
-Release 0.22b.dev (unpublished)
-===============================
+Release 0.22rc1 (2025-05-06)
+============================
reStructuredText:
- Support `CSS3 units`_. This adds "ch", "rem", "vw", "vh", "vmin",
Modified: trunk/docutils/docutils/__init__.py
===================================================================
--- trunk/docutils/docutils/__init__.py 2025-05-05 21:14:44 UTC (rev 10121)
+++ trunk/docutils/docutils/__init__.py 2025-05-06 17:03:27 UTC (rev 10122)
@@ -84,7 +84,7 @@
__docformat__ = 'reStructuredText'
-__version__ = '0.22b.dev'
+__version__ = '0.22rc1'
"""Docutils version identifier (complies with PEP 440)::
major.minor[.micro][releaselevel[serial]][.dev]
@@ -159,9 +159,9 @@
major=0,
minor=22,
micro=0,
- releaselevel='beta', # one of 'alpha', 'beta', 'candidate', 'final'
- serial=0, # pre-release number (0 for final releases and snapshots)
- release=False # True for official releases and pre-releases
+ releaselevel='candidate', # 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
)
"""Comprehensive version information tuple.
Modified: trunk/docutils/test/functional/expected/buggy_mathml.html
===================================================================
--- trunk/docutils/test/functional/expected/buggy_mathml.html 2025-05-05 21:14:44 UTC (rev 10121)
+++ trunk/docutils/test/functional/expected/buggy_mathml.html 2025-05-06 17:03:27 UTC (rev 10122)
@@ -2,7 +2,7 @@
<html xmlns="http://www.w3.org/1999/xhtml" xml:lang="en" lang="en">
<head>
<meta charset="utf-8" />
-<meta name="generator" content="Docutils 0.22b.dev: https://docutils.sourceforge.io/" />
+<meta name="generator" content="Docutils 0.22rc1: https://docutils.sourceforge.io/" />
<meta name="viewport" content="width=device-width, initial-scale=1" />
<title>buggy-maths</title>
<link rel="stylesheet" href="../../../docutils/writers/html5_polyglot/minimal.css" type="text/css" />
Modified: trunk/docutils/test/functional/expected/buggy_mathml_blahtexml.html
===================================================================
--- trunk/docutils/test/functional/expected/buggy_mathml_blahtexml.html 2025-05-05 21:14:44 UTC (rev 10121)
+++ trunk/docutils/test/functional/expected/buggy_mathml_blahtexml.html 2025-05-06 17:03:27 UTC (rev 10122)
@@ -2,7 +2,7 @@
<html xmlns="http://www.w3.org/1999/xhtml" xml:lang="en" lang="en">
<head>
<meta charset="utf-8" />
-<meta name="generator" content="Docutils 0.22b.dev: https://docutils.sourceforge.io/" />
+<meta name="generator" content="Docutils 0.22rc1: https://docutils.sourceforge.io/" />
<meta name="viewport" content="width=device-width, initial-scale=1" />
<title>buggy-maths</title>
<link rel="stylesheet" href="../../../docutils/writers/html5_polyglot/minimal.css" type="text/css" />
Modified: trunk/docutils/test/functional/expected/buggy_mathml_pandoc.html
===================================================================
--- trunk/docutils/test/functional/expected/buggy_mathml_pandoc.html 2025-05-05 21:14:44 UTC (rev 10121)
+++ trunk/docutils/test/functional/expected/buggy_mathml_pandoc.html 2025-05-06 17:03:27 UTC (rev 10122)
@@ -2,7 +2,7 @@
<html xmlns="http://www.w3.org/1999/xhtml" xml:lang="en" lang="en">
<head>
<meta charset="utf-8" />
-<meta name="generator" content="Docutils 0.22b.dev: https://docutils.sourceforge.io/" />
+<meta name="generator" content="Docutils 0.22rc1: https://docutils.sourceforge.io/" />
<meta name="viewport" content="width=device-width, initial-scale=1" />
<title>buggy-maths</title>
<link rel="stylesheet" href="../../../docutils/writers/html5_polyglot/minimal.css" type="text/css" />
Modified: trunk/docutils/test/functional/expected/buggy_mathml_ttm.html
===================================================================
--- trunk/docutils/test/functional/expected/buggy_mathml_ttm.html 2025-05-05 21:14:44 UTC (rev 10121)
+++ trunk/docutils/test/functional/expected/buggy_mathml_ttm.html 2025-05-06 17:03:27 UTC (rev 10122)
@@ -2,7 +2,7 @@
<html xmlns="http://www.w3.org/1999/xhtml" xml:lang="en" lang="en">
<head>
<meta charset="utf-8" />
-<meta name="generator" content="Docutils 0.22b.dev: https://docutils.sourceforge.io/" />
+<meta name="generator" content="Docutils 0.22rc1: https://docutils.sourceforge.io/" />
<meta name="viewport" content="width=device-width, initial-scale=1" />
<title>buggy-maths</title>
<link rel="stylesheet" href="../../../docutils/writers/html5_polyglot/minimal.css" type="text/css" />
Modified: trunk/docutils/test/functional/expected/compact_lists.html
===================================================================
--- trunk/docutils/test/functional/expected/compact_lists.html 2025-05-05 21:14:44 UTC (rev 10121)
+++ trunk/docutils/test/functional/expected/compact_lists.html 2025-05-06 17:03:27 UTC (rev 10122)
@@ -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.22b.dev: https://docutils.sourceforge.io/" />
+<meta name="generator" content="Docutils 0.22rc1: https://docutils.sourceforge.io/" />
<title>compact_lists.rst</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 2025-05-05 21:14:44 UTC (rev 10121)
+++ trunk/docutils/test/functional/expected/dangerous.html 2025-05-06 17:03:27 UTC (rev 10122)
@@ -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.22b.dev: https://docutils.sourceforge.io/" />
+<meta name="generator" content="Docutils 0.22rc1: https://docutils.sourceforge.io/" />
<title>dangerous.rst</title>
<link rel="stylesheet" href="../input/data/html4css1.css" type="text/css" />
</head>
Modified: trunk/docutils/test/functional/expected/field_name_limit.html
===================================================================
--- trunk/docutils/test/functional/expected/field_name_limit.html 2025-05-05 21:14:44 UTC (rev 10121)
+++ trunk/docutils/test/functional/expected/field_name_limit.html 2025-05-06 17:03:27 UTC (rev 10122)
@@ -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.22b.dev: https://docutils.sourceforge.io/" />
+<meta name="generator" content="Docutils 0.22rc1: https://docutils.sourceforge.io/" />
<title>field_list.rst</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 2025-05-05 21:14:44 UTC (rev 10121)
+++ trunk/docutils/test/functional/expected/footnotes_html5.html 2025-05-06 17:03:27 UTC (rev 10122)
@@ -2,7 +2,7 @@
<html xmlns="http://www.w3.org/1999/xhtml" xml:lang="en" lang="en">
<head>
<meta charset="utf-8" />
-<meta name="generator" content="Docutils 0.22b.dev: https://docutils.sourceforge.io/" />
+<meta name="generator" content="Docutils 0.22rc1: https://docutils.sourceforge.io/" />
<meta name="viewport" content="width=device-width, initial-scale=1" />
<title>Test footnote and citation rendering</title>
<link rel="stylesheet" href="../input/data/minimal.css" type="text/css" />
Modified: trunk/docutils/test/functional/expected/length_units_html5.html
===================================================================
--- trunk/docutils/test/functional/expected/length_units_html5.html 2025-05-05 21:14:44 UTC (rev 10121)
+++ trunk/docutils/test/functional/expected/length_units_html5.html 2025-05-06 17:03:27 UTC (rev 10122)
@@ -2,7 +2,7 @@
<html xmlns="http://www.w3.org/1999/xhtml" xml:lang="en" lang="en">
<head>
<meta charset="utf-8" />
-<meta name="generator" content="Docutils 0.22b.dev: https://docutils.sourceforge.io/" />
+<meta name="generator" content="Docutils 0.22rc1: https://docutils.sourceforge.io/" />
<meta name="viewport" content="width=device-width, initial-scale=1" />
<title>Test length specifications</title>
<link rel="stylesheet" href="../input/data/minimal.css" type="text/css" />
Modified: trunk/docutils/test/functional/expected/math_experiments_mathml.html
===================================================================
--- trunk/docutils/test/functional/expected/math_experiments_mathml.html 2025-05-05 21:14:44 UTC (rev 10121)
+++ trunk/docutils/test/functional/expected/math_experiments_mathml.html 2025-05-06 17:03:27 UTC (rev 10122)
@@ -2,7 +2,7 @@
<html xmlns="http://www.w3.org/1999/xhtml" xml:lang="en" lang="en">
<head>
<meta charset="utf-8" />
-<meta name="generator" content="Docutils 0.22b.dev: https://docutils.sourceforge.io/" />
+<meta name="generator" content="Docutils 0.22rc1: https://docutils.sourceforge.io/" />
<meta name="viewport" content="width=device-width, initial-scale=1" />
<title>Math Conversion Tests</title>
<link rel="stylesheet" href="../../../docutils/writers/html5_polyglot/minimal.css" type="text/css" />
Modified: trunk/docutils/test/functional/expected/math_experiments_mathml_blahtexml.html
===================================================================
--- trunk/docutils/test/functional/expected/math_experiments_mathml_blahtexml.html 2025-05-05 21:14:44 UTC (rev 10121)
+++ trunk/docutils/test/functional/expected/math_experiments_mathml_blahtexml.html 2025-05-06 17:03:27 UTC (rev 10122)
@@ -2,7 +2,7 @@
<html xmlns="http://www.w3.org/1999/xhtml" xml:lang="en" lang="en">
<head>
<meta charset="utf-8" />
-<meta name="generator" content="Docutils 0.22b.dev: https://docutils.sourceforge.io/" />
+<meta name="generator" content="Docutils 0.22rc1: https://docutils.sourceforge.io/" />
<meta name="viewport" content="width=device-width, initial-scale=1" />
<title>Math Conversion Tests</title>
<link rel="stylesheet" href="../../../docutils/writers/html5_polyglot/minimal.css" type="text/css" />
Modified: trunk/docutils/test/functional/expected/math_experiments_mathml_pandoc.html
===================================================================
--- trunk/docutils/test/functional/expected/math_experiments_mathml_pandoc.html 2025-05-05 21:14:44 UTC (rev 10121)
+++ trunk/docutils/test/functional/expected/math_experiments_mathml_pandoc.html 2025-05-06 17:03:27 UTC (rev 10122)
@@ -2,7 +2,7 @@
<html xmlns="http://www.w3.org/1999/xhtml" xml:lang="en" lang="en">
<head>
<meta charset="utf-8" />
-<meta name="generator" content="Docutils 0.22b.dev: https://docutils.sourceforge.io/" />
+<meta name="generator" content="Docutils 0.22rc1: https://docutils.sourceforge.io/" />
<meta name="viewport" content="width=device-width, initial-scale=1" />
<title>Math Conversion Tests</title>
<link rel="stylesheet" href="../../../docutils/writers/html5_polyglot/minimal.css" type="text/css" />
Modified: trunk/docutils/test/functional/expected/math_experiments_mathml_ttm.html
===================================================================
--- trunk/docutils/test/functional/expected/math_experiments_mathml_ttm.html 2025-05-05 21:14:44 UTC (rev 10121)
+++ trunk/docutils/test/functional/expected/math_experiments_mathml_ttm.html 2025-05-06 17:03:27 UTC (rev 10122)
@@ -2,7 +2,7 @@
<html xmlns="http://www.w3.org/1999/xhtml" xml:lang="en" lang="en">
<head>
<meta charset="utf-8" />
-<meta name="generator" content="Docutils 0.22b.dev: https://docutils.sourceforge.io/" />
+<meta name="generator" content="Docutils 0.22rc1: https://docutils.sourceforge.io/" />
<meta name="viewport" content="width=device-width, initial-scale=1" />
<title>Math Conversion Tests</title>
<link rel="stylesheet" href="../../../docutils/writers/html5_polyglot/minimal.css" type="text/css" />
Modified: trunk/docutils/test/functional/expected/math_output_html.html
===================================================================
--- trunk/docutils/test/functional/expected/math_output_html.html 2025-05-05 21:14:44 UTC (rev 10121)
+++ trunk/docutils/test/functional/expected/math_output_html.html 2025-05-06 17:03:27 UTC (rev 10122)
@@ -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.22b.dev: https://docutils.sourceforge.io/" />
+<meta name="generator" content="Docutils 0.22rc1: 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 2025-05-05 21:14:44 UTC (rev 10121)
+++ trunk/docutils/test/functional/expected/math_output_latex.html 2025-05-06 17:03:27 UTC (rev 10122)
@@ -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.22b.dev: https://docutils.sourceforge.io/" />
+<meta name="generator" content="Docutils 0.22rc1: 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 2025-05-05 21:14:44 UTC (rev 10121)
+++ trunk/docutils/test/functional/expected/math_output_mathjax.html 2025-05-06 17:03:27 UTC (rev 10122)
@@ -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.22b.dev: https://docutils.sourceforge.io/" />
+<meta name="generator" content="Docutils 0.22rc1: 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 2025-05-05 21:14:44 UTC (rev 10121)
+++ trunk/docutils/test/functional/expected/math_output_mathml.html 2025-05-06 17:03:27 UTC (rev 10122)
@@ -2,7 +2,7 @@
<html xmlns="http://www.w3.org/1999/xhtml" xml:lang="en" lang="en">
<head>
<meta charset="utf-8" />
-<meta name="generator" content="Docutils 0.22b.dev: https://docutils.sourceforge.io/" />
+<meta name="generator" content="Docutils 0.22rc1: https://docutils.sourceforge.io/" />
<meta name="viewport" content="width=device-width, initial-scale=1" />
<title>Mathematics</title>
<link rel="stylesheet" href="../input/data/minimal.css" type="text/css" />
Modified: trunk/docutils/test/functional/expected/mathematics_mathml.html
===================================================================
--- trunk/docutils/test/functional/expected/mathematics_mathml.html 2025-05-05 21:14:44 UTC (rev 10121)
+++ trunk/docutils/test/functional/expected/mathematics_mathml.html 2025-05-06 17:03:27 UTC (rev 10122)
@@ -2,7 +2,7 @@
<html xmlns="http://www.w3.org/1999/xhtml" xml:lang="en" lang="en">
<head>
<meta charset="utf-8" />
-<meta name="generator" content="Docutils 0.22b.dev: https://docutils.sourceforge.io/" />
+<meta name="generator" content="Docutils 0.22rc1: https://docutils.sourceforge.io/" />
<meta name="viewport" content="width=device-width, initial-scale=1" />
<title>LaTeX syntax for mathematics</title>
<link rel="stylesheet" href="../../../docutils/writers/html5_polyglot/minimal.css" type="text/css" />
Modified: trunk/docutils/test/functional/expected/mathematics_mathml_blahtexml.html
===================================================================
--- trunk/docutils/test/functional/expected/mathematics_mathml_blahtexml.html 2025-05-05 21:14:44 UTC (rev 10121)
+++ trunk/docutils/test/functional/expected/mathematics_mathml_blahtexml.html 2025-05-06 17:03:27 UTC (rev 10122)
@@ -2,7 +2,7 @@
<html xmlns="http://www.w3.org/1999/xhtml" xml:lang="en" lang="en">
<head>
<meta charset="utf-8" />
-<meta name="generator" content="Docutils 0.22b.dev: https://docutils.sourceforge.io/" />
+<meta name="generator" content="Docutils 0.22rc1: https://docutils.sourceforge.io/" />
<meta name="viewport" content="width=device-width, initial-scale=1" />
<title>LaTeX syntax for mathematics</title>
<link rel="stylesheet" href="../../../docutils/writers/html5_polyglot/minimal.css" type="text/css" />
Modified: trunk/docutils/test/functional/expected/mathematics_mathml_pandoc.html
===================================================================
--- trunk/docutils/test/functional/expected/mathematics_mathml_pandoc.html 2025-05-05 21:14:44 UTC (rev 10121)
+++ trunk/docutils/test/functional/expected/mathematics_mathml_pandoc.html 2025-05-06 17:03:27 UTC (rev 10122)
@@ -2,7 +2,7 @@
<html xmlns="http://www.w3.org/1999/xhtml" xml:lang="en" lang="en">
<head>
<meta charset="utf-8" />
-<meta name="generator" content="Docutils 0.22b.dev: https://docutils.sourceforge.io/" />
+<meta name="generator" content="Docutils 0.22rc1: https://docutils.sourceforge.io/" />
<meta name="viewport" content="width=device-width, initial-scale=1" />
<title>LaTeX syntax for mathematics</title>
<link rel="stylesheet" href="../../../docutils/writers/html5_polyglot/minimal.css" type="text/css" />
Modified: trunk/docutils/test/functional/expected/mathematics_mathml_ttm.html
===================================================================
--- trunk/docutils/test/functional/expected/mathematics_mathml_ttm.html 2025-05-05 21:14:44 UTC (rev 10121)
+++ trunk/docutils/test/functional/expected/mathematics_mathml_ttm.html 2025-05-06 17:03:27 UTC (rev 10122)
@@ -2,7 +2,7 @@
<html xmlns="http://www.w3.org/1999/xhtml" xml:lang="en" lang="en">
<head>
<meta charset="utf-8" />
-<meta name="generator" content="Docutils 0.22b.dev: https://docutils.sourceforge.io/" />
+<meta name="generator" content="Docutils 0.22rc1: https://docutils.sourceforge.io/" />
<meta name="viewport" content="width=device-width, initial-scale=1" />
<title>LaTeX syntax for mathematics</title>
<link rel="stylesheet" href="../../../docutils/writers/html5_polyglot/minimal.css" type="text/css" />
Modified: trunk/docutils/test/functional/expected/misc_rst_html4css1.html
===================================================================
--- trunk/docutils/test/functional/expected/misc_rst_html4css1.html 2025-05-05 21:14:44 UTC (rev 10121)
+++ trunk/docutils/test/functional/expected/misc_rst_html4css1.html 2025-05-06 17:03:27 UTC (rev 10122)
@@ -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.22b.dev: https://docutils.sourceforge.io/" />
+<meta name="generator" content="Docutils 0.22rc1: 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 2025-05-05 21:14:44 UTC (rev 10121)
+++ trunk/docutils/test/functional/expected/misc_rst_html5.html 2025-05-06 17:03:27 UTC (rev 10122)
@@ -2,7 +2,7 @@
<html xmlns="http://www.w3.org/1999/xhtml" xml:lang="en" lang="en">
<head>
<meta charset="utf-8" />
-<meta name="generator" content="Docutils 0.22b.dev: https://docutils.sourceforge.io/" />
+<meta name="generator" content="Docutils 0.22rc1: https://docutils.sourceforge.io/" />
<meta name="viewport" content="width=device-width, initial-scale=1" />
<title>Additional tests with HTML 5</title>
<link rel="stylesheet" href="../input/data/minimal.css" type="text/css" />
Modified: trunk/docutils/test/functional/expected/pep_html.html
===================================================================
--- trunk/docutils/test/functional/expected/pep_html.html 2025-05-05 21:14:44 UTC (rev 10121)
+++ trunk/docutils/test/functional/expected/pep_html.html 2025-05-06 17:03:27 UTC (rev 10122)
@@ -8,7 +8,7 @@
-->
<head>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
- <meta name="generator" content="Docutils 0.22b.dev: https://docutils.sourceforge.io/" />
+ <meta name="generator" content="Docutils 0.22rc1: 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 2025-05-05 21:14:44 UTC (rev 10121)
+++ trunk/docutils/test/functional/expected/rst_html5_tuftig.html 2025-05-06 17:03:27 UTC (rev 10122)
@@ -2,7 +2,7 @@
<html xmlns="http://www.w3.org/1999/xhtml" xml:lang="en" lang="en">
<head>
<meta charset="utf-8" />
-<meta name="generator" content="Docutils 0.22b.dev: https://docutils.sourceforge.io/" />
+<meta name="generator" content="Docutils 0.22rc1: https://docutils.sourceforge.io/" />
<meta name="viewport" content="width=device-width, initial-scale=1" />
<title>Special Features of the tuftig.css Stylesheet</title>
<link rel="stylesheet" href="../input/data/minimal.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 2025-05-05 21:14:44 UTC (rev 10121)
+++ trunk/docutils/test/functional/expected/standalone_rst_docutils_xml.xml 2025-05-06 17:03:27 UTC (rev 10122)
@@ -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.22b.dev -->
+<!-- Generated by Docutils 0.22rc1 -->
<document ids="restructuredtext-test-document doctitle" names="restructuredtext\ test\ document doctitle" source="functional/input/standalone_rst_docutils_xml.rst" 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 2025-05-05 21:14:44 UTC (rev 10121)
+++ trunk/docutils/test/functional/expected/standalone_rst_html4css1.html 2025-05-06 17:03:27 UTC (rev 10122)
@@ -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.22b.dev: https://docutils.sourceforge.io/" />
+<meta name="generator" content="Docutils 0.22rc1: https://docutils.sourceforge.io/" />
<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" />
<meta name="author" content="David Goodger" />
Modified: trunk/docutils/test/functional/expected/standalone_rst_html5.html
===================================================================
--- trunk/docutils/test/functional/expected/standalone_rst_html5.html 2025-05-05 21:14:44 UTC (rev 10121)
+++ trunk/docutils/test/functional/expected/standalone_rst_html5.html 2025-05-06 17:03:27 UTC (rev 10122)
@@ -2,7 +2,7 @@
<html xmlns="http://www.w3.org/1999/xhtml" xml:lang="en" lang="en">
<head>
<meta charset="utf-8" />
-<meta name="generator" content="Docutils 0.22b.dev: https://docutils.sourceforge.io/" />
+<meta name="generator" content="Docutils 0.22rc1: https://docutils.sourceforge.io/" />
<meta name="viewport" content="width=device-width, initial-scale=1" />
<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_manpage.man
===================================================================
--- trunk/docutils/test/functional/expected/standalone_rst_manpage.man 2025-05-05 21:14:44 UTC (rev 10121)
+++ trunk/docutils/test/functional/expected/standalone_rst_manpage.man 2025-05-06 17:03:27 UTC (rev 10122)
@@ -1,5 +1,5 @@
.\" Man page generated from reStructuredText
-.\" by the Docutils 0.22b.dev manpage writer.
+.\" by the Docutils 0.22rc1 manpage writer.
.
.
.nr rst2man-indent-level 0
Modified: trunk/docutils/test/functional/expected/standalone_rst_s5_html_1.html
===================================================================
--- trunk/docutils/test/functional/expected/standalone_rst_s5_html_1.html 2025-05-05 21:14:44 UTC (rev 10121)
+++ trunk/docutils/test/functional/expected/standalone_rst_s5_html_1.html 2025-05-06 17:03:27 UTC (rev 10122)
@@ -3,7 +3,7 @@
<html xmlns="http://www.w3.org/1999/xhtml" xml:lang="en" lang="en">
<head>
<meta http-equiv="Content-Type" conten...
[truncated message content] |
|
From: <gr...@us...> - 2025-05-06 17:41:21
|
Revision: 10125
http://sourceforge.net/p/docutils/code/10125
Author: grubert
Date: 2025-05-06 17:40:56 +0000 (Tue, 06 May 2025)
Log Message:
-----------
version 0.22rc2.dec
Modified Paths:
--------------
trunk/docutils/HISTORY.rst
trunk/docutils/README.rst
trunk/docutils/RELEASE-NOTES.rst
trunk/docutils/docs/dev/release.rst
trunk/docutils/docutils/__init__.py
trunk/docutils/test/functional/expected/buggy_mathml.html
trunk/docutils/test/functional/expected/buggy_mathml_blahtexml.html
trunk/docutils/test/functional/expected/buggy_mathml_pandoc.html
trunk/docutils/test/functional/expected/buggy_mathml_ttm.html
trunk/docutils/test/functional/expected/compact_lists.html
trunk/docutils/test/functional/expected/dangerous.html
trunk/docutils/test/functional/expected/field_name_limit.html
trunk/docutils/test/functional/expected/footnotes_html5.html
trunk/docutils/test/functional/expected/length_units_html5.html
trunk/docutils/test/functional/expected/math_experiments_mathml.html
trunk/docutils/test/functional/expected/math_experiments_mathml_blahtexml.html
trunk/docutils/test/functional/expected/math_experiments_mathml_pandoc.html
trunk/docutils/test/functional/expected/math_experiments_mathml_ttm.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/mathematics_mathml.html
trunk/docutils/test/functional/expected/mathematics_mathml_blahtexml.html
trunk/docutils/test/functional/expected/mathematics_mathml_pandoc.html
trunk/docutils/test/functional/expected/mathematics_mathml_ttm.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_manpage.man
trunk/docutils/test/functional/expected/standalone_rst_s5_html_1.html
trunk/docutils/test/functional/expected/standalone_rst_s5_html_2.html
trunk/docutils/test/test_writers/test_manpage.py
Modified: trunk/docutils/HISTORY.rst
===================================================================
--- trunk/docutils/HISTORY.rst 2025-05-06 17:31:36 UTC (rev 10124)
+++ trunk/docutils/HISTORY.rst 2025-05-06 17:40:56 UTC (rev 10125)
@@ -14,6 +14,11 @@
.. contents::
+Release 0.22rc2 (unpublished)
+=============================
+
+Nothing yet.
+
Release 0.22rc1 (2025-05-06)
============================
Modified: trunk/docutils/README.rst
===================================================================
--- trunk/docutils/README.rst 2025-05-06 17:31:36 UTC (rev 10124)
+++ trunk/docutils/README.rst 2025-05-06 17:40:56 UTC (rev 10125)
@@ -1,5 +1,5 @@
==========================
- README: Docutils 0.22rc1
+ README: Docutils 0.22rc2.dev
==========================
:Author: David Goodger
Modified: trunk/docutils/RELEASE-NOTES.rst
===================================================================
--- trunk/docutils/RELEASE-NOTES.rst 2025-05-06 17:31:36 UTC (rev 10124)
+++ trunk/docutils/RELEASE-NOTES.rst 2025-05-06 17:40:56 UTC (rev 10125)
@@ -219,6 +219,11 @@
__ https://packages.debian.org/source/trixie/python-docutils
+Release 0.22rc2 (unpublished)
+=============================
+
+Nothing yet.
+
Release 0.22rc1 (2025-05-06)
============================
Modified: trunk/docutils/docs/dev/release.rst
===================================================================
--- trunk/docutils/docs/dev/release.rst 2025-05-06 17:31:36 UTC (rev 10124)
+++ trunk/docutils/docs/dev/release.rst 2025-05-06 17:40:56 UTC (rev 10125)
@@ -180,8 +180,21 @@
For candidate releases change version to rc#+1dev.
-For final releases continue
+* set_version #.rc#+1.dev
+ change docutils/__init__.py
+
+ test
+
+* docutils/HISTORY.rst: add section "Release <version> (unpublished)"
+* docutils/RELEASE-Notes.rst: add section "Release <version> (unpublished)"
+
+* test again
+* commit
+* run sandbox/infrastructure/docutils-update.local
+
+For final releases
+
* upload source and generated html to sf-htdocs/#.# ::
mkdir tmp1
Modified: trunk/docutils/docutils/__init__.py
===================================================================
--- trunk/docutils/docutils/__init__.py 2025-05-06 17:31:36 UTC (rev 10124)
+++ trunk/docutils/docutils/__init__.py 2025-05-06 17:40:56 UTC (rev 10125)
@@ -84,7 +84,7 @@
__docformat__ = 'reStructuredText'
-__version__ = '0.22rc1'
+__version__ = '0.22rc2.dev'
"""Docutils version identifier (complies with PEP 440)::
major.minor[.micro][releaselevel[serial]][.dev]
@@ -160,8 +160,8 @@
minor=22,
micro=0,
releaselevel='candidate', # 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/test/functional/expected/buggy_mathml.html
===================================================================
--- trunk/docutils/test/functional/expected/buggy_mathml.html 2025-05-06 17:31:36 UTC (rev 10124)
+++ trunk/docutils/test/functional/expected/buggy_mathml.html 2025-05-06 17:40:56 UTC (rev 10125)
@@ -2,7 +2,7 @@
<html xmlns="http://www.w3.org/1999/xhtml" xml:lang="en" lang="en">
<head>
<meta charset="utf-8" />
-<meta name="generator" content="Docutils 0.22rc1: https://docutils.sourceforge.io/" />
+<meta name="generator" content="Docutils 0.22rc2.dev: https://docutils.sourceforge.io/" />
<meta name="viewport" content="width=device-width, initial-scale=1" />
<title>buggy-maths</title>
<link rel="stylesheet" href="../../../docutils/writers/html5_polyglot/minimal.css" type="text/css" />
Modified: trunk/docutils/test/functional/expected/buggy_mathml_blahtexml.html
===================================================================
--- trunk/docutils/test/functional/expected/buggy_mathml_blahtexml.html 2025-05-06 17:31:36 UTC (rev 10124)
+++ trunk/docutils/test/functional/expected/buggy_mathml_blahtexml.html 2025-05-06 17:40:56 UTC (rev 10125)
@@ -2,7 +2,7 @@
<html xmlns="http://www.w3.org/1999/xhtml" xml:lang="en" lang="en">
<head>
<meta charset="utf-8" />
-<meta name="generator" content="Docutils 0.22rc1: https://docutils.sourceforge.io/" />
+<meta name="generator" content="Docutils 0.22rc2.dev: https://docutils.sourceforge.io/" />
<meta name="viewport" content="width=device-width, initial-scale=1" />
<title>buggy-maths</title>
<link rel="stylesheet" href="../../../docutils/writers/html5_polyglot/minimal.css" type="text/css" />
Modified: trunk/docutils/test/functional/expected/buggy_mathml_pandoc.html
===================================================================
--- trunk/docutils/test/functional/expected/buggy_mathml_pandoc.html 2025-05-06 17:31:36 UTC (rev 10124)
+++ trunk/docutils/test/functional/expected/buggy_mathml_pandoc.html 2025-05-06 17:40:56 UTC (rev 10125)
@@ -2,7 +2,7 @@
<html xmlns="http://www.w3.org/1999/xhtml" xml:lang="en" lang="en">
<head>
<meta charset="utf-8" />
-<meta name="generator" content="Docutils 0.22rc1: https://docutils.sourceforge.io/" />
+<meta name="generator" content="Docutils 0.22rc2.dev: https://docutils.sourceforge.io/" />
<meta name="viewport" content="width=device-width, initial-scale=1" />
<title>buggy-maths</title>
<link rel="stylesheet" href="../../../docutils/writers/html5_polyglot/minimal.css" type="text/css" />
Modified: trunk/docutils/test/functional/expected/buggy_mathml_ttm.html
===================================================================
--- trunk/docutils/test/functional/expected/buggy_mathml_ttm.html 2025-05-06 17:31:36 UTC (rev 10124)
+++ trunk/docutils/test/functional/expected/buggy_mathml_ttm.html 2025-05-06 17:40:56 UTC (rev 10125)
@@ -2,7 +2,7 @@
<html xmlns="http://www.w3.org/1999/xhtml" xml:lang="en" lang="en">
<head>
<meta charset="utf-8" />
-<meta name="generator" content="Docutils 0.22rc1: https://docutils.sourceforge.io/" />
+<meta name="generator" content="Docutils 0.22rc2.dev: https://docutils.sourceforge.io/" />
<meta name="viewport" content="width=device-width, initial-scale=1" />
<title>buggy-maths</title>
<link rel="stylesheet" href="../../../docutils/writers/html5_polyglot/minimal.css" type="text/css" />
Modified: trunk/docutils/test/functional/expected/compact_lists.html
===================================================================
--- trunk/docutils/test/functional/expected/compact_lists.html 2025-05-06 17:31:36 UTC (rev 10124)
+++ trunk/docutils/test/functional/expected/compact_lists.html 2025-05-06 17:40:56 UTC (rev 10125)
@@ -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.22rc1: https://docutils.sourceforge.io/" />
+<meta name="generator" content="Docutils 0.22rc2.dev: https://docutils.sourceforge.io/" />
<title>compact_lists.rst</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 2025-05-06 17:31:36 UTC (rev 10124)
+++ trunk/docutils/test/functional/expected/dangerous.html 2025-05-06 17:40:56 UTC (rev 10125)
@@ -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.22rc1: https://docutils.sourceforge.io/" />
+<meta name="generator" content="Docutils 0.22rc2.dev: https://docutils.sourceforge.io/" />
<title>dangerous.rst</title>
<link rel="stylesheet" href="../input/data/html4css1.css" type="text/css" />
</head>
Modified: trunk/docutils/test/functional/expected/field_name_limit.html
===================================================================
--- trunk/docutils/test/functional/expected/field_name_limit.html 2025-05-06 17:31:36 UTC (rev 10124)
+++ trunk/docutils/test/functional/expected/field_name_limit.html 2025-05-06 17:40:56 UTC (rev 10125)
@@ -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.22rc1: https://docutils.sourceforge.io/" />
+<meta name="generator" content="Docutils 0.22rc2.dev: https://docutils.sourceforge.io/" />
<title>field_list.rst</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 2025-05-06 17:31:36 UTC (rev 10124)
+++ trunk/docutils/test/functional/expected/footnotes_html5.html 2025-05-06 17:40:56 UTC (rev 10125)
@@ -2,7 +2,7 @@
<html xmlns="http://www.w3.org/1999/xhtml" xml:lang="en" lang="en">
<head>
<meta charset="utf-8" />
-<meta name="generator" content="Docutils 0.22rc1: https://docutils.sourceforge.io/" />
+<meta name="generator" content="Docutils 0.22rc2.dev: https://docutils.sourceforge.io/" />
<meta name="viewport" content="width=device-width, initial-scale=1" />
<title>Test footnote and citation rendering</title>
<link rel="stylesheet" href="../input/data/minimal.css" type="text/css" />
Modified: trunk/docutils/test/functional/expected/length_units_html5.html
===================================================================
--- trunk/docutils/test/functional/expected/length_units_html5.html 2025-05-06 17:31:36 UTC (rev 10124)
+++ trunk/docutils/test/functional/expected/length_units_html5.html 2025-05-06 17:40:56 UTC (rev 10125)
@@ -2,7 +2,7 @@
<html xmlns="http://www.w3.org/1999/xhtml" xml:lang="en" lang="en">
<head>
<meta charset="utf-8" />
-<meta name="generator" content="Docutils 0.22rc1: https://docutils.sourceforge.io/" />
+<meta name="generator" content="Docutils 0.22rc2.dev: https://docutils.sourceforge.io/" />
<meta name="viewport" content="width=device-width, initial-scale=1" />
<title>Test length specifications</title>
<link rel="stylesheet" href="../input/data/minimal.css" type="text/css" />
Modified: trunk/docutils/test/functional/expected/math_experiments_mathml.html
===================================================================
--- trunk/docutils/test/functional/expected/math_experiments_mathml.html 2025-05-06 17:31:36 UTC (rev 10124)
+++ trunk/docutils/test/functional/expected/math_experiments_mathml.html 2025-05-06 17:40:56 UTC (rev 10125)
@@ -2,7 +2,7 @@
<html xmlns="http://www.w3.org/1999/xhtml" xml:lang="en" lang="en">
<head>
<meta charset="utf-8" />
-<meta name="generator" content="Docutils 0.22rc1: https://docutils.sourceforge.io/" />
+<meta name="generator" content="Docutils 0.22rc2.dev: https://docutils.sourceforge.io/" />
<meta name="viewport" content="width=device-width, initial-scale=1" />
<title>Math Conversion Tests</title>
<link rel="stylesheet" href="../../../docutils/writers/html5_polyglot/minimal.css" type="text/css" />
Modified: trunk/docutils/test/functional/expected/math_experiments_mathml_blahtexml.html
===================================================================
--- trunk/docutils/test/functional/expected/math_experiments_mathml_blahtexml.html 2025-05-06 17:31:36 UTC (rev 10124)
+++ trunk/docutils/test/functional/expected/math_experiments_mathml_blahtexml.html 2025-05-06 17:40:56 UTC (rev 10125)
@@ -2,7 +2,7 @@
<html xmlns="http://www.w3.org/1999/xhtml" xml:lang="en" lang="en">
<head>
<meta charset="utf-8" />
-<meta name="generator" content="Docutils 0.22rc1: https://docutils.sourceforge.io/" />
+<meta name="generator" content="Docutils 0.22rc2.dev: https://docutils.sourceforge.io/" />
<meta name="viewport" content="width=device-width, initial-scale=1" />
<title>Math Conversion Tests</title>
<link rel="stylesheet" href="../../../docutils/writers/html5_polyglot/minimal.css" type="text/css" />
Modified: trunk/docutils/test/functional/expected/math_experiments_mathml_pandoc.html
===================================================================
--- trunk/docutils/test/functional/expected/math_experiments_mathml_pandoc.html 2025-05-06 17:31:36 UTC (rev 10124)
+++ trunk/docutils/test/functional/expected/math_experiments_mathml_pandoc.html 2025-05-06 17:40:56 UTC (rev 10125)
@@ -2,7 +2,7 @@
<html xmlns="http://www.w3.org/1999/xhtml" xml:lang="en" lang="en">
<head>
<meta charset="utf-8" />
-<meta name="generator" content="Docutils 0.22rc1: https://docutils.sourceforge.io/" />
+<meta name="generator" content="Docutils 0.22rc2.dev: https://docutils.sourceforge.io/" />
<meta name="viewport" content="width=device-width, initial-scale=1" />
<title>Math Conversion Tests</title>
<link rel="stylesheet" href="../../../docutils/writers/html5_polyglot/minimal.css" type="text/css" />
Modified: trunk/docutils/test/functional/expected/math_experiments_mathml_ttm.html
===================================================================
--- trunk/docutils/test/functional/expected/math_experiments_mathml_ttm.html 2025-05-06 17:31:36 UTC (rev 10124)
+++ trunk/docutils/test/functional/expected/math_experiments_mathml_ttm.html 2025-05-06 17:40:56 UTC (rev 10125)
@@ -2,7 +2,7 @@
<html xmlns="http://www.w3.org/1999/xhtml" xml:lang="en" lang="en">
<head>
<meta charset="utf-8" />
-<meta name="generator" content="Docutils 0.22rc1: https://docutils.sourceforge.io/" />
+<meta name="generator" content="Docutils 0.22rc2.dev: https://docutils.sourceforge.io/" />
<meta name="viewport" content="width=device-width, initial-scale=1" />
<title>Math Conversion Tests</title>
<link rel="stylesheet" href="../../../docutils/writers/html5_polyglot/minimal.css" type="text/css" />
Modified: trunk/docutils/test/functional/expected/math_output_html.html
===================================================================
--- trunk/docutils/test/functional/expected/math_output_html.html 2025-05-06 17:31:36 UTC (rev 10124)
+++ trunk/docutils/test/functional/expected/math_output_html.html 2025-05-06 17:40:56 UTC (rev 10125)
@@ -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.22rc1: https://docutils.sourceforge.io/" />
+<meta name="generator" content="Docutils 0.22rc2.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 2025-05-06 17:31:36 UTC (rev 10124)
+++ trunk/docutils/test/functional/expected/math_output_latex.html 2025-05-06 17:40:56 UTC (rev 10125)
@@ -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.22rc1: https://docutils.sourceforge.io/" />
+<meta name="generator" content="Docutils 0.22rc2.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 2025-05-06 17:31:36 UTC (rev 10124)
+++ trunk/docutils/test/functional/expected/math_output_mathjax.html 2025-05-06 17:40:56 UTC (rev 10125)
@@ -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.22rc1: https://docutils.sourceforge.io/" />
+<meta name="generator" content="Docutils 0.22rc2.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 2025-05-06 17:31:36 UTC (rev 10124)
+++ trunk/docutils/test/functional/expected/math_output_mathml.html 2025-05-06 17:40:56 UTC (rev 10125)
@@ -2,7 +2,7 @@
<html xmlns="http://www.w3.org/1999/xhtml" xml:lang="en" lang="en">
<head>
<meta charset="utf-8" />
-<meta name="generator" content="Docutils 0.22rc1: https://docutils.sourceforge.io/" />
+<meta name="generator" content="Docutils 0.22rc2.dev: https://docutils.sourceforge.io/" />
<meta name="viewport" content="width=device-width, initial-scale=1" />
<title>Mathematics</title>
<link rel="stylesheet" href="../input/data/minimal.css" type="text/css" />
Modified: trunk/docutils/test/functional/expected/mathematics_mathml.html
===================================================================
--- trunk/docutils/test/functional/expected/mathematics_mathml.html 2025-05-06 17:31:36 UTC (rev 10124)
+++ trunk/docutils/test/functional/expected/mathematics_mathml.html 2025-05-06 17:40:56 UTC (rev 10125)
@@ -2,7 +2,7 @@
<html xmlns="http://www.w3.org/1999/xhtml" xml:lang="en" lang="en">
<head>
<meta charset="utf-8" />
-<meta name="generator" content="Docutils 0.22rc1: https://docutils.sourceforge.io/" />
+<meta name="generator" content="Docutils 0.22rc2.dev: https://docutils.sourceforge.io/" />
<meta name="viewport" content="width=device-width, initial-scale=1" />
<title>LaTeX syntax for mathematics</title>
<link rel="stylesheet" href="../../../docutils/writers/html5_polyglot/minimal.css" type="text/css" />
Modified: trunk/docutils/test/functional/expected/mathematics_mathml_blahtexml.html
===================================================================
--- trunk/docutils/test/functional/expected/mathematics_mathml_blahtexml.html 2025-05-06 17:31:36 UTC (rev 10124)
+++ trunk/docutils/test/functional/expected/mathematics_mathml_blahtexml.html 2025-05-06 17:40:56 UTC (rev 10125)
@@ -2,7 +2,7 @@
<html xmlns="http://www.w3.org/1999/xhtml" xml:lang="en" lang="en">
<head>
<meta charset="utf-8" />
-<meta name="generator" content="Docutils 0.22rc1: https://docutils.sourceforge.io/" />
+<meta name="generator" content="Docutils 0.22rc2.dev: https://docutils.sourceforge.io/" />
<meta name="viewport" content="width=device-width, initial-scale=1" />
<title>LaTeX syntax for mathematics</title>
<link rel="stylesheet" href="../../../docutils/writers/html5_polyglot/minimal.css" type="text/css" />
Modified: trunk/docutils/test/functional/expected/mathematics_mathml_pandoc.html
===================================================================
--- trunk/docutils/test/functional/expected/mathematics_mathml_pandoc.html 2025-05-06 17:31:36 UTC (rev 10124)
+++ trunk/docutils/test/functional/expected/mathematics_mathml_pandoc.html 2025-05-06 17:40:56 UTC (rev 10125)
@@ -2,7 +2,7 @@
<html xmlns="http://www.w3.org/1999/xhtml" xml:lang="en" lang="en">
<head>
<meta charset="utf-8" />
-<meta name="generator" content="Docutils 0.22rc1: https://docutils.sourceforge.io/" />
+<meta name="generator" content="Docutils 0.22rc2.dev: https://docutils.sourceforge.io/" />
<meta name="viewport" content="width=device-width, initial-scale=1" />
<title>LaTeX syntax for mathematics</title>
<link rel="stylesheet" href="../../../docutils/writers/html5_polyglot/minimal.css" type="text/css" />
Modified: trunk/docutils/test/functional/expected/mathematics_mathml_ttm.html
===================================================================
--- trunk/docutils/test/functional/expected/mathematics_mathml_ttm.html 2025-05-06 17:31:36 UTC (rev 10124)
+++ trunk/docutils/test/functional/expected/mathematics_mathml_ttm.html 2025-05-06 17:40:56 UTC (rev 10125)
@@ -2,7 +2,7 @@
<html xmlns="http://www.w3.org/1999/xhtml" xml:lang="en" lang="en">
<head>
<meta charset="utf-8" />
-<meta name="generator" content="Docutils 0.22rc1: https://docutils.sourceforge.io/" />
+<meta name="generator" content="Docutils 0.22rc2.dev: https://docutils.sourceforge.io/" />
<meta name="viewport" content="width=device-width, initial-scale=1" />
<title>LaTeX syntax for mathematics</title>
<link rel="stylesheet" href="../../../docutils/writers/html5_polyglot/minimal.css" type="text/css" />
Modified: trunk/docutils/test/functional/expected/misc_rst_html4css1.html
===================================================================
--- trunk/docutils/test/functional/expected/misc_rst_html4css1.html 2025-05-06 17:31:36 UTC (rev 10124)
+++ trunk/docutils/test/functional/expected/misc_rst_html4css1.html 2025-05-06 17:40:56 UTC (rev 10125)
@@ -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.22rc1: https://docutils.sourceforge.io/" />
+<meta name="generator" content="Docutils 0.22rc2.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 2025-05-06 17:31:36 UTC (rev 10124)
+++ trunk/docutils/test/functional/expected/misc_rst_html5.html 2025-05-06 17:40:56 UTC (rev 10125)
@@ -2,7 +2,7 @@
<html xmlns="http://www.w3.org/1999/xhtml" xml:lang="en" lang="en">
<head>
<meta charset="utf-8" />
-<meta name="generator" content="Docutils 0.22rc1: https://docutils.sourceforge.io/" />
+<meta name="generator" content="Docutils 0.22rc2.dev: https://docutils.sourceforge.io/" />
<meta name="viewport" content="width=device-width, initial-scale=1" />
<title>Additional tests with HTML 5</title>
<link rel="stylesheet" href="../input/data/minimal.css" type="text/css" />
Modified: trunk/docutils/test/functional/expected/pep_html.html
===================================================================
--- trunk/docutils/test/functional/expected/pep_html.html 2025-05-06 17:31:36 UTC (rev 10124)
+++ trunk/docutils/test/functional/expected/pep_html.html 2025-05-06 17:40:56 UTC (rev 10125)
@@ -8,7 +8,7 @@
-->
<head>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
- <meta name="generator" content="Docutils 0.22rc1: https://docutils.sourceforge.io/" />
+ <meta name="generator" content="Docutils 0.22rc2.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 2025-05-06 17:31:36 UTC (rev 10124)
+++ trunk/docutils/test/functional/expected/rst_html5_tuftig.html 2025-05-06 17:40:56 UTC (rev 10125)
@@ -2,7 +2,7 @@
<html xmlns="http://www.w3.org/1999/xhtml" xml:lang="en" lang="en">
<head>
<meta charset="utf-8" />
-<meta name="generator" content="Docutils 0.22rc1: https://docutils.sourceforge.io/" />
+<meta name="generator" content="Docutils 0.22rc2.dev: https://docutils.sourceforge.io/" />
<meta name="viewport" content="width=device-width, initial-scale=1" />
<title>Special Features of the tuftig.css Stylesheet</title>
<link rel="stylesheet" href="../input/data/minimal.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 2025-05-06 17:31:36 UTC (rev 10124)
+++ trunk/docutils/test/functional/expected/standalone_rst_docutils_xml.xml 2025-05-06 17:40:56 UTC (rev 10125)
@@ -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.22rc1 -->
+<!-- Generated by Docutils 0.22rc2.dev -->
<document ids="restructuredtext-test-document doctitle" names="restructuredtext\ test\ document doctitle" source="functional/input/standalone_rst_docutils_xml.rst" 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 2025-05-06 17:31:36 UTC (rev 10124)
+++ trunk/docutils/test/functional/expected/standalone_rst_html4css1.html 2025-05-06 17:40:56 UTC (rev 10125)
@@ -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.22rc1: https://docutils.sourceforge.io/" />
+<meta name="generator" content="Docutils 0.22rc2.dev: https://docutils.sourceforge.io/" />
<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" />
<meta name="author" content="David Goodger" />
Modified: trunk/docutils/test/functional/expected/standalone_rst_html5.html
===================================================================
--- trunk/docutils/test/functional/expected/standalone_rst_html5.html 2025-05-06 17:31:36 UTC (rev 10124)
+++ trunk/docutils/test/functional/expected/standalone_rst_html5.html 2025-05-06 17:40:56 UTC (rev 10125)
@@ -2,7 +2,7 @@
<html xmlns="http://www.w3.org/1999/xhtml" xml:lang="en" lang="en">
<head>
<meta charset="utf-8" />
-<meta name="generator" content="Docutils 0.22rc1: https://docutils.sourceforge.io/" />
+<meta name="generator" content="Docutils 0.22rc2.dev: https://docutils.sourceforge.io/" />
<meta name="viewport" content="width=device-width, initial-scale=1" />
<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_manpage.man
===================================================================
--- trunk/docutils/test/functional/expected/standalone_rst_manpage.man 2025-05-06 17:31:36 UTC (rev 10124)
+++ trunk/docutils/test/functional/expected/standalone_rst_manpage.man 2025-05-06 17:40:56 UTC (rev 10125)
@@ -1,5 +1,5 @@
.\" Man page generated from reStructuredText
-.\"...
[truncated message content] |
|
From: <mi...@us...> - 2025-05-13 08:38:01
|
Revision: 10126
http://sourceforge.net/p/docutils/code/10126
Author: milde
Date: 2025-05-13 08:37:56 +0000 (Tue, 13 May 2025)
Log Message:
-----------
Fix problems with 3rd-party parsers.
Pass default settings to custom parser for included file.
When the "include" directive is used with a custom parser,
we must ensure the custom parser's default settings are present
in `document.settings`.
Fix error when determining the document metadata title from the
source path and the internal `source` attribute is ``None``.
Modified Paths:
--------------
trunk/docutils/HISTORY.rst
trunk/docutils/docutils/parsers/rst/directives/misc.py
trunk/docutils/docutils/writers/_html_base.py
Modified: trunk/docutils/HISTORY.rst
===================================================================
--- trunk/docutils/HISTORY.rst 2025-05-06 17:40:56 UTC (rev 10125)
+++ trunk/docutils/HISTORY.rst 2025-05-13 08:37:56 UTC (rev 10126)
@@ -17,8 +17,16 @@
Release 0.22rc2 (unpublished)
=============================
-Nothing yet.
+* docutils/parsers/rst/directives/misc.py
+ - Pass default settings to custom parser for included file.
+
+* docutils/writers/_html_base.py
+
+ - Fix error when determining the document metadata title from the
+ source path and the internal `source` attribute is None.
+
+
Release 0.22rc1 (2025-05-06)
============================
Modified: trunk/docutils/docutils/parsers/rst/directives/misc.py
===================================================================
--- trunk/docutils/docutils/parsers/rst/directives/misc.py 2025-05-06 17:40:56 UTC (rev 10125)
+++ trunk/docutils/docutils/parsers/rst/directives/misc.py 2025-05-13 08:37:56 UTC (rev 10126)
@@ -14,7 +14,7 @@
from urllib.request import urlopen
from urllib.error import URLError
-from docutils import io, nodes, statemachine, utils
+from docutils import frontend, io, nodes, statemachine, utils
from docutils.parsers.rst import Directive, convert_directive_function
from docutils.parsers.rst import directives, roles, states
from docutils.parsers.rst.directives.body import CodeBlock, NumberLines
@@ -213,7 +213,11 @@
Provisional.
"""
- settings = self.settings.copy()
+ parser = self.options['parser']()
+ settings = frontend.get_default_settings(parser)
+ # update with current document settings
+ for k, v in self.settings.__dict__.items():
+ setattr(settings, k, v)
settings._source = self.options['source']
document = utils.new_document(settings._source, settings)
document.include_log = self.state.document.include_log
@@ -220,7 +224,6 @@
document.ids = self.state.document.ids
document.nameids = self.state.document.nameids
document.nametypes = self.state.document.nametypes
- parser = self.options['parser']()
parser.parse(text, document)
self.state.document.parse_messages.extend(document.parse_messages)
# clean up doctree and complete parsing
Modified: trunk/docutils/docutils/writers/_html_base.py
===================================================================
--- trunk/docutils/docutils/writers/_html_base.py 2025-05-06 17:40:56 UTC (rev 10125)
+++ trunk/docutils/docutils/writers/_html_base.py 2025-05-13 08:37:56 UTC (rev 10126)
@@ -937,7 +937,8 @@
self.body.append('\n</pre>\n')
def visit_document(self, node) -> None:
- title = (node.get('title') or os.path.basename(node['source'])
+ title = (node.get('title')
+ or os.path.basename(node.get('source') or '')
or 'untitled Docutils document')
self.head.append(f'<title>{self.encode(title)}</title>\n')
This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site.
|
|
From: <mi...@us...> - 2025-05-13 20:49:14
|
Revision: 10127
http://sourceforge.net/p/docutils/code/10127
Author: milde
Date: 2025-05-13 20:49:10 +0000 (Tue, 13 May 2025)
Log Message:
-----------
Document more doctree elements + documentation fixes.
Document `<pending>` and `<reference>`.
Various small fixes.
Modified Paths:
--------------
trunk/docutils/RELEASE-NOTES.rst
trunk/docutils/docs/ref/doctree.rst
trunk/docutils/docs/ref/docutils.dtd
trunk/docutils/docs/ref/rst/restructuredtext.rst
trunk/docutils/docs/ref/rst/roles.rst
trunk/docutils/docs/user/config.rst
trunk/docutils/docutils/frontend.py
trunk/docutils/docutils/nodes.py
Modified: trunk/docutils/RELEASE-NOTES.rst
===================================================================
--- trunk/docutils/RELEASE-NOTES.rst 2025-05-13 08:37:56 UTC (rev 10126)
+++ trunk/docutils/RELEASE-NOTES.rst 2025-05-13 20:49:10 UTC (rev 10127)
@@ -44,10 +44,7 @@
Document Tree / Docutils DTD
----------------------------
-* Do not lowercase reference names in the `"refname" attribute`_
- (matching hyperlinks, footnotes, and citations remains case insensitive),
- and drop the ``name`` attribute from <reference> nodes
- in Docutils 1.0.
+* Drop the ``name`` attribute from <reference> nodes in Docutils 1.0.
* Use the ``%tbl.table.att`` parameter entity instead of ``%bodyatt``
to customize the <table> element's attribute list in Docutils 1.0.
@@ -231,7 +228,6 @@
- Support `CSS3 units`_. This adds "ch", "rem", "vw", "vh", "vmin",
"vmax", and "Q" to the `supported length units`__. Note that some
output formats don't support all units.
-
- New option "figname" for the `"figure"`_ directive.
.. _CSS3 units: https://www.w3.org/TR/css-values-3/#lengths
@@ -247,15 +243,12 @@
Configuration changes
- Make MathML the default math_output_ for the "html5" writer.
-
- Change the default input_encoding_ from ``None`` (auto-detect) to "utf-8".
-
- Drop short options ``-i`` and ``-o``.
Use the long equivalents ``--input-encoding`` and ``--output-encoding``.
(See `command line interface`_ for the rationale.)
-
- Rename configuration setting "output" to "output_path_".
-
+ - New setting "validate_".
- The manpage writer now recognizes the sections [writers] and
[manpage writer] with the new setting `text_references`_.
@@ -1462,12 +1455,13 @@
.. _old-format configuration files:
docs/user/config.html#old-format-configuration-files
.. _output:
-.. _output_path: docs/user/config.html#output
+.. _output_path: docs/user/config.html#output-path
.. _reference-label: docs/user/config.html#reference-label
.. _root_prefix: docs/user/config.html#root-prefix
.. _SmartQuotes: docs/user/config.html#smart-quotes
.. _sources: docs/user/config.html#sources
.. _use_latex_citations: docs/user/config.html#use-latex-citations
+.. _validate: docs/user/config.html#validate
.. _"writer" setting: docs/user/config.html#writer-buildhtml-application
.. _front end tools: docs/user/tools.html
Modified: trunk/docutils/docs/ref/doctree.rst
===================================================================
--- trunk/docutils/docs/ref/doctree.rst 2025-05-13 08:37:56 UTC (rev 10126)
+++ trunk/docutils/docs/ref/doctree.rst 2025-05-13 20:49:10 UTC (rev 10127)
@@ -50,7 +50,7 @@
Below is a *simplified* diagram of the hierarchy of elements in the
Docutils document tree structure.
An element may contain elements immediately below it in the diagram.
-Element types in square brackets indicate recursive or one-to-many
+Element types in *square brackets* indicate recursive or one-to-many
relationships: structural elements (sections) may contain sub-sections,
some body elements may contain other body elements, etc.
The `element reference`_ details valid parents and children
@@ -69,17 +69,22 @@
/* structural elements */
table.e-hierarchy tr:nth-child(2) {background: #e0ece0;}
table.e-hierarchy tr:nth-child(3) td:first-child {background: #e0ece0;}
+ table.e-hierarchy tr:nth-child(4) td:first-child {background: #e0ece0;}
/* structural subelements */
table.e-hierarchy tr:nth-child(3) td:nth-child(2) {background: #9ccfb3}
+ /* bibliograpinc elements */
+ table.e-hierarchy tr:nth-child(4) td:nth-child(2) {background: #accfd5}
+ /* decorative elements */
+ table.e-hierarchy tr:nth-child(4) td:nth-child(3) {background: #8cbfb3}
/* body elements */
- table.e-hierarchy tr:nth-child(4) > td {background: #f7adad}
- table.e-hierarchy tr:nth-child(5) td:nth-child(2){background: #f7adad}
- table.e-hierarchy tr:nth-child(5) td:nth-child(3){background: #f7adad}
+ table.e-hierarchy tr:nth-child(5) > td {background: #f7adad}
+ table.e-hierarchy tr:nth-child(6) td:nth-child(2){background: #f7adad}
+ table.e-hierarchy tr:nth-child(6) td:nth-child(3){background: #f7adad}
/* body subelements */
- table.e-hierarchy tr:nth-child(5) > td {background: thistle}
- table.e-hierarchy tr:nth-child(6) td:first-child {background: thistle}
+ table.e-hierarchy tr:nth-child(6) > td {background: thistle}
+ table.e-hierarchy tr:nth-child(7) td:first-child {background: thistle}
/* inline elements */
- table.e-hierarchy tr:nth-child(6) td:nth-child(2){background: #fffccc}
+ table.e-hierarchy tr:nth-child(7) td:nth-child(2){background: #fffccc}
/* text */
table.e-hierarchy tr:last-child {background: #f9f8eb}
--></style>
@@ -86,25 +91,27 @@
.. table::
:class: e-hierarchy
- :width: 65%
- :widths: 1 2 1 1
+ :width: 90%
+ :widths: 1 1 1 1
:align: center
- +------------------------------------------+
- | `root element`_ (`\<document>`_) |
- +---+------------------------------+---+---+
- | [`structural elements`_] | | |
- +---+------------------------------+---+ +
- | | [`structural subelements`_] | |
- +---+----------------------------------+---+
- | [`body elements`_] |
- +---+------------------------------+---+---+
- | [`body subelements`_] | | |
- +---+------------------------------+---+ +
- | | [`inline elements`_] | |
- +---+----------------------------------+---+
- | text |
- +------------------------------------------+
+ +-----------------------------------------------------------------+
+ | `root element`_ (`\<document>`_) |
+ +---+---------------------------------------------------------+---+
+ | [`structural elements`_] | |
+ +---+---------------------------------------------------------+ +
+ | | `structural subelements`_ | |
+ +---+-----------------------------+---------------------------+ +
+ | | `bibliographic elements`_ | `decorative elements`_ | |
+ +---+-----------------------------+---------------------------+---+
+ | [`body elements`_] |
+ +---+-----------------------------+---------------------------+---+
+ | [`body subelements`_] | | |
+ +---+-----------------------------+---------------------------+ +
+ | | [`inline elements`_] | |
+ +---+---------------------------------------------------------+---+
+ | text |
+ +-----------------------------------------------------------------+
Every element has a unique structure and semantics, but elements may be
classified into general categories according to their place and role in
@@ -900,6 +907,7 @@
,
Anne Elk, London, 1972.
+
<classifier>
============
@@ -988,7 +996,7 @@
:Parents: all elements employing `%body.elements`_, `%structure.model`_,
or `%text.model`_ in their content models
:Children: only text data
-:Attributes: `xml:space`_ and the `common attributes`_.
+:Attributes: the `common attributes`_ and `xml:space`_.
Examples
--------
@@ -2561,7 +2569,7 @@
The statement :python:`print("hello world")`
writes ``"hello world"`` to standard output.
-Pseudo-XML_ fragment after parsing and applying the transform_::
+Pseudo-XML_ fragment from simple parsing::
<paragraph>
The statement
@@ -3040,9 +3048,73 @@
<pending>
=========
-`To be completed`_.
+The <pending> element is a placeholder for a pending transform_.
+:Category: `Body Elements`_ (empty)
+:Analogues: <pending> has no direct analogues in common DTDs.
+:Processing: Usually replaced or removed by the associated transform_.
+ Writers may ignore remaining <pending> elements.
+:Parents: all elements employing `%body.elements`_ or
+ `%structure.model`_ in their content models
+:Children: none (empty)
+:Attributes: only the `common attributes`_.
+Example
+-------
+
+The reStructuredText `"contents" directive`_ indicates that an auto-generated
+table of contents (ToC) should be inserted at this point::
+
+ .. contents::
+ :depth: 1
+
+ first section
+ =============
+
+ second section
+ ==============
+
+As the ToC can't be generated until the entire document has been parsed,
+simple parsing adds a `\<topic>`_ with a <pending> element as placeholder::
+
+ <topic classes="contents" ids="contents" names="contents">
+ <title>
+ Contents
+ <pending>
+ .. internal attributes:
+ .transform: docutils.transforms.parts.Contents
+ .details:
+ depth: 1
+ <section ids="first-section" names="first\ section">
+ <title>
+ first section
+ <section ids="second-section" names="second\ section">
+ <title>
+ second section
+
+After parsing is completed, the associated `parts.Contents` transform_
+replaces the <pending> node with the table of contents::
+
+ <topic classes="contents" ids="contents" names="contents">
+ <title>
+ Contents
+ <bullet_list>
+ <list_item>
+ <paragraph>
+ <reference ids="toc-entry-1" refid="first-section">
+ first section
+ <list_item>
+ <paragraph>
+ <reference ids="toc-entry-2" refid="second-section">
+ second section
+ <section ids="first-section" names="first\ section">
+ <title refid="toc-entry-1">
+ first section
+ <section ids="second-section" names="second\ section">
+ <title refid="toc-entry-2">
+ second section
+
+
<problematic>
=============
@@ -3119,9 +3191,101 @@
<reference>
===========
-`To be completed`_.
+The <reference> element represents a cross reference
+to another element of the document or to an external source.
+:Category: `Simple Body Elements`_, `Inline Elements`_
+:Analogues: The <reference> element is analogous to the DocBook_ <link>
+ element and the HTML_ <a> (anchor) element.
+:Processing: If possible, make the content of the link element an active link.
+ In print media, the target might be ignored, printed after the
+ text of the <reference>, printed as a footnote [#]_, or rendered
+ in some other way.
+:Parents: all elements employing `%body.elements`_, `%text.model`_,
+ or `%structure.model`_ in their content models
+:Children: text data plus `inline elements`_ (`%text.model`_)
+:Attributes: anonymous_, name_ (deprecated), refid_, refname_, refuri_, and
+ the `common attributes`_.
+.. [#] See the `"target-notes" directive`_.
+
+Examples
+--------
+
+In reStructuredText `hyperlink references`_ are indicated by a trailing
+underscore::
+
+ References may use simple_ reference names,
+ `phrase refs`_, or `no reference name`__.
+
+ Matching targets must exist in the document, e.g., a
+ _`simple` inline target or the explicit targets below.
+
+ .. _phrase refs: doctree.rst
+ __ http://example.org
+
+Pseudo-XML_ fragment from simple parsing::
+
+ <paragraph>
+ References may use
+ <reference refname="simple">
+ simple
+ reference names,
+ <reference refname="phrase refs">
+ phrase refs
+ , or
+ <reference anonymous="1">
+ no reference name
+ .
+ <paragraph>
+ Matching targets must exist in the document, e.g., a
+ <target ids="simple" names="simple">
+ simple
+ inline target or the explicit targets below.
+ <target ids="phrase-refs" names="phrase\ refs" refuri="doctree.rst">
+ <target anonymous="1" ids="target-1" refuri="http://example.org">
+
+Docutils uses transforms_ to match references and targets and
+replace the refname_ with a refid_ or refuri_::
+
+ <paragraph>
+ References may use
+ <reference refid="simple">
+ simple
+ reference names,
+ <reference refuri="doctree.rst">
+ phrase refs
+ , or
+ <reference anonymous="1" refuri="http://example.org">
+ no reference name
+ .
+ <paragraph>
+ Matching targets must exist in the document, e.g., a
+ <target ids="simple" names="simple">
+ simple
+ inline target or the explicit targets below.
+ <target ids="phrase-refs" names="phrase\ refs" refuri="doctree.rst">
+ <target anonymous="1" ids="target-1" refuri="http://example.org">
+
+`Standalone hyperlinks`_ and `clickable images <rst/directives.html#target>`__
+generate <reference> elements, too::
+
+ Visit https://hamburg.de.
+
+ .. image:: michel.jpg
+ :target: https://hamburg.de
+
+Pseudo-XML_ fragment from simple parsing::
+
+ <paragraph>
+ Visit
+ <reference refuri="https://hamburg.de">
+ https://hamburg.de
+ .
+ <reference refuri="https://hamburg.de">
+ <image uri="michel.jpg">
+
+
<revision>
==========
@@ -4267,11 +4431,7 @@
are not familiar with the variant expressed should be able to ignore
the attribute.
-.. _reader: ../peps/pep-0258.html#readers
-.. _writer:
-.. _writers: ../peps/pep-0258.html#writers
-
``char``
========
@@ -4563,7 +4723,7 @@
.. [#] An element may have both ``names`` and ``dupnames`` attributes,
if the ``dupnames`` are from conflicting `implicit hyperlink targets`_
- and the ``names`` from `internal hyperlink targets`_ or a directive's
+ and the ``names`` from `explicit hyperlink targets`_ or a directive's
`name option`_.
@@ -5145,6 +5305,7 @@
The ``%body.elements`` parameter entity contains an OR-list of all
`Body Elements`_.
+
The `%additional.body.elements`_ placeholder can be used by
wrapper DTDs to extend ``%body.elements``.
@@ -5495,7 +5656,6 @@
.. _XML: https://developer.mozilla.org/en-US/docs/Web/XML/XML_introduction
.. _Introducing the Extensible Markup Language (XML):
http://xml.coverpages.org/xmlIntro.html
-.. _XMLSpec: https://www.w3.org/XML/1998/06/xmlspec-report.htm
.. _external DTD subset: https://www.w3.org/TR/xml11/#sec-external-ent
.. _XML attribute types: https://www.w3.org/TR/REC-xml/#sec-attribute-types
.. _One ID per Element Type: https://www.w3.org/TR/REC-xml/#one-id-per-el
@@ -5521,7 +5681,10 @@
.. _DocInfo transform: ../api/transforms.html#docinfo
.. _DocTitle transform: ../api/transforms.html#doctitle
+.. _reader: ../peps/pep-0258.html#readers
.. _severity level: ../peps/pep-0258.html#error-handling
+.. _writer:
+.. _writers: ../peps/pep-0258.html#writers
.. _reStructuredText: rst/introduction.html
.. _A ReStructuredText Primer: ../user/rst/quickstart.html
@@ -5544,17 +5707,17 @@
.. _doctest block: rst/restructuredtext.html#doctest-blocks
.. _emphasis markup: rst/restructuredtext.html#emphasis
.. _enumerated list: rst/restructuredtext.html#enumerated-lists
+.. _explicit hyperlink targets: rst/restructuredtext.html#hyperlink-targets
.. _explicit markup construct:
.. _explicit markup blocks: rst/restructuredtext.html#explicit-markup-blocks
.. _footnote reference: rst/restructuredtext.html#footnote-references
.. _grid table: rst/restructuredtext.html#grid-tables
+.. _hyperlink references: rst/restructuredtext.html#hyperlink-references
+.. _implicit hyperlink targets: rst/restructuredtext.html#implicit-hyperlink-targets
.. _indirect target: rst/restructuredtext.html#indirect-hyperlink-targets
.. _inline literals: rst/restructuredtext.html#inline-literals
.. _inline markup: rst/restructuredtext.html#inline-markup
-.. _implicit hyperlink targets:
- rst/restructuredtext.html#implicit-hyperlink-targets
-.. _internal hyperlink targets:
- rst/restructuredtext.html#internal-hyperlink-targets
+.. _internal hyperlink targets: rst/restructuredtext.html#internal-hyperlink-targets
.. _line block: rst/restructuredtext.html#line-blocks
.. _literal block: rst/restructuredtext.html#literal-blocks
.. _footnotes:
@@ -5570,9 +5733,11 @@
.. _section: rst/restructuredtext.html#sections
.. _simple reference name: rst/restructuredtext.html#simple-reference-names
.. _simple table: rst/restructuredtext.html#simple-tables
+.. _standalone hyperlinks: rst/restructuredtext.html#standalone-hyperlinks
.. _strong emphasis: rst/restructuredtext.html#strong-emphasis
.. _substitution definition:
.. _substitutions: rst/restructuredtext.html#substitution-definitions
+.. _hyperlink targets: rst/restructuredtext.html#hyperlink-targets
.. _transition: rst/restructuredtext.html#transitions
.. _standard role: rst/roles.html
@@ -5588,7 +5753,7 @@
.. _"admonition" directive: rst/directives.html#admonition
.. _"attention" directive: rst/directives.html#attention
.. _"caution" directive: rst/directives.html#caution
-.. _"class" directive: rst/directives.html#class
+.. _"class" directive: rst/directives.html#class-1
.. _class option: rst/directives.html#class-option
.. _"code" directive: rst/directives.html#code
.. _"compound" directive: rst/directives.html#compound-paragraph
@@ -5619,6 +5784,7 @@
.. _"sectnum" directive: rst/directives.html#sectnum
.. _"sidebar" directive: rst/directives.html#sidebar
.. _"table" directive: rst/directives.html#table
+.. _"target-notes" directive: rst/directives.html#target-notes
.. _"tip" directive: rst/directives.html#tip
.. _"topic" directive: rst/directives.html#topic
.. _"title" directive: rst/directives.html#title
Modified: trunk/docutils/docs/ref/docutils.dtd
===================================================================
--- trunk/docutils/docs/ref/docutils.dtd 2025-05-13 08:37:56 UTC (rev 10126)
+++ trunk/docutils/docs/ref/docutils.dtd 2025-05-13 20:49:10 UTC (rev 10127)
@@ -190,7 +190,7 @@
<!ENTITY % additional.inline.elements "">
<!ENTITY % inline.elements
- " abbreviation | acronym | citation_reference| emphasis
+ " abbreviation | acronym | citation_reference | emphasis
| footnote_reference | generated | image | inline | literal
| math | problematic | raw | reference
| strong | subscript | substitution_reference | superscript
Modified: trunk/docutils/docs/ref/rst/restructuredtext.rst
===================================================================
--- trunk/docutils/docs/ref/rst/restructuredtext.rst 2025-05-13 08:37:56 UTC (rev 10126)
+++ trunk/docutils/docs/ref/rst/restructuredtext.rst 2025-05-13 20:49:10 UTC (rev 10127)
@@ -2145,7 +2145,7 @@
.. image:: mylogo.jpeg
-A graphic with a caption may included with the `"figure"`_ directive::
+A graphic with a caption may be included with the `"figure"`_ directive::
.. figure:: larch.png
Modified: trunk/docutils/docs/ref/rst/roles.rst
===================================================================
--- trunk/docutils/docs/ref/rst/roles.rst 2025-05-13 08:37:56 UTC (rev 10126)
+++ trunk/docutils/docs/ref/rst/roles.rst 2025-05-13 20:49:10 UTC (rev 10127)
@@ -47,7 +47,7 @@
.. class:: field-indent-12em
-:Aliases: :ab:
+:Aliases: \:ab:
:Doctree Element: `\<abbreviation>`_
An abbreviation used in the document.
Modified: trunk/docutils/docs/user/config.rst
===================================================================
--- trunk/docutils/docs/user/config.rst 2025-05-13 08:37:56 UTC (rev 10126)
+++ trunk/docutils/docs/user/config.rst 2025-05-13 20:49:10 UTC (rev 10127)
@@ -2398,8 +2398,8 @@
.. [#] Docutils recognizes the aliases
"`pycmark <[pycmark parser]_>`__", "`myst <[myst parser]_>`__",
- and "`recommonmark <[recommonmark parser]_>`__" and selects the
- corresponding 3rd-party Markdown parser (if it is installed).
+ and "`recommonmark <[recommonmark parser]_>`__" (deprecated) and selects
+ the corresponding 3rd-party Markdown parser (if it is installed).
The aliases "markdown" and "commonmark" select the first available
parser from this list.
Modified: trunk/docutils/docutils/frontend.py
===================================================================
--- trunk/docutils/docutils/frontend.py 2025-05-13 08:37:56 UTC (rev 10126)
+++ trunk/docutils/docutils/frontend.py 2025-05-13 20:49:10 UTC (rev 10127)
@@ -550,7 +550,7 @@
Updates list attributes by extension rather than by replacement.
Works in conjunction with the `OptionParser.lists` instance attribute.
- Deprecated. Will be removed.
+ Deprecated. Will be removed when switching to the "argparse" module.
"""
def __init__(self, defaults: dict[str, Any] | None = None) -> None:
Modified: trunk/docutils/docutils/nodes.py
===================================================================
--- trunk/docutils/docutils/nodes.py 2025-05-13 08:37:56 UTC (rev 10126)
+++ trunk/docutils/docutils/nodes.py 2025-05-13 20:49:10 UTC (rev 10127)
@@ -6,6 +6,9 @@
"""
Docutils document tree element class library.
+The relationships and semantics of elements and attributes is documented in
+`The Docutils Document Tree`__.
+
Classes in CamelCase are abstract base classes or auxiliary classes. The one
exception is `Text`, for a text (PCDATA) node; uppercase is used to
differentiate from element classes. Classes in lower_case_with_underscores
@@ -17,6 +20,7 @@
``isinstance(node, base_class)`` to determine the position of the node in the
hierarchy.
+__ https://docutils.sourceforge.io/docs/ref/doctree.html
.. _DTD: https://docutils.sourceforge.io/docs/ref/docutils.dtd
"""
This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site.
|
|
From: <mi...@us...> - 2025-05-13 20:49:29
|
Revision: 10128
http://sourceforge.net/p/docutils/code/10128
Author: milde
Date: 2025-05-13 20:49:24 +0000 (Tue, 13 May 2025)
Log Message:
-----------
Relax the transform handling transitions.
Report a WARNING instead of raising an AssertionError, if a
`<transition>` element's parent is neither `<document>` nor `<section>`.
This prevents errors with 3rd-party parsers or some (invalid)
Docutils-XML input.
Downgrade the system message reporting a `<transition>` at an
invalid position from ERROR to WARNING.
Insert the `<system_message>` *after* the transition (instead of before)
to prevent an infinite loop with `document.findall()`
Insert `<system_message>` element only if valid at this position.1
Dangling `<system_messages>` are collected and moved to a
system messages" section by the `universal.Messages` transform).
1This check can lead to overcautious behaviour if there are
other validity violations.
This is an implementation detail, we want to keep it simple.
Adapt "transition" transform tests. Add a test for transitions at
"strange" places (with Docutils-XML sample).
Modified Paths:
--------------
trunk/docutils/docutils/transforms/misc.py
trunk/docutils/test/test_transforms/test_transitions.py
Modified: trunk/docutils/docutils/transforms/misc.py
===================================================================
--- trunk/docutils/docutils/transforms/misc.py 2025-05-13 20:49:10 UTC (rev 10127)
+++ trunk/docutils/docutils/transforms/misc.py 2025-05-13 20:49:24 UTC (rev 10128)
@@ -101,20 +101,30 @@
index = node.parent.index(node)
previous_sibling = node.previous_sibling()
msg = ''
- assert isinstance(node.parent, (nodes.document, nodes.section))
- if index == 0 or isinstance(previous_sibling, (nodes.title,
- nodes.subtitle,
- nodes.meta,
- nodes.decoration)):
+ if not isinstance(node.parent, (nodes.document, nodes.section)):
+ msg = 'Transition must be child of <document> or <section>.'
+ elif index == 0 or isinstance(previous_sibling, (nodes.title,
+ nodes.subtitle,
+ nodes.meta,
+ nodes.decoration)):
msg = 'Document or section may not begin with a transition.'
elif isinstance(previous_sibling, nodes.transition):
msg = ('At least one body element must separate transitions; '
'adjacent transitions are not allowed.')
if msg:
- # Insert before node and update index.
- error = self.document.reporter.error(msg, base_node=node)
- node.parent.insert(index, error)
- index += 1
+ warning = self.document.reporter.warning(msg, base_node=node)
+ # Check, if it is valid to insert a body element
+ node.parent[index] = nodes.paragraph()
+ try:
+ node.parent.validate(recursive=False)
+ except nodes.ValidationError:
+ node.parent[index] = node
+ else:
+ node.parent[index] = node
+ node.parent.insert(index+1, warning)
+ index += 1
+ if not isinstance(node.parent, (nodes.document, nodes.section)):
+ return
assert index < len(node.parent)
if index != len(node.parent) - 1:
# No need to move the node.
@@ -124,14 +134,13 @@
# While sibling is the last node of its parent.
while index == len(sibling.parent) - 1:
sibling = sibling.parent
- # If sibling is the whole document (i.e. it has no parent).
- if sibling.parent is None:
+ if sibling.parent is None: # sibling is the top node (document)
# Transition at the end of document. Do not move the
- # transition up, and place an error behind.
- error = self.document.reporter.error(
- 'Document may not end with a transition.',
- line=node.line)
- node.parent.insert(node.parent.index(node) + 1, error)
+ # transition up, and place a warning behind.
+ warning = self.document.reporter.warning(
+ 'Document may not end with a transition.',
+ base_node=node)
+ node.parent.append(warning)
return
index = sibling.parent.index(sibling)
# Remove the original transition node.
Modified: trunk/docutils/test/test_transforms/test_transitions.py
===================================================================
--- trunk/docutils/test/test_transforms/test_transitions.py 2025-05-13 20:49:10 UTC (rev 10127)
+++ trunk/docutils/test/test_transforms/test_transitions.py 2025-05-13 20:49:24 UTC (rev 10128)
@@ -18,7 +18,7 @@
sys.path.insert(0, str(Path(__file__).resolve().parents[2]))
from docutils.frontend import get_default_settings
-from docutils.parsers.rst import Parser
+from docutils.parsers import rst, docutils_xml
from docutils.transforms.misc import Transitions
from docutils.transforms.universal import TestMessages
from docutils.utils import new_document
@@ -25,9 +25,12 @@
class TransformTestCase(unittest.TestCase):
+
+ maxDiff = None
+
def test_transforms(self):
- parser = Parser()
- settings = get_default_settings(Parser)
+ parser = rst.Parser()
+ settings = get_default_settings(rst.Parser)
settings.warning_stream = ''
for name, (transforms, cases) in totest.items():
for casenum, (case_input, case_expected) in enumerate(cases):
@@ -42,9 +45,29 @@
output = document.pformat()
self.assertEqual(case_expected, output)
+ def test_transfroms_x(self):
+ # test samples given as Docutils XML in `totest_x`
+ # (for document trees that cannot be generated from rST)
+ parser = docutils_xml.Parser()
+ settings = get_default_settings(docutils_xml.Parser)
+ settings.warning_stream = ''
+ for name, (transforms, cases) in totest_x.items():
+ for casenum, (case_input, case_expected) in enumerate(cases):
+ with self.subTest(id=f'totest[{name!r}][{casenum}]'):
+ document = new_document('test data', settings.copy())
+ parser.parse(case_input, document)
+ # Don't do a ``populate_from_components()`` because that
+ # would enable the Transformer's default transforms.
+ document.transformer.add_transforms(transforms)
+ document.transformer.add_transform(TestMessages)
+ document.transformer.apply_transforms()
+ output = document.pformat()
+ self.assertEqual(case_expected, output)
-totest = {}
+totest = {} # rST samples and expected pseudoXML
+totest_x = {} # XML samples and expected pseudoXML
+
totest['transitions'] = ((Transitions,), [
["""\
Section 1
@@ -53,7 +76,7 @@
Subsection 1
------------
-Some text.
+A transition at the end of a section is moved behind the section.
----------
@@ -71,7 +94,7 @@
<title>
Subsection 1
<paragraph>
- Some text.
+ A transition at the end of a section is moved behind the section.
<transition>
<section ids="section-2" names="section\\ 2">
<title>
@@ -103,47 +126,51 @@
["""\
--------
-A section or document may not begin with a transition.
+A system message warns about invalid placement of transitions.
+""",
+"""\
+<document source="test data">
+ <transition>
+ <system_message level="2" line="1" source="test data" type="WARNING">
+ <paragraph>
+ Document or section may not begin with a transition.
+ <paragraph>
+ A system message warns about invalid placement of transitions.
+"""],
+["""\
+The DTD specifies ...
-The DTD specifies that two transitions may not
-be adjacent:
-
--------
--------
---------
-
-The DTD also specifies that a section or document
-may not end with a transition.
-
---------
+... that two transitions may not be adjacent:
""",
"""\
<document source="test data">
- <system_message level="3" line="1" source="test data" type="ERROR">
- <paragraph>
- Document or section may not begin with a transition.
- <transition>
<paragraph>
- A section or document may not begin with a transition.
- <paragraph>
- The DTD specifies that two transitions may not
- be adjacent:
+ The DTD specifies ...
<transition>
- <system_message level="3" line="10" source="test data" type="ERROR">
- <paragraph>
- At least one body element must separate transitions; adjacent transitions are not allowed.
<transition>
- <system_message level="3" line="12" source="test data" type="ERROR">
+ <system_message level="2" line="5" source="test data" type="WARNING">
<paragraph>
At least one body element must separate transitions; adjacent transitions are not allowed.
- <transition>
<paragraph>
+ ... that two transitions may not be adjacent:
+"""],
+["""\
+The DTD also specifies that a section or document
+may not end with a transition.
+
+--------
+""",
+"""\
+<document source="test data">
+ <paragraph>
The DTD also specifies that a section or document
may not end with a transition.
<transition>
- <system_message level="3" line="17" source="test data" type="ERROR">
+ <system_message level="2" line="4" source="test data" type="WARNING">
<paragraph>
Document may not end with a transition.
"""],
@@ -155,13 +182,13 @@
----------
-The next transition is legal:
+Some text after transition.
-----------
-
Section 2
=========
+Some text before the transition.
+
----------
""",
"""\
@@ -171,21 +198,19 @@
<section ids="section-1" names="section\\ 1">
<title>
Section 1
- <system_message level="3" line="6" source="test data" type="ERROR">
+ <transition>
+ <system_message level="2" line="6" source="test data" type="WARNING">
<paragraph>
Document or section may not begin with a transition.
- <transition>
<paragraph>
- The next transition is legal:
- <transition>
+ Some text after transition.
<section ids="section-2" names="section\\ 2">
<title>
Section 2
- <system_message level="3" line="15" source="test data" type="ERROR">
- <paragraph>
- Document or section may not begin with a transition.
+ <paragraph>
+ Some text before the transition.
<transition>
- <system_message level="3" line="15" source="test data" type="ERROR">
+ <system_message level="2" line="15" source="test data" type="WARNING">
<paragraph>
Document may not end with a transition.
"""],
@@ -201,11 +226,11 @@
<paragraph>
A paragraph and two transitions.
<transition>
- <system_message level="3" line="5" source="test data" type="ERROR">
+ <transition>
+ <system_message level="2" line="5" source="test data" type="WARNING">
<paragraph>
At least one body element must separate transitions; adjacent transitions are not allowed.
- <transition>
- <system_message level="3" line="5" source="test data" type="ERROR">
+ <system_message level="2" line="5" source="test data" type="WARNING">
<paragraph>
Document may not end with a transition.
"""],
@@ -222,11 +247,11 @@
<paragraph>
A paragraph, two transitions, and a blank line.
<transition>
- <system_message level="3" line="5" source="test data" type="ERROR">
+ <transition>
+ <system_message level="2" line="5" source="test data" type="WARNING">
<paragraph>
At least one body element must separate transitions; adjacent transitions are not allowed.
- <transition>
- <system_message level="3" line="5" source="test data" type="ERROR">
+ <system_message level="2" line="5" source="test data" type="WARNING">
<paragraph>
Document may not end with a transition.
"""],
@@ -237,10 +262,10 @@
""",
"""\
<document source="test data">
- <system_message level="3" line="1" source="test data" type="ERROR">
+ <transition>
+ <system_message level="2" line="1" source="test data" type="WARNING">
<paragraph>
Document or section may not begin with a transition.
- <transition>
<paragraph>
Document beginning with a transition.
"""],
@@ -254,10 +279,10 @@
"""\
<document source="test data">
<meta content="transition test" name="keywords">
- <system_message level="3" line="3" source="test data" type="ERROR">
+ <transition>
+ <system_message level="2" line="3" source="test data" type="WARNING">
<paragraph>
Document or section may not begin with a transition.
- <transition>
<paragraph>
Document beginning with a transition (meta elements don't count).
"""],
@@ -274,10 +299,10 @@
<header>
<paragraph>
a header
- <system_message level="3" line="3" source="test data" type="ERROR">
+ <transition>
+ <system_message level="2" line="3" source="test data" type="WARNING">
<paragraph>
Document or section may not begin with a transition.
- <transition>
<paragraph>
Document beginning with a transition (decoration elements don't count).
"""],
@@ -291,10 +316,14 @@
----------
-Section 2
-=========
+Implementation Detail
+=====================
-Some text.
+If the element containing the transition is invalid after replacing the
+transition with a body element, the system_message is appended at the end
+of the document (by the "universal.Messages" transform).
+This check can lead to overcautious behaviour if there are other
+validity violations (here: several misplaced transitions).
""",
"""\
<document source="test data">
@@ -301,23 +330,27 @@
<section ids="section-1" names="section\\ 1">
<title>
Section 1
- <system_message level="3" line="4" source="test data" type="ERROR">
- <paragraph>
- Document or section may not begin with a transition.
<transition>
- <system_message level="3" line="6" source="test data" type="ERROR">
- <paragraph>
- At least one body element must separate transitions; adjacent transitions are not allowed.
<transition>
- <system_message level="3" line="8" source="test data" type="ERROR">
- <paragraph>
- At least one body element must separate transitions; adjacent transitions are not allowed.
<transition>
- <section ids="section-2" names="section\\ 2">
+ <section ids="implementation-detail" names="implementation\\ detail">
<title>
- Section 2
+ Implementation Detail
<paragraph>
- Some text.
+ If the element containing the transition is invalid after replacing the
+ transition with a body element, the system_message is appended at the end
+ of the document (by the "universal.Messages" transform).
+ This check can lead to overcautious behaviour if there are other
+ validity violations (here: several misplaced transitions).
+ <system_message level="2" line="4" source="test data" type="WARNING">
+ <paragraph>
+ Document or section may not begin with a transition.
+ <system_message level="2" line="6" source="test data" type="WARNING">
+ <paragraph>
+ At least one body element must separate transitions; adjacent transitions are not allowed.
+ <system_message level="2" line="8" source="test data" type="WARNING">
+ <paragraph>
+ At least one body element must separate transitions; adjacent transitions are not allowed.
"""],
["""\
----------
@@ -326,23 +359,25 @@
----------
""",
+# The placement of <system_message>s in this sample is an implementation
+# detail, see the remarks in the preceding test nr. 11.
"""\
<document source="test data">
- <system_message level="3" line="1" source="test data" type="ERROR">
+ <transition>
+ <transition>
+ <transition>
+ <system_message level="2" line="5" source="test data" type="WARNING">
<paragraph>
+ Document may not end with a transition.
+ <system_message level="2" line="1" source="test data" type="WARNING">
+ <paragraph>
Document or section may not begin with a transition.
- <transition>
- <system_message level="3" line="3" source="test data" type="ERROR">
+ <system_message level="2" line="3" source="test data" type="WARNING">
<paragraph>
At least one body element must separate transitions; adjacent transitions are not allowed.
- <transition>
- <system_message level="3" line="5" source="test data" type="ERROR">
+ <system_message level="2" line="5" source="test data" type="WARNING">
<paragraph>
At least one body element must separate transitions; adjacent transitions are not allowed.
- <transition>
- <system_message level="3" line="5" source="test data" type="ERROR">
- <paragraph>
- Document may not end with a transition.
"""],
["""\
A paragraph.
@@ -355,7 +390,7 @@
<paragraph>
A paragraph.
<transition>
- <system_message level="3" line="3" source="test data" type="ERROR">
+ <system_message level="2" line="3" source="test data" type="WARNING">
<paragraph>
Document may not end with a transition.
"""],
@@ -362,5 +397,47 @@
])
+totest_x['transitions extra'] = ((Transitions,), [
+# currently, a <transition> is only valid inside <document> or <section>
+["""\
+<document>
+ <paragraph>Some text.</paragraph>
+ <transition />
+ <paragraph>Some text.</paragraph>
+ <block_quote>
+ <paragraph>Some text.</paragraph>
+ <transition />
+ <paragraph>Some text.</paragraph>
+ </block_quote>
+ <paragraph>A <transition /> in a paragraph.</paragraph>
+</document>
+""",
+"""\
+<document source="test data">
+ <paragraph>
+ Some text.
+ <transition>
+ <paragraph>
+ Some text.
+ <block_quote>
+ <paragraph>
+ Some text.
+ <transition>
+ <system_message level="2" line="7" source="test data" type="WARNING">
+ <paragraph>
+ Transition must be child of <document> or <section>.
+ <paragraph>
+ Some text.
+ <paragraph>
+ A \n\
+ <transition>
+ in a paragraph.
+ <system_message level="2" line="10" source="test data" type="WARNING">
+ <paragraph>
+ Transition must be child of <document> or <section>.
+"""],
+])
+
+
if __name__ == '__main__':
unittest.main()
This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site.
|
|
From: <mi...@us...> - 2025-05-14 09:18:33
|
Revision: 10130
http://sourceforge.net/p/docutils/code/10130
Author: milde
Date: 2025-05-14 09:18:09 +0000 (Wed, 14 May 2025)
Log Message:
-----------
Log entries for [r10129]. Deprecate `parsers.rst.states.Struct`.
Replace local definition of `parsers.rst.states.Struct` with
an import of `types.SimpleNamespace` (available since Python 3.3).
Modified Paths:
--------------
trunk/docutils/HISTORY.rst
trunk/docutils/RELEASE-NOTES.rst
trunk/docutils/docutils/parsers/rst/states.py
Modified: trunk/docutils/HISTORY.rst
===================================================================
--- trunk/docutils/HISTORY.rst 2025-05-13 20:49:37 UTC (rev 10129)
+++ trunk/docutils/HISTORY.rst 2025-05-14 09:18:09 UTC (rev 10130)
@@ -21,6 +21,14 @@
- Pass default settings to custom parser for included file.
+* docutils/parsers/rst/states.py
+
+ - Remove the list`states.RSTStateMachine.memo.section_parents`
+ (introduced in Docutils 0.22rc1) that broke 3rd-party applications
+ setting up a "mock memo".
+ - Use `types.SimpleNamespace` instead of a local definition for
+ the auxilliary class `states.Struct`.
+
* docutils/writers/_html_base.py
- Fix error when determining the document metadata title from the
Modified: trunk/docutils/RELEASE-NOTES.rst
===================================================================
--- trunk/docutils/RELEASE-NOTES.rst 2025-05-13 20:49:37 UTC (rev 10129)
+++ trunk/docutils/RELEASE-NOTES.rst 2025-05-14 09:18:09 UTC (rev 10130)
@@ -219,8 +219,14 @@
Release 0.22rc2 (unpublished)
=============================
-Nothing yet.
+Fix backwards-compatibility problem:
+ reStructuredText section parsing no longer requires
+ `parsers.rst.states.RSTStateMachine.memo.section_parents`
+ (a cache introduced in Docutils 0.22rc1).
+Deprecate `parsers.rst.states.Struct` (obsoleted by `types.SimpleNamespace`).
+
+
Release 0.22rc1 (2025-05-06)
============================
Modified: trunk/docutils/docutils/parsers/rst/states.py
===================================================================
--- trunk/docutils/docutils/parsers/rst/states.py 2025-05-13 20:49:37 UTC (rev 10129)
+++ trunk/docutils/docutils/parsers/rst/states.py 2025-05-14 09:18:09 UTC (rev 10130)
@@ -26,7 +26,7 @@
- `SpecializedText`: Superclass for continuation lines of Text-variants.
- `Definition`: Second line of potential definition_list_item.
- `Line`: Second line of overlined section title or transition marker.
- - `Struct`: An auxiliary collection class.
+ - `Struct`: obsolete, use `types.SimpleNamespace`.
:Exception classes:
- `MarkupError`
@@ -105,6 +105,7 @@
import re
from types import FunctionType, MethodType
+from types import SimpleNamespace as Struct
from docutils import nodes, statemachine, utils
from docutils import ApplicationError, DataError
@@ -129,14 +130,6 @@
class MarkupMismatch(Exception): pass
-class Struct:
-
- """Stores data attributes for dotted-attribute access."""
-
- def __init__(self, **keywordargs) -> None:
- self.__dict__.update(keywordargs)
-
-
class RSTStateMachine(StateMachineWS):
"""
This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site.
|
|
From: <mi...@us...> - 2025-05-16 13:39:00
|
Revision: 10132
http://sourceforge.net/p/docutils/code/10132
Author: milde
Date: 2025-05-16 13:38:58 +0000 (Fri, 16 May 2025)
Log Message:
-----------
Announce switch to "argparse" for Docutils 2.0 or later.
Modified Paths:
--------------
trunk/docutils/RELEASE-NOTES.rst
trunk/docutils/docs/user/config.rst
trunk/docutils/docutils/frontend.py
Modified: trunk/docutils/RELEASE-NOTES.rst
===================================================================
--- trunk/docutils/RELEASE-NOTES.rst 2025-05-16 12:39:28 UTC (rev 10131)
+++ trunk/docutils/RELEASE-NOTES.rst 2025-05-16 13:38:58 UTC (rev 10132)
@@ -40,7 +40,11 @@
For the rationale, see https://clig.dev/#arguments-and-flags.
+* The `front end tools`_ will use argparse_ for command line parsing
+ in Docutils 2.0 or later.
+ .. _argparse: https://docs.python.org/3/library/argparse.html
+
Document Tree / Docutils DTD
----------------------------
@@ -187,6 +191,10 @@
`states.RSTState.title_inconsistent()`, and `states.Line.eofcheck`
in Docutils 2.0. Ignored since Docutils 0.22.
+* Remove `frontend.OptionParser`, `frontend.Option`, `frontend.Values`,
+ `frontend.store_multiple()`, and `frontend.read_config_file()` when
+ migrating to argparse_ in Docutils 2.0 or later.
+
Misc
----
Modified: trunk/docutils/docs/user/config.rst
===================================================================
--- trunk/docutils/docs/user/config.rst 2025-05-16 12:39:28 UTC (rev 10131)
+++ trunk/docutils/docs/user/config.rst 2025-05-16 13:38:58 UTC (rev 10132)
@@ -2430,7 +2430,7 @@
~~~~~~
Path to an additional configuration file.
The file is processed immediately (if it exists) with
-settings overriding defaults and earlier settings.
+settings overriding defaults and earlier settings. [#config-change]_
Filesystem path settings [#pwd]_ contained within the config file will be
interpreted relative to the config file's location (*not* relative to the
@@ -2437,11 +2437,17 @@
current working directory).
Multiple ``--config`` options may be specified;
-each will be processed in turn.
+each will be processed in turn. [#config-change]_
*Default*: None. *Option*: ``--config``.
+.. [#config-change] After the `transition to the "argparse" module`__,
+ files specified with the ``--config`` option will be appended
+ to the list of `configuration files`_ and evaluated before any
+ other command line arguments.
+ __ ../../RELEASE-NOTES.html#command-line-interface
+
Internal Settings
-----------------
Modified: trunk/docutils/docutils/frontend.py
===================================================================
--- trunk/docutils/docutils/frontend.py 2025-05-16 12:39:28 UTC (rev 10131)
+++ trunk/docutils/docutils/frontend.py 2025-05-16 13:38:58 UTC (rev 10132)
@@ -6,8 +6,8 @@
Command-line and common processing for Docutils front-end tools.
This module is provisional.
-Major changes will happen with the switch from the deprecated
-"optparse" module to "arparse".
+Major changes will happen with the transition from the
+"optparse" module to "arparse" in Docutils 2.0 or later.
Applications should use the high-level API provided by `docutils.core`.
See https://docutils.sourceforge.io/docs/api/runtime-settings.html.
@@ -30,7 +30,7 @@
`get_default_settings()`. New in 0.19.
Option callbacks:
- `store_multiple()`, `read_config_file()`. Deprecated.
+ `store_multiple()`, `read_config_file()`. Deprecated. To be removed.
Setting validators:
`validate_encoding()`, `validate_encoding_error_handler()`,
@@ -101,6 +101,8 @@
Store `None` for each attribute named in `args`, and store the value for
each key (attribute name) in `kwargs`.
+
+ Deprecated. Will be removed with the switch to from optparse to argparse.
"""
for attribute in args:
setattr(parser.values, attribute, None)
@@ -115,6 +117,8 @@
) -> None:
"""
Read a configuration file during option processing. (Option callback.)
+
+ Deprecated. Will be removed with the switch to from optparse to argparse.
"""
try:
new_settings = parser.get_config_file_settings(value)
@@ -508,7 +512,8 @@
def make_one_path_absolute(base_path: StrPath, path: StrPath) -> str:
# deprecated, will be removed
warnings.warn('frontend.make_one_path_absolute() will be removed '
- 'in Docutils 0.23.', DeprecationWarning, stacklevel=2)
+ 'in Docutils 2.0 or later.',
+ DeprecationWarning, stacklevel=2)
return os.path.abspath(os.path.join(base_path, path))
@@ -555,7 +560,7 @@
def __init__(self, defaults: dict[str, Any] | None = None) -> None:
warnings.warn('frontend.Values class will be removed '
- 'in Docutils 0.21 or later.',
+ 'in Docutils 2.0 or later.',
DeprecationWarning, stacklevel=2)
super().__init__(defaults=defaults)
if getattr(self, 'record_dependencies', None) is None:
@@ -606,7 +611,7 @@
def __init__(self, *args: str | None, **kwargs: Any) -> None:
warnings.warn('The frontend.Option class will be removed '
- 'in Docutils 0.21 or later.',
+ 'in Docutils 2.0 or later.',
DeprecationWarning, stacklevel=2)
super().__init__(*args, **kwargs)
@@ -903,7 +908,7 @@
warnings.warn(
'The frontend.OptionParser class will be replaced by a subclass '
- 'of argparse.ArgumentParser in Docutils 0.21 or later.\n '
+ 'of argparse.ArgumentParser in Docutils 2.0 or later.\n '
'To get default settings, use frontend.get_default_settings().',
DeprecationWarning, stacklevel=2)
super().__init__(option_class=Option, add_help_option=False,
@@ -1086,7 +1091,7 @@
if option_parser is not None:
warnings.warn('frontend.ConfigParser.read(): parameter '
'"option_parser" will be removed '
- 'in Docutils 0.21 or later.',
+ 'in Docutils 2.0 or later.',
DeprecationWarning, stacklevel=2)
read_ok = []
if isinstance(filenames, str):
This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site.
|
|
From: <mi...@us...> - 2025-05-20 15:48:31
|
Revision: 10136
http://sourceforge.net/p/docutils/code/10136
Author: milde
Date: 2025-05-20 15:48:27 +0000 (Tue, 20 May 2025)
Log Message:
-----------
Minor edits.
Formatting.
Delayed annotations (from __future__).
Documentation.
Modified Paths:
--------------
trunk/docutils/docs/ref/rst/directives.rst
trunk/docutils/docutils/__main__.py
trunk/docutils/docutils/nodes.py
trunk/docutils/docutils/parsers/docutils_xml.py
trunk/docutils/docutils/parsers/null.py
trunk/docutils/docutils/parsers/recommonmark_wrapper.py
trunk/docutils/docutils/parsers/rst/__init__.py
trunk/docutils/docutils/parsers/rst/directives/tables.py
trunk/docutils/docutils/parsers/rst/roles.py
trunk/docutils/docutils/parsers/rst/states.py
trunk/docutils/docutils/parsers/rst/tableparser.py
trunk/docutils/docutils/readers/doctree.py
trunk/docutils/docutils/readers/pep.py
trunk/docutils/docutils/statemachine.py
trunk/docutils/docutils/transforms/__init__.py
trunk/docutils/docutils/transforms/components.py
trunk/docutils/docutils/transforms/frontmatter.py
trunk/docutils/docutils/transforms/misc.py
trunk/docutils/docutils/transforms/parts.py
trunk/docutils/docutils/transforms/peps.py
trunk/docutils/docutils/transforms/references.py
trunk/docutils/docutils/transforms/universal.py
trunk/docutils/docutils/transforms/writer_aux.py
trunk/docutils/docutils/utils/code_analyzer.py
trunk/docutils/docutils/utils/math/__init__.py
trunk/docutils/docutils/utils/math/math2html.py
trunk/docutils/docutils/utils/math/mathml_elements.py
trunk/docutils/docutils/utils/math/tex2mathml_extern.py
trunk/docutils/docutils/utils/smartquotes.py
trunk/docutils/docutils/writers/docutils_xml.py
trunk/docutils/docutils/writers/html4css1/__init__.py
trunk/docutils/docutils/writers/html5_polyglot/__init__.py
trunk/docutils/docutils/writers/manpage.py
trunk/docutils/docutils/writers/null.py
trunk/docutils/docutils/writers/odf_odt/__init__.py
trunk/docutils/docutils/writers/odf_odt/prepstyles.py
trunk/docutils/docutils/writers/odf_odt/pygmentsformatter.py
trunk/docutils/docutils/writers/pep_html/__init__.py
trunk/docutils/docutils/writers/pseudoxml.py
trunk/docutils/docutils/writers/s5_html/__init__.py
trunk/docutils/docutils/writers/xetex/__init__.py
Modified: trunk/docutils/docs/ref/rst/directives.rst
===================================================================
--- trunk/docutils/docs/ref/rst/directives.rst 2025-05-20 15:07:28 UTC (rev 10135)
+++ trunk/docutils/docs/ref/rst/directives.rst 2025-05-20 15:48:27 UTC (rev 10136)
@@ -1983,7 +1983,7 @@
Only recognized with the `"raw" <"raw" role_>`__ base role.
-_`language` : text
+_`language` : text_ (formal language)
Name of a formal language, passed to Pygments_ for syntax highlighting.
See `supported languages and markup formats`_ for recognized values.
Modified: trunk/docutils/docutils/__main__.py
===================================================================
--- trunk/docutils/docutils/__main__.py 2025-05-20 15:07:28 UTC (rev 10135)
+++ trunk/docutils/docutils/__main__.py 2025-05-20 15:48:27 UTC (rev 10136)
@@ -18,6 +18,10 @@
https://docs.python.org/3/library/__main__.html#main-py-in-python-packages
"""
+from __future__ import annotations
+
+__docformat__ = 'reStructuredText'
+
import argparse
import locale
import sys
Modified: trunk/docutils/docutils/nodes.py
===================================================================
--- trunk/docutils/docutils/nodes.py 2025-05-20 15:07:28 UTC (rev 10135)
+++ trunk/docutils/docutils/nodes.py 2025-05-20 15:48:27 UTC (rev 10136)
@@ -806,11 +806,7 @@
def remove(self, item) -> None:
self.children.remove(item)
- def index(self,
- item,
- start: int = 0,
- stop: int = sys.maxsize,
- ) -> int:
+ def index(self, item, start: int = 0, stop: int = sys.maxsize) -> int:
return self.children.index(item, start, stop)
def previous_sibling(self):
Modified: trunk/docutils/docutils/parsers/docutils_xml.py
===================================================================
--- trunk/docutils/docutils/parsers/docutils_xml.py 2025-05-20 15:07:28 UTC (rev 10135)
+++ trunk/docutils/docutils/parsers/docutils_xml.py 2025-05-20 15:48:27 UTC (rev 10136)
@@ -20,6 +20,10 @@
in any Docutils release without prior notice.
"""
+from __future__ import annotations
+
+__docformat__ = 'reStructuredText'
+
import re
import xml.etree.ElementTree as ET
Modified: trunk/docutils/docutils/parsers/null.py
===================================================================
--- trunk/docutils/docutils/parsers/null.py 2025-05-20 15:07:28 UTC (rev 10135)
+++ trunk/docutils/docutils/parsers/null.py 2025-05-20 15:48:27 UTC (rev 10136)
@@ -4,6 +4,10 @@
"""A do-nothing parser."""
+from __future__ import annotations
+
+__docformat__ = 'reStructuredText'
+
from docutils import parsers
Modified: trunk/docutils/docutils/parsers/recommonmark_wrapper.py
===================================================================
--- trunk/docutils/docutils/parsers/recommonmark_wrapper.py 2025-05-20 15:07:28 UTC (rev 10135)
+++ trunk/docutils/docutils/parsers/recommonmark_wrapper.py 2025-05-20 15:48:27 UTC (rev 10136)
@@ -24,6 +24,10 @@
* The API is not settled and may change with any minor Docutils version.
"""
+from __future__ import annotations
+
+__docformat__ = 'reStructuredText'
+
from docutils import Component
from docutils import nodes
Modified: trunk/docutils/docutils/parsers/rst/__init__.py
===================================================================
--- trunk/docutils/docutils/parsers/rst/__init__.py 2025-05-20 15:07:28 UTC (rev 10135)
+++ trunk/docutils/docutils/parsers/rst/__init__.py 2025-05-20 15:48:27 UTC (rev 10136)
@@ -67,9 +67,10 @@
appropriate).
"""
+from __future__ import annotations
+
__docformat__ = 'reStructuredText'
-
import docutils.parsers
import docutils.statemachine
from docutils.parsers.rst import roles, states
Modified: trunk/docutils/docutils/parsers/rst/directives/tables.py
===================================================================
--- trunk/docutils/docutils/parsers/rst/directives/tables.py 2025-05-20 15:07:28 UTC (rev 10135)
+++ trunk/docutils/docutils/parsers/rst/directives/tables.py 2025-05-20 15:48:27 UTC (rev 10136)
@@ -6,9 +6,10 @@
Directives for table elements.
"""
+from __future__ import annotations
+
__docformat__ = 'reStructuredText'
-
import csv
from urllib.request import urlopen
from urllib.error import URLError
Modified: trunk/docutils/docutils/parsers/rst/roles.py
===================================================================
--- trunk/docutils/docutils/parsers/rst/roles.py 2025-05-20 15:07:28 UTC (rev 10135)
+++ trunk/docutils/docutils/parsers/rst/roles.py 2025-05-20 15:48:27 UTC (rev 10136)
@@ -74,6 +74,8 @@
immediately after the end of the current inline block (can also be empty).
"""
+from __future__ import annotations
+
__docformat__ = 'reStructuredText'
import warnings
Modified: trunk/docutils/docutils/parsers/rst/states.py
===================================================================
--- trunk/docutils/docutils/parsers/rst/states.py 2025-05-20 15:07:28 UTC (rev 10135)
+++ trunk/docutils/docutils/parsers/rst/states.py 2025-05-20 15:48:27 UTC (rev 10136)
@@ -100,9 +100,10 @@
continues with step 1.
"""
+from __future__ import annotations
+
__docformat__ = 'reStructuredText'
-
import re
from types import FunctionType, MethodType
from types import SimpleNamespace as Struct
@@ -117,10 +118,8 @@
from docutils.utils import escape2null, column_width
from docutils.utils import punctuation_chars, urischemes
from docutils.utils import split_escaped_whitespace
-from docutils.utils._roman_numerals import (
- InvalidRomanNumeralError,
- RomanNumeral,
-)
+from docutils.utils._roman_numerals import (InvalidRomanNumeralError,
+ RomanNumeral)
class MarkupError(DataError): pass
Modified: trunk/docutils/docutils/parsers/rst/tableparser.py
===================================================================
--- trunk/docutils/docutils/parsers/rst/tableparser.py 2025-05-20 15:07:28 UTC (rev 10135)
+++ trunk/docutils/docutils/parsers/rst/tableparser.py 2025-05-20 15:48:27 UTC (rev 10136)
@@ -17,9 +17,10 @@
`update_dict_of_lists()`: Merge two dictionaries containing list values.
"""
+from __future__ import annotations
+
__docformat__ = 'reStructuredText'
-
import re
import sys
from docutils import DataError
Modified: trunk/docutils/docutils/readers/doctree.py
===================================================================
--- trunk/docutils/docutils/readers/doctree.py 2025-05-20 15:07:28 UTC (rev 10135)
+++ trunk/docutils/docutils/readers/doctree.py 2025-05-20 15:48:27 UTC (rev 10136)
@@ -4,6 +4,10 @@
"""Reader for existing document trees."""
+from __future__ import annotations
+
+__docformat__ = 'reStructuredText'
+
from docutils import readers, utils, transforms
Modified: trunk/docutils/docutils/readers/pep.py
===================================================================
--- trunk/docutils/docutils/readers/pep.py 2025-05-20 15:07:28 UTC (rev 10135)
+++ trunk/docutils/docutils/readers/pep.py 2025-05-20 15:48:27 UTC (rev 10136)
@@ -6,6 +6,8 @@
Python Enhancement Proposal (PEP) Reader.
"""
+from __future__ import annotations
+
__docformat__ = 'reStructuredText'
from docutils.readers import standalone
Modified: trunk/docutils/docutils/statemachine.py
===================================================================
--- trunk/docutils/docutils/statemachine.py 2025-05-20 15:07:28 UTC (rev 10135)
+++ trunk/docutils/docutils/statemachine.py 2025-05-20 15:48:27 UTC (rev 10136)
@@ -105,6 +105,8 @@
sm.unlink()
"""
+from __future__ import annotations
+
__docformat__ = 'restructuredtext'
import sys
Modified: trunk/docutils/docutils/transforms/__init__.py
===================================================================
--- trunk/docutils/docutils/transforms/__init__.py 2025-05-20 15:07:28 UTC (rev 10135)
+++ trunk/docutils/docutils/transforms/__init__.py 2025-05-20 15:48:27 UTC (rev 10136)
@@ -21,9 +21,10 @@
choose to perform on the parsed document.
"""
+from __future__ import annotations
+
__docformat__ = 'reStructuredText'
-
from docutils import languages, ApplicationError, TransformSpec
Modified: trunk/docutils/docutils/transforms/components.py
===================================================================
--- trunk/docutils/docutils/transforms/components.py 2025-05-20 15:07:28 UTC (rev 10135)
+++ trunk/docutils/docutils/transforms/components.py 2025-05-20 15:48:27 UTC (rev 10136)
@@ -6,11 +6,13 @@
Docutils component-related transforms.
"""
-from docutils.transforms import Transform
+from __future__ import annotations
__docformat__ = 'reStructuredText'
+from docutils.transforms import Transform
+
class Filter(Transform):
"""
Modified: trunk/docutils/docutils/transforms/frontmatter.py
===================================================================
--- trunk/docutils/docutils/transforms/frontmatter.py 2025-05-20 15:07:28 UTC (rev 10135)
+++ trunk/docutils/docutils/transforms/frontmatter.py 2025-05-20 15:48:27 UTC (rev 10136)
@@ -21,6 +21,8 @@
.. _transforms: https://docutils.sourceforge.io/docs/api/transforms.html
"""
+from __future__ import annotations
+
__docformat__ = 'reStructuredText'
import re
Modified: trunk/docutils/docutils/transforms/misc.py
===================================================================
--- trunk/docutils/docutils/transforms/misc.py 2025-05-20 15:07:28 UTC (rev 10135)
+++ trunk/docutils/docutils/transforms/misc.py 2025-05-20 15:48:27 UTC (rev 10136)
@@ -6,6 +6,8 @@
Miscellaneous transforms.
"""
+from __future__ import annotations
+
__docformat__ = 'reStructuredText'
from docutils import nodes
Modified: trunk/docutils/docutils/transforms/parts.py
===================================================================
--- trunk/docutils/docutils/transforms/parts.py 2025-05-20 15:07:28 UTC (rev 10135)
+++ trunk/docutils/docutils/transforms/parts.py 2025-05-20 15:48:27 UTC (rev 10136)
@@ -6,9 +6,10 @@
Transforms related to document parts.
"""
+from __future__ import annotations
+
__docformat__ = 'reStructuredText'
-
import sys
from docutils import nodes
from docutils.transforms import Transform
Modified: trunk/docutils/docutils/transforms/peps.py
===================================================================
--- trunk/docutils/docutils/transforms/peps.py 2025-05-20 15:07:28 UTC (rev 10135)
+++ trunk/docutils/docutils/transforms/peps.py 2025-05-20 15:48:27 UTC (rev 10136)
@@ -11,6 +11,8 @@
- `PEPZero`: Special processing for PEP 0.
"""
+from __future__ import annotations
+
__docformat__ = 'reStructuredText'
import os
Modified: trunk/docutils/docutils/transforms/references.py
===================================================================
--- trunk/docutils/docutils/transforms/references.py 2025-05-20 15:07:28 UTC (rev 10135)
+++ trunk/docutils/docutils/transforms/references.py 2025-05-20 15:48:27 UTC (rev 10136)
@@ -6,6 +6,8 @@
Transforms for resolving references.
"""
+from __future__ import annotations
+
__docformat__ = 'reStructuredText'
from docutils import nodes, utils
Modified: trunk/docutils/docutils/transforms/universal.py
===================================================================
--- trunk/docutils/docutils/transforms/universal.py 2025-05-20 15:07:28 UTC (rev 10135)
+++ trunk/docutils/docutils/transforms/universal.py 2025-05-20 15:48:27 UTC (rev 10136)
@@ -19,6 +19,8 @@
- `Validate`: Validate the document tree, report violations as warning.
"""
+from __future__ import annotations
+
__docformat__ = 'reStructuredText'
import re
Modified: trunk/docutils/docutils/transforms/writer_aux.py
===================================================================
--- trunk/docutils/docutils/transforms/writer_aux.py 2025-05-20 15:07:28 UTC (rev 10135)
+++ trunk/docutils/docutils/transforms/writer_aux.py 2025-05-20 15:48:27 UTC (rev 10136)
@@ -11,6 +11,7 @@
from docutils import writers
from docutils.transforms import writers
"""
+from __future__ import annotations
__docformat__ = 'reStructuredText'
Modified: trunk/docutils/docutils/utils/code_analyzer.py
===================================================================
--- trunk/docutils/docutils/utils/code_analyzer.py 2025-05-20 15:07:28 UTC (rev 10135)
+++ trunk/docutils/docutils/utils/code_analyzer.py 2025-05-20 15:48:27 UTC (rev 10136)
@@ -4,7 +4,10 @@
"""Lexical analysis of formal languages (i.e. code) using Pygments."""
-from docutils import ApplicationError
+from __future__ import annotations
+
+__docformat__ = 'reStructuredText'
+
try:
import pygments
from pygments.lexers import get_lexer_by_name
@@ -13,6 +16,8 @@
except ImportError:
with_pygments = False
+from docutils import ApplicationError
+
# Filter the following token types from the list of class arguments:
unstyled_tokens = ['token', # Token (base token type)
'text', # Token.Text
Modified: trunk/docutils/docutils/utils/math/__init__.py
===================================================================
--- trunk/docutils/docutils/utils/math/__init__.py 2025-05-20 15:07:28 UTC (rev 10135)
+++ trunk/docutils/docutils/utils/math/__init__.py 2025-05-20 15:48:27 UTC (rev 10136)
@@ -23,6 +23,10 @@
:tex2mathml_extern: Wrapper for 3rd party TeX -> MathML converters
"""
+from __future__ import annotations
+
+__docformat__ = 'reStructuredText'
+
# helpers for Docutils math support
# =================================
Modified: trunk/docutils/docutils/utils/math/math2html.py
===================================================================
--- trunk/docutils/docutils/utils/math/math2html.py 2025-05-20 15:07:28 UTC (rev 10135)
+++ trunk/docutils/docutils/utils/math/math2html.py 2025-05-20 15:48:27 UTC (rev 10136)
@@ -21,6 +21,10 @@
# Support for more math commands from the AMS "math-guide".
# 2.0 2021-12-31 Drop 2.7 compatibility code.
+from __future__ import annotations
+
+__docformat__ = 'reStructuredText'
+
import pathlib
import sys
import unicodedata
@@ -27,7 +31,6 @@
from docutils.utils.math import tex2unichar
-
__version__ = '1.3 (2021-06-02)'
Modified: trunk/docutils/docutils/utils/math/mathml_elements.py
===================================================================
--- trunk/docutils/docutils/utils/math/mathml_elements.py 2025-05-20 15:07:28 UTC (rev 10135)
+++ trunk/docutils/docutils/utils/math/mathml_elements.py 2025-05-20 15:48:27 UTC (rev 10136)
@@ -22,6 +22,10 @@
.. _MathML Core: https://www.w3.org/TR/mathml-core/
"""
+from __future__ import annotations
+
+__docformat__ = 'reStructuredText'
+
# Usage:
#
# >>> from mathml_elements import *
Modified: trunk/docutils/docutils/utils/math/tex2mathml_extern.py
===================================================================
--- trunk/docutils/docutils/utils/math/tex2mathml_extern.py 2025-05-20 15:07:28 UTC (rev 10135)
+++ trunk/docutils/docutils/utils/math/tex2mathml_extern.py 2025-05-20 15:48:27 UTC (rev 10136)
@@ -15,6 +15,10 @@
the API is not settled and may change with any minor Docutils version.
"""
+from __future__ import annotations
+
+__docformat__ = 'reStructuredText'
+
import subprocess
from docutils import nodes
Modified: trunk/docutils/docutils/utils/smartquotes.py
===================================================================
--- trunk/docutils/docutils/utils/smartquotes.py 2025-05-20 15:07:28 UTC (rev 10135)
+++ trunk/docutils/docutils/utils/smartquotes.py 2025-05-20 15:48:27 UTC (rev 10136)
@@ -315,6 +315,8 @@
- Initial release
"""
+from __future__ import annotations
+
import re
import sys
Modified: trunk/docutils/docutils/writers/docutils_xml.py
===================================================================
--- trunk/docutils/docutils/writers/docutils_xml.py 2025-05-20 15:07:28 UTC (rev 10135)
+++ trunk/docutils/docutils/writers/docutils_xml.py 2025-05-20 15:48:27 UTC (rev 10136)
@@ -8,6 +8,8 @@
https://docutils.sourceforge.io/docs/ref/docutils.dtd.
"""
+from __future__ import annotations
+
__docformat__ = 'reStructuredText'
from io import StringIO
Modified: trunk/docutils/docutils/writers/html4css1/__init__.py
===================================================================
--- trunk/docutils/docutils/writers/html4css1/__init__.py 2025-05-20 15:07:28 UTC (rev 10135)
+++ trunk/docutils/docutils/writers/html4css1/__init__.py 2025-05-20 15:48:27 UTC (rev 10136)
@@ -12,6 +12,8 @@
for proper viewing with a modern graphical browser.
"""
+from __future__ import annotations
+
__docformat__ = 'reStructuredText'
import os.path
Modified: trunk/docutils/docutils/writers/html5_polyglot/__init__.py
===================================================================
--- trunk/docutils/docutils/writers/html5_polyglot/__init__.py 2025-05-20 15:07:28 UTC (rev 10135)
+++ trunk/docutils/docutils/writers/html5_polyglot/__init__.py 2025-05-20 15:48:27 UTC (rev 10136)
@@ -24,6 +24,9 @@
The cascading style sheet "minimal.css" is required for proper viewing,
the style sheet "plain.css" improves reading experience.
"""
+
+from __future__ import annotations
+
__docformat__ = 'reStructuredText'
from pathlib import Path
Modified: trunk/docutils/docutils/writers/manpage.py
===================================================================
--- trunk/docutils/docutils/writers/manpage.py 2025-05-20 15:07:28 UTC (rev 10135)
+++ trunk/docutils/docutils/writers/manpage.py 2025-05-20 15:48:27 UTC (rev 10136)
@@ -41,6 +41,8 @@
"""
+from __future__ import annotations
+
__docformat__ = 'reStructuredText'
import re
@@ -359,11 +361,11 @@
# a) a line end, disable it
if self.body[i+1][0] in ('\n', '\r'):
self.body[i+1] = '.' + self.body[i+1]
- # b) with a separator: moving the 1st char to current item
- # would require to check the second, use \c instead.
+ # b) with a separator: moving the 1st char to current item
+ # would require to check the second, use \c instead.
else:
- # append \c to end the text line, .ME or .UE without inserting
- # space or attempting a break.
+ # append \c to end the text line, .ME or .UE without
+ # inserting space or attempting a break.
self.body[i] = "%s \\c\n" % (self.body[i][:3])
return ''.join(self.head + self.body + self.foot)
Modified: trunk/docutils/docutils/writers/null.py
===================================================================
--- trunk/docutils/docutils/writers/null.py 2025-05-20 15:07:28 UTC (rev 10135)
+++ trunk/docutils/docutils/writers/null.py 2025-05-20 15:48:27 UTC (rev 10136)
@@ -9,6 +9,10 @@
in Docutils 0.22.
"""
+from __future__ import annotations
+
+__docformat__ = 'reStructuredText'
+
from docutils import writers
Modified: trunk/docutils/docutils/writers/odf_odt/__init__.py
===================================================================
--- trunk/docutils/docutils/writers/odf_odt/__init__.py 2025-05-20 15:07:28 UTC (rev 10135)
+++ trunk/docutils/docutils/writers/odf_odt/__init__.py 2025-05-20 15:48:27 UTC (rev 10136)
@@ -9,9 +9,10 @@
the API is not settled and may change with any minor Docutils version.
"""
+from __future__ import annotations
+
__docformat__ = 'reStructuredText'
-
from configparser import ConfigParser
import copy
from io import StringIO
Modified: trunk/docutils/docutils/writers/odf_odt/prepstyles.py
===================================================================
--- trunk/docutils/docutils/writers/odf_odt/prepstyles.py 2025-05-20 15:07:28 UTC (rev 10135)
+++ trunk/docutils/docutils/writers/odf_odt/prepstyles.py 2025-05-20 15:48:27 UTC (rev 10136)
@@ -11,6 +11,8 @@
See https://docutils.sourceforge.io/docs/user/odt.html#page-size
"""
+from __future__ import annotations
+
# Author: Michael Schutte <mi...@ui...>
from xml.etree import ElementTree as ET
Modified: trunk/docutils/docutils/writers/odf_odt/pygmentsformatter.py
===================================================================
--- trunk/docutils/docutils/writers/odf_odt/pygmentsformatter.py 2025-05-20 15:07:28 UTC (rev 10135)
+++ trunk/docutils/docutils/writers/odf_odt/pygmentsformatter.py 2025-05-20 15:48:27 UTC (rev 10136)
@@ -2,13 +2,10 @@
# Author: Dave Kuhlman <dku...@re...>
# Copyright: This module has been placed in the public domain.
-"""
+"""Additional support for Pygments formatter."""
-Additional support for Pygments formatter.
+from __future__ import annotations
-"""
-
-
import pygments
import pygments.formatter
Modified: trunk/docutils/docutils/writers/pep_html/__init__.py
===================================================================
--- trunk/docutils/docutils/writers/pep_html/__init__.py 2025-05-20 15:07:28 UTC (rev 10135)
+++ trunk/docutils/docutils/writers/pep_html/__init__.py 2025-05-20 15:48:27 UTC (rev 10136)
@@ -6,9 +6,10 @@
PEP HTML Writer.
"""
+from __future__ import annotations
+
__docformat__ = 'reStructuredText'
-
import os
import os.path
Modified: trunk/docutils/docutils/writers/pseudoxml.py
===================================================================
--- trunk/docutils/docutils/writers/pseudoxml.py 2025-05-20 15:07:28 UTC (rev 10135)
+++ trunk/docutils/docutils/writers/pseudoxml.py 2025-05-20 15:48:27 UTC (rev 10136)
@@ -6,9 +6,10 @@
Simple internal document tree Writer, writes indented pseudo-XML.
"""
+from __future__ import annotations
+
__docformat__ = 'reStructuredText'
-
from docutils import writers, frontend
Modified: trunk/docutils/docutils/writers/s5_html/__init__.py
===================================================================
--- trunk/docutils/docutils/writers/s5_html/__init__.py 2025-05-20 15:07:28 UTC (rev 10135)
+++ trunk/docutils/docutils/writers/s5_html/__init__.py 2025-05-20 15:48:27 UTC (rev 10136)
@@ -6,6 +6,7 @@
"""
S5/HTML Slideshow Writer.
"""
+from __future__ import annotations
__docformat__ = 'reStructuredText'
Modified: trunk/docutils/docutils/writers/xetex/__init__.py
===================================================================
--- trunk/docutils/docutils/writers/xetex/__init__.py 2025-05-20 15:07:28 UTC (rev 10135)
+++ trunk/docutils/docutils/writers/xetex/__init__.py 2025-05-20 15:48:27 UTC (rev 10136)
@@ -20,6 +20,8 @@
LuaTeX and XeTeX.
"""
+from __future__ import annotations
+
__docformat__ = 'reStructuredText'
from docutils import frontend
This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site.
|
|
From: <mi...@us...> - 2025-05-20 15:48:45
|
Revision: 10137
http://sourceforge.net/p/docutils/code/10137
Author: milde
Date: 2025-05-20 15:48:42 +0000 (Tue, 20 May 2025)
Log Message:
-----------
More detailled error message for inconsistent title levels.
Modified Paths:
--------------
trunk/docutils/docutils/parsers/rst/states.py
trunk/docutils/test/test_parsers/test_rst/test_section_headers.py
Modified: trunk/docutils/docutils/parsers/rst/states.py
===================================================================
--- trunk/docutils/docutils/parsers/rst/states.py 2025-05-20 15:48:27 UTC (rev 10136)
+++ trunk/docutils/docutils/parsers/rst/states.py 2025-05-20 15:48:42 UTC (rev 10137)
@@ -341,10 +341,14 @@
# The new level must not be deeper than an immediate child
# of the current level:
if level > mylevel + 1:
+ styles = " ".join("/".join(s for s in style)
+ for style in title_styles)
self.parent += self.reporter.severe(
- 'Title level inconsistent:',
- nodes.literal_block('', source),
- line=lineno)
+ 'Inconsistent title style:'
+ f' skip from level {mylevel} to {level}.',
+ nodes.literal_block('', source),
+ nodes.paragraph('', f'Established title styles: {styles}'),
+ line=lineno)
return False
# Update parent state:
self.memo.section_level = level
Modified: trunk/docutils/test/test_parsers/test_rst/test_section_headers.py
===================================================================
--- trunk/docutils/test/test_parsers/test_rst/test_section_headers.py 2025-05-20 15:48:27 UTC (rev 10136)
+++ trunk/docutils/test/test_parsers/test_rst/test_section_headers.py 2025-05-20 15:48:42 UTC (rev 10137)
@@ -22,6 +22,9 @@
class ParserTestCase(unittest.TestCase):
+
+ maxDiff = None
+
def test_parser(self):
parser = Parser()
settings = get_default_settings(Parser)
@@ -494,10 +497,12 @@
Paragraph 3.
<system_message level="4" line="15" source="test data" type="SEVERE">
<paragraph>
- Title level inconsistent:
+ Inconsistent title style: skip from level 1 to 3.
<literal_block xml:space="preserve">
Title 4
```````
+ <paragraph>
+ Established title styles: = - `
<paragraph>
Paragraph 4.
"""],
@@ -545,11 +550,13 @@
Paragraph 3.
<system_message level="4" line="19" source="test data" type="SEVERE">
<paragraph>
- Title level inconsistent:
+ Inconsistent title style: skip from level 1 to 3.
<literal_block xml:space="preserve">
```````
Title 4
```````
+ <paragraph>
+ Established title styles: =/= -/- `/`
<paragraph>
Paragraph 4.
"""],
This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site.
|
|
From: <gr...@us...> - 2025-05-22 19:18:55
|
Revision: 10138
http://sourceforge.net/p/docutils/code/10138
Author: grubert
Date: 2025-05-22 19:18:51 +0000 (Thu, 22 May 2025)
Log Message:
-----------
version 0.22rc2
Modified Paths:
--------------
trunk/docutils/HISTORY.rst
trunk/docutils/README.rst
trunk/docutils/RELEASE-NOTES.rst
trunk/docutils/docutils/__init__.py
trunk/docutils/test/functional/expected/buggy_mathml.html
trunk/docutils/test/functional/expected/buggy_mathml_blahtexml.html
trunk/docutils/test/functional/expected/buggy_mathml_pandoc.html
trunk/docutils/test/functional/expected/buggy_mathml_ttm.html
trunk/docutils/test/functional/expected/compact_lists.html
trunk/docutils/test/functional/expected/dangerous.html
trunk/docutils/test/functional/expected/field_name_limit.html
trunk/docutils/test/functional/expected/footnotes_html5.html
trunk/docutils/test/functional/expected/length_units_html5.html
trunk/docutils/test/functional/expected/math_experiments_mathml.html
trunk/docutils/test/functional/expected/math_experiments_mathml_blahtexml.html
trunk/docutils/test/functional/expected/math_experiments_mathml_pandoc.html
trunk/docutils/test/functional/expected/math_experiments_mathml_ttm.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/mathematics_mathml.html
trunk/docutils/test/functional/expected/mathematics_mathml_blahtexml.html
trunk/docutils/test/functional/expected/mathematics_mathml_pandoc.html
trunk/docutils/test/functional/expected/mathematics_mathml_ttm.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_manpage.man
trunk/docutils/test/functional/expected/standalone_rst_s5_html_1.html
trunk/docutils/test/functional/expected/standalone_rst_s5_html_2.html
trunk/docutils/test/test_writers/test_manpage.py
Modified: trunk/docutils/HISTORY.rst
===================================================================
--- trunk/docutils/HISTORY.rst 2025-05-20 15:48:42 UTC (rev 10137)
+++ trunk/docutils/HISTORY.rst 2025-05-22 19:18:51 UTC (rev 10138)
@@ -14,9 +14,15 @@
.. contents::
-Release 0.22rc2 (unpublished)
+Release 0.22rc3 (unpublished)
=============================
+* nothing yet.
+
+Release 0.22rc2 (2025-05-22)
+============================
+
+
* docutils/parsers/rst/directives/misc.py
- Pass default settings to custom parser for included file.
Modified: trunk/docutils/README.rst
===================================================================
--- trunk/docutils/README.rst 2025-05-20 15:48:42 UTC (rev 10137)
+++ trunk/docutils/README.rst 2025-05-22 19:18:51 UTC (rev 10138)
@@ -1,5 +1,5 @@
==========================
- README: Docutils 0.22rc2.dev
+ README: Docutils 0.22rc2
==========================
:Author: David Goodger
Modified: trunk/docutils/RELEASE-NOTES.rst
===================================================================
--- trunk/docutils/RELEASE-NOTES.rst 2025-05-20 15:48:42 UTC (rev 10137)
+++ trunk/docutils/RELEASE-NOTES.rst 2025-05-22 19:18:51 UTC (rev 10138)
@@ -224,9 +224,14 @@
__ https://packages.debian.org/source/trixie/python-docutils
-Release 0.22rc2 (unpublished)
+Release 0.22rc3 (unpublished)
=============================
+* nothing yet.
+
+Release 0.22rc2 (2025-05-22)
+============================
+
Fix backwards-compatibility problem:
reStructuredText section parsing no longer requires
`parsers.rst.states.RSTStateMachine.memo.section_parents`
Modified: trunk/docutils/docutils/__init__.py
===================================================================
--- trunk/docutils/docutils/__init__.py 2025-05-20 15:48:42 UTC (rev 10137)
+++ trunk/docutils/docutils/__init__.py 2025-05-22 19:18:51 UTC (rev 10138)
@@ -84,7 +84,7 @@
__docformat__ = 'reStructuredText'
-__version__ = '0.22rc2.dev'
+__version__ = '0.22rc2'
"""Docutils version identifier (complies with PEP 440)::
major.minor[.micro][releaselevel[serial]][.dev]
@@ -161,7 +161,7 @@
micro=0,
releaselevel='candidate', # 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
+ release=True # True for official releases and pre-releases
)
"""Comprehensive version information tuple.
Modified: trunk/docutils/test/functional/expected/buggy_mathml.html
===================================================================
--- trunk/docutils/test/functional/expected/buggy_mathml.html 2025-05-20 15:48:42 UTC (rev 10137)
+++ trunk/docutils/test/functional/expected/buggy_mathml.html 2025-05-22 19:18:51 UTC (rev 10138)
@@ -2,7 +2,7 @@
<html xmlns="http://www.w3.org/1999/xhtml" xml:lang="en" lang="en">
<head>
<meta charset="utf-8" />
-<meta name="generator" content="Docutils 0.22rc2.dev: https://docutils.sourceforge.io/" />
+<meta name="generator" content="Docutils 0.22rc2: https://docutils.sourceforge.io/" />
<meta name="viewport" content="width=device-width, initial-scale=1" />
<title>buggy-maths</title>
<link rel="stylesheet" href="../../../docutils/writers/html5_polyglot/minimal.css" type="text/css" />
Modified: trunk/docutils/test/functional/expected/buggy_mathml_blahtexml.html
===================================================================
--- trunk/docutils/test/functional/expected/buggy_mathml_blahtexml.html 2025-05-20 15:48:42 UTC (rev 10137)
+++ trunk/docutils/test/functional/expected/buggy_mathml_blahtexml.html 2025-05-22 19:18:51 UTC (rev 10138)
@@ -2,7 +2,7 @@
<html xmlns="http://www.w3.org/1999/xhtml" xml:lang="en" lang="en">
<head>
<meta charset="utf-8" />
-<meta name="generator" content="Docutils 0.22rc2.dev: https://docutils.sourceforge.io/" />
+<meta name="generator" content="Docutils 0.22rc2: https://docutils.sourceforge.io/" />
<meta name="viewport" content="width=device-width, initial-scale=1" />
<title>buggy-maths</title>
<link rel="stylesheet" href="../../../docutils/writers/html5_polyglot/minimal.css" type="text/css" />
Modified: trunk/docutils/test/functional/expected/buggy_mathml_pandoc.html
===================================================================
--- trunk/docutils/test/functional/expected/buggy_mathml_pandoc.html 2025-05-20 15:48:42 UTC (rev 10137)
+++ trunk/docutils/test/functional/expected/buggy_mathml_pandoc.html 2025-05-22 19:18:51 UTC (rev 10138)
@@ -2,7 +2,7 @@
<html xmlns="http://www.w3.org/1999/xhtml" xml:lang="en" lang="en">
<head>
<meta charset="utf-8" />
-<meta name="generator" content="Docutils 0.22rc2.dev: https://docutils.sourceforge.io/" />
+<meta name="generator" content="Docutils 0.22rc2: https://docutils.sourceforge.io/" />
<meta name="viewport" content="width=device-width, initial-scale=1" />
<title>buggy-maths</title>
<link rel="stylesheet" href="../../../docutils/writers/html5_polyglot/minimal.css" type="text/css" />
Modified: trunk/docutils/test/functional/expected/buggy_mathml_ttm.html
===================================================================
--- trunk/docutils/test/functional/expected/buggy_mathml_ttm.html 2025-05-20 15:48:42 UTC (rev 10137)
+++ trunk/docutils/test/functional/expected/buggy_mathml_ttm.html 2025-05-22 19:18:51 UTC (rev 10138)
@@ -2,7 +2,7 @@
<html xmlns="http://www.w3.org/1999/xhtml" xml:lang="en" lang="en">
<head>
<meta charset="utf-8" />
-<meta name="generator" content="Docutils 0.22rc2.dev: https://docutils.sourceforge.io/" />
+<meta name="generator" content="Docutils 0.22rc2: https://docutils.sourceforge.io/" />
<meta name="viewport" content="width=device-width, initial-scale=1" />
<title>buggy-maths</title>
<link rel="stylesheet" href="../../../docutils/writers/html5_polyglot/minimal.css" type="text/css" />
Modified: trunk/docutils/test/functional/expected/compact_lists.html
===================================================================
--- trunk/docutils/test/functional/expected/compact_lists.html 2025-05-20 15:48:42 UTC (rev 10137)
+++ trunk/docutils/test/functional/expected/compact_lists.html 2025-05-22 19:18:51 UTC (rev 10138)
@@ -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.22rc2.dev: https://docutils.sourceforge.io/" />
+<meta name="generator" content="Docutils 0.22rc2: https://docutils.sourceforge.io/" />
<title>compact_lists.rst</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 2025-05-20 15:48:42 UTC (rev 10137)
+++ trunk/docutils/test/functional/expected/dangerous.html 2025-05-22 19:18:51 UTC (rev 10138)
@@ -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.22rc2.dev: https://docutils.sourceforge.io/" />
+<meta name="generator" content="Docutils 0.22rc2: https://docutils.sourceforge.io/" />
<title>dangerous.rst</title>
<link rel="stylesheet" href="../input/data/html4css1.css" type="text/css" />
</head>
Modified: trunk/docutils/test/functional/expected/field_name_limit.html
===================================================================
--- trunk/docutils/test/functional/expected/field_name_limit.html 2025-05-20 15:48:42 UTC (rev 10137)
+++ trunk/docutils/test/functional/expected/field_name_limit.html 2025-05-22 19:18:51 UTC (rev 10138)
@@ -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.22rc2.dev: https://docutils.sourceforge.io/" />
+<meta name="generator" content="Docutils 0.22rc2: https://docutils.sourceforge.io/" />
<title>field_list.rst</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 2025-05-20 15:48:42 UTC (rev 10137)
+++ trunk/docutils/test/functional/expected/footnotes_html5.html 2025-05-22 19:18:51 UTC (rev 10138)
@@ -2,7 +2,7 @@
<html xmlns="http://www.w3.org/1999/xhtml" xml:lang="en" lang="en">
<head>
<meta charset="utf-8" />
-<meta name="generator" content="Docutils 0.22rc2.dev: https://docutils.sourceforge.io/" />
+<meta name="generator" content="Docutils 0.22rc2: https://docutils.sourceforge.io/" />
<meta name="viewport" content="width=device-width, initial-scale=1" />
<title>Test footnote and citation rendering</title>
<link rel="stylesheet" href="../input/data/minimal.css" type="text/css" />
Modified: trunk/docutils/test/functional/expected/length_units_html5.html
===================================================================
--- trunk/docutils/test/functional/expected/length_units_html5.html 2025-05-20 15:48:42 UTC (rev 10137)
+++ trunk/docutils/test/functional/expected/length_units_html5.html 2025-05-22 19:18:51 UTC (rev 10138)
@@ -2,7 +2,7 @@
<html xmlns="http://www.w3.org/1999/xhtml" xml:lang="en" lang="en">
<head>
<meta charset="utf-8" />
-<meta name="generator" content="Docutils 0.22rc2.dev: https://docutils.sourceforge.io/" />
+<meta name="generator" content="Docutils 0.22rc2: https://docutils.sourceforge.io/" />
<meta name="viewport" content="width=device-width, initial-scale=1" />
<title>Test length specifications</title>
<link rel="stylesheet" href="../input/data/minimal.css" type="text/css" />
Modified: trunk/docutils/test/functional/expected/math_experiments_mathml.html
===================================================================
--- trunk/docutils/test/functional/expected/math_experiments_mathml.html 2025-05-20 15:48:42 UTC (rev 10137)
+++ trunk/docutils/test/functional/expected/math_experiments_mathml.html 2025-05-22 19:18:51 UTC (rev 10138)
@@ -2,7 +2,7 @@
<html xmlns="http://www.w3.org/1999/xhtml" xml:lang="en" lang="en">
<head>
<meta charset="utf-8" />
-<meta name="generator" content="Docutils 0.22rc2.dev: https://docutils.sourceforge.io/" />
+<meta name="generator" content="Docutils 0.22rc2: https://docutils.sourceforge.io/" />
<meta name="viewport" content="width=device-width, initial-scale=1" />
<title>Math Conversion Tests</title>
<link rel="stylesheet" href="../../../docutils/writers/html5_polyglot/minimal.css" type="text/css" />
Modified: trunk/docutils/test/functional/expected/math_experiments_mathml_blahtexml.html
===================================================================
--- trunk/docutils/test/functional/expected/math_experiments_mathml_blahtexml.html 2025-05-20 15:48:42 UTC (rev 10137)
+++ trunk/docutils/test/functional/expected/math_experiments_mathml_blahtexml.html 2025-05-22 19:18:51 UTC (rev 10138)
@@ -2,7 +2,7 @@
<html xmlns="http://www.w3.org/1999/xhtml" xml:lang="en" lang="en">
<head>
<meta charset="utf-8" />
-<meta name="generator" content="Docutils 0.22rc2.dev: https://docutils.sourceforge.io/" />
+<meta name="generator" content="Docutils 0.22rc2: https://docutils.sourceforge.io/" />
<meta name="viewport" content="width=device-width, initial-scale=1" />
<title>Math Conversion Tests</title>
<link rel="stylesheet" href="../../../docutils/writers/html5_polyglot/minimal.css" type="text/css" />
Modified: trunk/docutils/test/functional/expected/math_experiments_mathml_pandoc.html
===================================================================
--- trunk/docutils/test/functional/expected/math_experiments_mathml_pandoc.html 2025-05-20 15:48:42 UTC (rev 10137)
+++ trunk/docutils/test/functional/expected/math_experiments_mathml_pandoc.html 2025-05-22 19:18:51 UTC (rev 10138)
@@ -2,7 +2,7 @@
<html xmlns="http://www.w3.org/1999/xhtml" xml:lang="en" lang="en">
<head>
<meta charset="utf-8" />
-<meta name="generator" content="Docutils 0.22rc2.dev: https://docutils.sourceforge.io/" />
+<meta name="generator" content="Docutils 0.22rc2: https://docutils.sourceforge.io/" />
<meta name="viewport" content="width=device-width, initial-scale=1" />
<title>Math Conversion Tests</title>
<link rel="stylesheet" href="../../../docutils/writers/html5_polyglot/minimal.css" type="text/css" />
Modified: trunk/docutils/test/functional/expected/math_experiments_mathml_ttm.html
===================================================================
--- trunk/docutils/test/functional/expected/math_experiments_mathml_ttm.html 2025-05-20 15:48:42 UTC (rev 10137)
+++ trunk/docutils/test/functional/expected/math_experiments_mathml_ttm.html 2025-05-22 19:18:51 UTC (rev 10138)
@@ -2,7 +2,7 @@
<html xmlns="http://www.w3.org/1999/xhtml" xml:lang="en" lang="en">
<head>
<meta charset="utf-8" />
-<meta name="generator" content="Docutils 0.22rc2.dev: https://docutils.sourceforge.io/" />
+<meta name="generator" content="Docutils 0.22rc2: https://docutils.sourceforge.io/" />
<meta name="viewport" content="width=device-width, initial-scale=1" />
<title>Math Conversion Tests</title>
<link rel="stylesheet" href="../../../docutils/writers/html5_polyglot/minimal.css" type="text/css" />
Modified: trunk/docutils/test/functional/expected/math_output_html.html
===================================================================
--- trunk/docutils/test/functional/expected/math_output_html.html 2025-05-20 15:48:42 UTC (rev 10137)
+++ trunk/docutils/test/functional/expected/math_output_html.html 2025-05-22 19:18:51 UTC (rev 10138)
@@ -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.22rc2.dev: https://docutils.sourceforge.io/" />
+<meta name="generator" content="Docutils 0.22rc2: 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 2025-05-20 15:48:42 UTC (rev 10137)
+++ trunk/docutils/test/functional/expected/math_output_latex.html 2025-05-22 19:18:51 UTC (rev 10138)
@@ -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.22rc2.dev: https://docutils.sourceforge.io/" />
+<meta name="generator" content="Docutils 0.22rc2: 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 2025-05-20 15:48:42 UTC (rev 10137)
+++ trunk/docutils/test/functional/expected/math_output_mathjax.html 2025-05-22 19:18:51 UTC (rev 10138)
@@ -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.22rc2.dev: https://docutils.sourceforge.io/" />
+<meta name="generator" content="Docutils 0.22rc2: 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 2025-05-20 15:48:42 UTC (rev 10137)
+++ trunk/docutils/test/functional/expected/math_output_mathml.html 2025-05-22 19:18:51 UTC (rev 10138)
@@ -2,7 +2,7 @@
<html xmlns="http://www.w3.org/1999/xhtml" xml:lang="en" lang="en">
<head>
<meta charset="utf-8" />
-<meta name="generator" content="Docutils 0.22rc2.dev: https://docutils.sourceforge.io/" />
+<meta name="generator" content="Docutils 0.22rc2: https://docutils.sourceforge.io/" />
<meta name="viewport" content="width=device-width, initial-scale=1" />
<title>Mathematics</title>
<link rel="stylesheet" href="../input/data/minimal.css" type="text/css" />
Modified: trunk/docutils/test/functional/expected/mathematics_mathml.html
===================================================================
--- trunk/docutils/test/functional/expected/mathematics_mathml.html 2025-05-20 15:48:42 UTC (rev 10137)
+++ trunk/docutils/test/functional/expected/mathematics_mathml.html 2025-05-22 19:18:51 UTC (rev 10138)
@@ -2,7 +2,7 @@
<html xmlns="http://www.w3.org/1999/xhtml" xml:lang="en" lang="en">
<head>
<meta charset="utf-8" />
-<meta name="generator" content="Docutils 0.22rc2.dev: https://docutils.sourceforge.io/" />
+<meta name="generator" content="Docutils 0.22rc2: https://docutils.sourceforge.io/" />
<meta name="viewport" content="width=device-width, initial-scale=1" />
<title>LaTeX syntax for mathematics</title>
<link rel="stylesheet" href="../../../docutils/writers/html5_polyglot/minimal.css" type="text/css" />
Modified: trunk/docutils/test/functional/expected/mathematics_mathml_blahtexml.html
===================================================================
--- trunk/docutils/test/functional/expected/mathematics_mathml_blahtexml.html 2025-05-20 15:48:42 UTC (rev 10137)
+++ trunk/docutils/test/functional/expected/mathematics_mathml_blahtexml.html 2025-05-22 19:18:51 UTC (rev 10138)
@@ -2,7 +2,7 @@
<html xmlns="http://www.w3.org/1999/xhtml" xml:lang="en" lang="en">
<head>
<meta charset="utf-8" />
-<meta name="generator" content="Docutils 0.22rc2.dev: https://docutils.sourceforge.io/" />
+<meta name="generator" content="Docutils 0.22rc2: https://docutils.sourceforge.io/" />
<meta name="viewport" content="width=device-width, initial-scale=1" />
<title>LaTeX syntax for mathematics</title>
<link rel="stylesheet" href="../../../docutils/writers/html5_polyglot/minimal.css" type="text/css" />
Modified: trunk/docutils/test/functional/expected/mathematics_mathml_pandoc.html
===================================================================
--- trunk/docutils/test/functional/expected/mathematics_mathml_pandoc.html 2025-05-20 15:48:42 UTC (rev 10137)
+++ trunk/docutils/test/functional/expected/mathematics_mathml_pandoc.html 2025-05-22 19:18:51 UTC (rev 10138)
@@ -2,7 +2,7 @@
<html xmlns="http://www.w3.org/1999/xhtml" xml:lang="en" lang="en">
<head>
<meta charset="utf-8" />
-<meta name="generator" content="Docutils 0.22rc2.dev: https://docutils.sourceforge.io/" />
+<meta name="generator" content="Docutils 0.22rc2: https://docutils.sourceforge.io/" />
<meta name="viewport" content="width=device-width, initial-scale=1" />
<title>LaTeX syntax for mathematics</title>
<link rel="stylesheet" href="../../../docutils/writers/html5_polyglot/minimal.css" type="text/css" />
Modified: trunk/docutils/test/functional/expected/mathematics_mathml_ttm.html
===================================================================
--- trunk/docutils/test/functional/expected/mathematics_mathml_ttm.html 2025-05-20 15:48:42 UTC (rev 10137)
+++ trunk/docutils/test/functional/expected/mathematics_mathml_ttm.html 2025-05-22 19:18:51 UTC (rev 10138)
@@ -2,7 +2,7 @@
<html xmlns="http://www.w3.org/1999/xhtml" xml:lang="en" lang="en">
<head>
<meta charset="utf-8" />
-<meta name="generator" content="Docutils 0.22rc2.dev: https://docutils.sourceforge.io/" />
+<meta name="generator" content="Docutils 0.22rc2: https://docutils.sourceforge.io/" />
<meta name="viewport" content="width=device-width, initial-scale=1" />
<title>LaTeX syntax for mathematics</title>
<link rel="stylesheet" href="../../../docutils/writers/html5_polyglot/minimal.css" type="text/css" />
Modified: trunk/docutils/test/functional/expected/misc_rst_html4css1.html
===================================================================
--- trunk/docutils/test/functional/expected/misc_rst_html4css1.html 2025-05-20 15:48:42 UTC (rev 10137)
+++ trunk/docutils/test/functional/expected/misc_rst_html4css1.html 2025-05-22 19:18:51 UTC (rev 10138)
@@ -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.22rc2.dev: https://docutils.sourceforge.io/" />
+<meta name="generator" content="Docutils 0.22rc2: 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 2025-05-20 15:48:42 UTC (rev 10137)
+++ trunk/docutils/test/functional/expected/misc_rst_html5.html 2025-05-22 19:18:51 UTC (rev 10138)
@@ -2,7 +2,7 @@
<html xmlns="http://www.w3.org/1999/xhtml" xml:lang="en" lang="en">
<head>
<meta charset="utf-8" />
-<meta name="generator" content="Docutils 0.22rc2.dev: https://docutils.sourceforge.io/" />
+<meta name="generator" content="Docutils 0.22rc2: https://docutils.sourceforge.io/" />
<meta name="viewport" content="width=device-width, initial-scale=1" />
<title>Additional tests with HTML 5</title>
<link rel="stylesheet" href="../input/data/minimal.css" type="text/css" />
Modified: trunk/docutils/test/functional/expected/pep_html.html
===================================================================
--- trunk/docutils/test/functional/expected/pep_html.html 2025-05-20 15:48:42 UTC (rev 10137)
+++ trunk/docutils/test/functional/expected/pep_html.html 2025-05-22 19:18:51 UTC (rev 10138)
@@ -8,7 +8,7 @@
-->
<head>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
- <meta name="generator" content="Docutils 0.22rc2.dev: https://docutils.sourceforge.io/" />
+ <meta name="generator" content="Docutils 0.22rc2: 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 2025-05-20 15:48:42 UTC (rev 10137)
+++ trunk/docutils/test/functional/expected/rst_html5_tuftig.html 2025-05-22 19:18:51 UTC (rev 10138)
@@ -2,7 +2,7 @@
<html xmlns="http://www.w3.org/1999/xhtml" xml:lang="en" lang="en">
<head>
<meta charset="utf-8" />
-<meta name="generator" content="Docutils 0.22rc2.dev: https://docutils.sourceforge.io/" />
+<meta name="generator" content="Docutils 0.22rc2: https://docutils.sourceforge.io/" />
<meta name="viewport" content="width=device-width, initial-scale=1" />
<title>Special Features of the tuftig.css Stylesheet</title>
<link rel="stylesheet" href="../input/data/minimal.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 2025-05-20 15:48:42 UTC (rev 10137)
+++ trunk/docutils/test/functional/expected/standalone_rst_docutils_xml.xml 2025-05-22 19:18:51 UTC (rev 10138)
@@ -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.22rc2.dev -->
+<!-- Generated by Docutils 0.22rc2 -->
<document ids="restructuredtext-test-document doctitle" names="restructuredtext\ test\ document doctitle" source="functional/input/standalone_rst_docutils_xml.rst" 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 2025-05-20 15:48:42 UTC (rev 10137)
+++ trunk/docutils/test/functional/expected/standalone_rst_html4css1.html 2025-05-22 19:18:51 UTC (rev 10138)
@@ -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.22rc2.dev: https://docutils.sourceforge.io/" />
+<meta name="generator" content="Docutils 0.22rc2: https://docutils.sourceforge.io/" />
<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" />
<meta name="author" content="David Goodger" />
Modified: trunk/docutils/test/functional/expected/standalone_rst_html5.html
===================================================================
--- trunk/docutils/test/functional/expected/standalone_rst_html5.html 2025-05-20 15:48:42 UTC (rev 10137)
+++ trunk/docutils/test/functional/expected/standalone_rst_html5.html 2025-05-22 19:18:51 UTC (rev 10138)
@@ -2,7 +2,7 @@
<html xmlns="http://www.w3.org/1999/xhtml" xml:lang="en" lang="en">
<head>
<meta charset="utf-8" />
-<meta name="generator" content="Docutils 0.22rc2.dev: https://docutils.sourceforge.io/" />
+<meta name="generator" content="Docutils 0.22rc2: https://docutils.sourceforge.io/" />
<meta name="viewport" content="width=device-width, initial-scale=1" />
<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_manpage.man
===================================================================
--- trunk/docutils/test/functional/expected/standalone_rst_manpage.man 2025-05-20 15:48:42 UTC (rev 10137)
+++ trunk/docutils/test/functional/expected/standalone_rst_manpage.man 2025-05-22 19:18:51 UTC (rev 10138)
@@ -1,5 +1,5 @@
.\" Man page generated from reStructuredText
-.\" by the Docutils 0.22rc2.dev manpage writer.
+.\" by the Docutils 0.22rc2 manpage writer.
.
.
.nr rst2man-indent-level 0
Modified: trunk/docutils/test/functional/expected/standalone_rst_s5_html_1.html
===================================================================
--- trunk/docutils/test/functional/expected/standalone_rst_s5_html_1.html 2025-05-20 15:48:42 UTC (rev 10137)
+++ trunk/docutils/test/functional/expected/standalone_rst_s5_html_1.html 2025-05-22 19:18:51 UTC (rev 10138)
@@ -3,7 +3,7 @@
<html xmlns="http://www.w3.org/1999/xhtml" xml:lang="en" lang="en...
[truncated message content] |
|
From: <gr...@us...> - 2025-05-22 19:52:14
|
Revision: 10139
http://sourceforge.net/p/docutils/code/10139
Author: grubert
Date: 2025-05-22 19:52:06 +0000 (Thu, 22 May 2025)
Log Message:
-----------
version to 0.22rc3.dev
Modified Paths:
--------------
trunk/docutils/README.rst
trunk/docutils/docutils/__init__.py
trunk/docutils/test/functional/expected/buggy_mathml.html
trunk/docutils/test/functional/expected/buggy_mathml_blahtexml.html
trunk/docutils/test/functional/expected/buggy_mathml_pandoc.html
trunk/docutils/test/functional/expected/buggy_mathml_ttm.html
trunk/docutils/test/functional/expected/compact_lists.html
trunk/docutils/test/functional/expected/dangerous.html
trunk/docutils/test/functional/expected/field_name_limit.html
trunk/docutils/test/functional/expected/footnotes_html5.html
trunk/docutils/test/functional/expected/length_units_html5.html
trunk/docutils/test/functional/expected/math_experiments_mathml.html
trunk/docutils/test/functional/expected/math_experiments_mathml_blahtexml.html
trunk/docutils/test/functional/expected/math_experiments_mathml_pandoc.html
trunk/docutils/test/functional/expected/math_experiments_mathml_ttm.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/mathematics_mathml.html
trunk/docutils/test/functional/expected/mathematics_mathml_blahtexml.html
trunk/docutils/test/functional/expected/mathematics_mathml_pandoc.html
trunk/docutils/test/functional/expected/mathematics_mathml_ttm.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_manpage.man
trunk/docutils/test/functional/expected/standalone_rst_s5_html_1.html
trunk/docutils/test/functional/expected/standalone_rst_s5_html_2.html
trunk/docutils/test/test_writers/test_manpage.py
Modified: trunk/docutils/README.rst
===================================================================
--- trunk/docutils/README.rst 2025-05-22 19:18:51 UTC (rev 10138)
+++ trunk/docutils/README.rst 2025-05-22 19:52:06 UTC (rev 10139)
@@ -1,5 +1,5 @@
==========================
- README: Docutils 0.22rc2
+ README: Docutils 0.22rc3.dev
==========================
:Author: David Goodger
Modified: trunk/docutils/docutils/__init__.py
===================================================================
--- trunk/docutils/docutils/__init__.py 2025-05-22 19:18:51 UTC (rev 10138)
+++ trunk/docutils/docutils/__init__.py 2025-05-22 19:52:06 UTC (rev 10139)
@@ -84,7 +84,7 @@
__docformat__ = 'reStructuredText'
-__version__ = '0.22rc2'
+__version__ = '0.22rc3.dev'
"""Docutils version identifier (complies with PEP 440)::
major.minor[.micro][releaselevel[serial]][.dev]
@@ -160,8 +160,8 @@
minor=22,
micro=0,
releaselevel='candidate', # one of 'alpha', 'beta', 'candidate', 'final'
- serial=2, # pre-release number (0 for final releases and snapshots)
- release=True # True for official releases and pre-releases
+ serial=3, # 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/test/functional/expected/buggy_mathml.html
===================================================================
--- trunk/docutils/test/functional/expected/buggy_mathml.html 2025-05-22 19:18:51 UTC (rev 10138)
+++ trunk/docutils/test/functional/expected/buggy_mathml.html 2025-05-22 19:52:06 UTC (rev 10139)
@@ -2,7 +2,7 @@
<html xmlns="http://www.w3.org/1999/xhtml" xml:lang="en" lang="en">
<head>
<meta charset="utf-8" />
-<meta name="generator" content="Docutils 0.22rc2: https://docutils.sourceforge.io/" />
+<meta name="generator" content="Docutils 0.22rc3.dev: https://docutils.sourceforge.io/" />
<meta name="viewport" content="width=device-width, initial-scale=1" />
<title>buggy-maths</title>
<link rel="stylesheet" href="../../../docutils/writers/html5_polyglot/minimal.css" type="text/css" />
Modified: trunk/docutils/test/functional/expected/buggy_mathml_blahtexml.html
===================================================================
--- trunk/docutils/test/functional/expected/buggy_mathml_blahtexml.html 2025-05-22 19:18:51 UTC (rev 10138)
+++ trunk/docutils/test/functional/expected/buggy_mathml_blahtexml.html 2025-05-22 19:52:06 UTC (rev 10139)
@@ -2,7 +2,7 @@
<html xmlns="http://www.w3.org/1999/xhtml" xml:lang="en" lang="en">
<head>
<meta charset="utf-8" />
-<meta name="generator" content="Docutils 0.22rc2: https://docutils.sourceforge.io/" />
+<meta name="generator" content="Docutils 0.22rc3.dev: https://docutils.sourceforge.io/" />
<meta name="viewport" content="width=device-width, initial-scale=1" />
<title>buggy-maths</title>
<link rel="stylesheet" href="../../../docutils/writers/html5_polyglot/minimal.css" type="text/css" />
Modified: trunk/docutils/test/functional/expected/buggy_mathml_pandoc.html
===================================================================
--- trunk/docutils/test/functional/expected/buggy_mathml_pandoc.html 2025-05-22 19:18:51 UTC (rev 10138)
+++ trunk/docutils/test/functional/expected/buggy_mathml_pandoc.html 2025-05-22 19:52:06 UTC (rev 10139)
@@ -2,7 +2,7 @@
<html xmlns="http://www.w3.org/1999/xhtml" xml:lang="en" lang="en">
<head>
<meta charset="utf-8" />
-<meta name="generator" content="Docutils 0.22rc2: https://docutils.sourceforge.io/" />
+<meta name="generator" content="Docutils 0.22rc3.dev: https://docutils.sourceforge.io/" />
<meta name="viewport" content="width=device-width, initial-scale=1" />
<title>buggy-maths</title>
<link rel="stylesheet" href="../../../docutils/writers/html5_polyglot/minimal.css" type="text/css" />
Modified: trunk/docutils/test/functional/expected/buggy_mathml_ttm.html
===================================================================
--- trunk/docutils/test/functional/expected/buggy_mathml_ttm.html 2025-05-22 19:18:51 UTC (rev 10138)
+++ trunk/docutils/test/functional/expected/buggy_mathml_ttm.html 2025-05-22 19:52:06 UTC (rev 10139)
@@ -2,7 +2,7 @@
<html xmlns="http://www.w3.org/1999/xhtml" xml:lang="en" lang="en">
<head>
<meta charset="utf-8" />
-<meta name="generator" content="Docutils 0.22rc2: https://docutils.sourceforge.io/" />
+<meta name="generator" content="Docutils 0.22rc3.dev: https://docutils.sourceforge.io/" />
<meta name="viewport" content="width=device-width, initial-scale=1" />
<title>buggy-maths</title>
<link rel="stylesheet" href="../../../docutils/writers/html5_polyglot/minimal.css" type="text/css" />
Modified: trunk/docutils/test/functional/expected/compact_lists.html
===================================================================
--- trunk/docutils/test/functional/expected/compact_lists.html 2025-05-22 19:18:51 UTC (rev 10138)
+++ trunk/docutils/test/functional/expected/compact_lists.html 2025-05-22 19:52:06 UTC (rev 10139)
@@ -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.22rc2: https://docutils.sourceforge.io/" />
+<meta name="generator" content="Docutils 0.22rc3.dev: https://docutils.sourceforge.io/" />
<title>compact_lists.rst</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 2025-05-22 19:18:51 UTC (rev 10138)
+++ trunk/docutils/test/functional/expected/dangerous.html 2025-05-22 19:52:06 UTC (rev 10139)
@@ -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.22rc2: https://docutils.sourceforge.io/" />
+<meta name="generator" content="Docutils 0.22rc3.dev: https://docutils.sourceforge.io/" />
<title>dangerous.rst</title>
<link rel="stylesheet" href="../input/data/html4css1.css" type="text/css" />
</head>
Modified: trunk/docutils/test/functional/expected/field_name_limit.html
===================================================================
--- trunk/docutils/test/functional/expected/field_name_limit.html 2025-05-22 19:18:51 UTC (rev 10138)
+++ trunk/docutils/test/functional/expected/field_name_limit.html 2025-05-22 19:52:06 UTC (rev 10139)
@@ -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.22rc2: https://docutils.sourceforge.io/" />
+<meta name="generator" content="Docutils 0.22rc3.dev: https://docutils.sourceforge.io/" />
<title>field_list.rst</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 2025-05-22 19:18:51 UTC (rev 10138)
+++ trunk/docutils/test/functional/expected/footnotes_html5.html 2025-05-22 19:52:06 UTC (rev 10139)
@@ -2,7 +2,7 @@
<html xmlns="http://www.w3.org/1999/xhtml" xml:lang="en" lang="en">
<head>
<meta charset="utf-8" />
-<meta name="generator" content="Docutils 0.22rc2: https://docutils.sourceforge.io/" />
+<meta name="generator" content="Docutils 0.22rc3.dev: https://docutils.sourceforge.io/" />
<meta name="viewport" content="width=device-width, initial-scale=1" />
<title>Test footnote and citation rendering</title>
<link rel="stylesheet" href="../input/data/minimal.css" type="text/css" />
Modified: trunk/docutils/test/functional/expected/length_units_html5.html
===================================================================
--- trunk/docutils/test/functional/expected/length_units_html5.html 2025-05-22 19:18:51 UTC (rev 10138)
+++ trunk/docutils/test/functional/expected/length_units_html5.html 2025-05-22 19:52:06 UTC (rev 10139)
@@ -2,7 +2,7 @@
<html xmlns="http://www.w3.org/1999/xhtml" xml:lang="en" lang="en">
<head>
<meta charset="utf-8" />
-<meta name="generator" content="Docutils 0.22rc2: https://docutils.sourceforge.io/" />
+<meta name="generator" content="Docutils 0.22rc3.dev: https://docutils.sourceforge.io/" />
<meta name="viewport" content="width=device-width, initial-scale=1" />
<title>Test length specifications</title>
<link rel="stylesheet" href="../input/data/minimal.css" type="text/css" />
Modified: trunk/docutils/test/functional/expected/math_experiments_mathml.html
===================================================================
--- trunk/docutils/test/functional/expected/math_experiments_mathml.html 2025-05-22 19:18:51 UTC (rev 10138)
+++ trunk/docutils/test/functional/expected/math_experiments_mathml.html 2025-05-22 19:52:06 UTC (rev 10139)
@@ -2,7 +2,7 @@
<html xmlns="http://www.w3.org/1999/xhtml" xml:lang="en" lang="en">
<head>
<meta charset="utf-8" />
-<meta name="generator" content="Docutils 0.22rc2: https://docutils.sourceforge.io/" />
+<meta name="generator" content="Docutils 0.22rc3.dev: https://docutils.sourceforge.io/" />
<meta name="viewport" content="width=device-width, initial-scale=1" />
<title>Math Conversion Tests</title>
<link rel="stylesheet" href="../../../docutils/writers/html5_polyglot/minimal.css" type="text/css" />
Modified: trunk/docutils/test/functional/expected/math_experiments_mathml_blahtexml.html
===================================================================
--- trunk/docutils/test/functional/expected/math_experiments_mathml_blahtexml.html 2025-05-22 19:18:51 UTC (rev 10138)
+++ trunk/docutils/test/functional/expected/math_experiments_mathml_blahtexml.html 2025-05-22 19:52:06 UTC (rev 10139)
@@ -2,7 +2,7 @@
<html xmlns="http://www.w3.org/1999/xhtml" xml:lang="en" lang="en">
<head>
<meta charset="utf-8" />
-<meta name="generator" content="Docutils 0.22rc2: https://docutils.sourceforge.io/" />
+<meta name="generator" content="Docutils 0.22rc3.dev: https://docutils.sourceforge.io/" />
<meta name="viewport" content="width=device-width, initial-scale=1" />
<title>Math Conversion Tests</title>
<link rel="stylesheet" href="../../../docutils/writers/html5_polyglot/minimal.css" type="text/css" />
Modified: trunk/docutils/test/functional/expected/math_experiments_mathml_pandoc.html
===================================================================
--- trunk/docutils/test/functional/expected/math_experiments_mathml_pandoc.html 2025-05-22 19:18:51 UTC (rev 10138)
+++ trunk/docutils/test/functional/expected/math_experiments_mathml_pandoc.html 2025-05-22 19:52:06 UTC (rev 10139)
@@ -2,7 +2,7 @@
<html xmlns="http://www.w3.org/1999/xhtml" xml:lang="en" lang="en">
<head>
<meta charset="utf-8" />
-<meta name="generator" content="Docutils 0.22rc2: https://docutils.sourceforge.io/" />
+<meta name="generator" content="Docutils 0.22rc3.dev: https://docutils.sourceforge.io/" />
<meta name="viewport" content="width=device-width, initial-scale=1" />
<title>Math Conversion Tests</title>
<link rel="stylesheet" href="../../../docutils/writers/html5_polyglot/minimal.css" type="text/css" />
Modified: trunk/docutils/test/functional/expected/math_experiments_mathml_ttm.html
===================================================================
--- trunk/docutils/test/functional/expected/math_experiments_mathml_ttm.html 2025-05-22 19:18:51 UTC (rev 10138)
+++ trunk/docutils/test/functional/expected/math_experiments_mathml_ttm.html 2025-05-22 19:52:06 UTC (rev 10139)
@@ -2,7 +2,7 @@
<html xmlns="http://www.w3.org/1999/xhtml" xml:lang="en" lang="en">
<head>
<meta charset="utf-8" />
-<meta name="generator" content="Docutils 0.22rc2: https://docutils.sourceforge.io/" />
+<meta name="generator" content="Docutils 0.22rc3.dev: https://docutils.sourceforge.io/" />
<meta name="viewport" content="width=device-width, initial-scale=1" />
<title>Math Conversion Tests</title>
<link rel="stylesheet" href="../../../docutils/writers/html5_polyglot/minimal.css" type="text/css" />
Modified: trunk/docutils/test/functional/expected/math_output_html.html
===================================================================
--- trunk/docutils/test/functional/expected/math_output_html.html 2025-05-22 19:18:51 UTC (rev 10138)
+++ trunk/docutils/test/functional/expected/math_output_html.html 2025-05-22 19:52:06 UTC (rev 10139)
@@ -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.22rc2: https://docutils.sourceforge.io/" />
+<meta name="generator" content="Docutils 0.22rc3.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 2025-05-22 19:18:51 UTC (rev 10138)
+++ trunk/docutils/test/functional/expected/math_output_latex.html 2025-05-22 19:52:06 UTC (rev 10139)
@@ -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.22rc2: https://docutils.sourceforge.io/" />
+<meta name="generator" content="Docutils 0.22rc3.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 2025-05-22 19:18:51 UTC (rev 10138)
+++ trunk/docutils/test/functional/expected/math_output_mathjax.html 2025-05-22 19:52:06 UTC (rev 10139)
@@ -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.22rc2: https://docutils.sourceforge.io/" />
+<meta name="generator" content="Docutils 0.22rc3.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 2025-05-22 19:18:51 UTC (rev 10138)
+++ trunk/docutils/test/functional/expected/math_output_mathml.html 2025-05-22 19:52:06 UTC (rev 10139)
@@ -2,7 +2,7 @@
<html xmlns="http://www.w3.org/1999/xhtml" xml:lang="en" lang="en">
<head>
<meta charset="utf-8" />
-<meta name="generator" content="Docutils 0.22rc2: https://docutils.sourceforge.io/" />
+<meta name="generator" content="Docutils 0.22rc3.dev: https://docutils.sourceforge.io/" />
<meta name="viewport" content="width=device-width, initial-scale=1" />
<title>Mathematics</title>
<link rel="stylesheet" href="../input/data/minimal.css" type="text/css" />
Modified: trunk/docutils/test/functional/expected/mathematics_mathml.html
===================================================================
--- trunk/docutils/test/functional/expected/mathematics_mathml.html 2025-05-22 19:18:51 UTC (rev 10138)
+++ trunk/docutils/test/functional/expected/mathematics_mathml.html 2025-05-22 19:52:06 UTC (rev 10139)
@@ -2,7 +2,7 @@
<html xmlns="http://www.w3.org/1999/xhtml" xml:lang="en" lang="en">
<head>
<meta charset="utf-8" />
-<meta name="generator" content="Docutils 0.22rc2: https://docutils.sourceforge.io/" />
+<meta name="generator" content="Docutils 0.22rc3.dev: https://docutils.sourceforge.io/" />
<meta name="viewport" content="width=device-width, initial-scale=1" />
<title>LaTeX syntax for mathematics</title>
<link rel="stylesheet" href="../../../docutils/writers/html5_polyglot/minimal.css" type="text/css" />
Modified: trunk/docutils/test/functional/expected/mathematics_mathml_blahtexml.html
===================================================================
--- trunk/docutils/test/functional/expected/mathematics_mathml_blahtexml.html 2025-05-22 19:18:51 UTC (rev 10138)
+++ trunk/docutils/test/functional/expected/mathematics_mathml_blahtexml.html 2025-05-22 19:52:06 UTC (rev 10139)
@@ -2,7 +2,7 @@
<html xmlns="http://www.w3.org/1999/xhtml" xml:lang="en" lang="en">
<head>
<meta charset="utf-8" />
-<meta name="generator" content="Docutils 0.22rc2: https://docutils.sourceforge.io/" />
+<meta name="generator" content="Docutils 0.22rc3.dev: https://docutils.sourceforge.io/" />
<meta name="viewport" content="width=device-width, initial-scale=1" />
<title>LaTeX syntax for mathematics</title>
<link rel="stylesheet" href="../../../docutils/writers/html5_polyglot/minimal.css" type="text/css" />
Modified: trunk/docutils/test/functional/expected/mathematics_mathml_pandoc.html
===================================================================
--- trunk/docutils/test/functional/expected/mathematics_mathml_pandoc.html 2025-05-22 19:18:51 UTC (rev 10138)
+++ trunk/docutils/test/functional/expected/mathematics_mathml_pandoc.html 2025-05-22 19:52:06 UTC (rev 10139)
@@ -2,7 +2,7 @@
<html xmlns="http://www.w3.org/1999/xhtml" xml:lang="en" lang="en">
<head>
<meta charset="utf-8" />
-<meta name="generator" content="Docutils 0.22rc2: https://docutils.sourceforge.io/" />
+<meta name="generator" content="Docutils 0.22rc3.dev: https://docutils.sourceforge.io/" />
<meta name="viewport" content="width=device-width, initial-scale=1" />
<title>LaTeX syntax for mathematics</title>
<link rel="stylesheet" href="../../../docutils/writers/html5_polyglot/minimal.css" type="text/css" />
Modified: trunk/docutils/test/functional/expected/mathematics_mathml_ttm.html
===================================================================
--- trunk/docutils/test/functional/expected/mathematics_mathml_ttm.html 2025-05-22 19:18:51 UTC (rev 10138)
+++ trunk/docutils/test/functional/expected/mathematics_mathml_ttm.html 2025-05-22 19:52:06 UTC (rev 10139)
@@ -2,7 +2,7 @@
<html xmlns="http://www.w3.org/1999/xhtml" xml:lang="en" lang="en">
<head>
<meta charset="utf-8" />
-<meta name="generator" content="Docutils 0.22rc2: https://docutils.sourceforge.io/" />
+<meta name="generator" content="Docutils 0.22rc3.dev: https://docutils.sourceforge.io/" />
<meta name="viewport" content="width=device-width, initial-scale=1" />
<title>LaTeX syntax for mathematics</title>
<link rel="stylesheet" href="../../../docutils/writers/html5_polyglot/minimal.css" type="text/css" />
Modified: trunk/docutils/test/functional/expected/misc_rst_html4css1.html
===================================================================
--- trunk/docutils/test/functional/expected/misc_rst_html4css1.html 2025-05-22 19:18:51 UTC (rev 10138)
+++ trunk/docutils/test/functional/expected/misc_rst_html4css1.html 2025-05-22 19:52:06 UTC (rev 10139)
@@ -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.22rc2: https://docutils.sourceforge.io/" />
+<meta name="generator" content="Docutils 0.22rc3.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 2025-05-22 19:18:51 UTC (rev 10138)
+++ trunk/docutils/test/functional/expected/misc_rst_html5.html 2025-05-22 19:52:06 UTC (rev 10139)
@@ -2,7 +2,7 @@
<html xmlns="http://www.w3.org/1999/xhtml" xml:lang="en" lang="en">
<head>
<meta charset="utf-8" />
-<meta name="generator" content="Docutils 0.22rc2: https://docutils.sourceforge.io/" />
+<meta name="generator" content="Docutils 0.22rc3.dev: https://docutils.sourceforge.io/" />
<meta name="viewport" content="width=device-width, initial-scale=1" />
<title>Additional tests with HTML 5</title>
<link rel="stylesheet" href="../input/data/minimal.css" type="text/css" />
Modified: trunk/docutils/test/functional/expected/pep_html.html
===================================================================
--- trunk/docutils/test/functional/expected/pep_html.html 2025-05-22 19:18:51 UTC (rev 10138)
+++ trunk/docutils/test/functional/expected/pep_html.html 2025-05-22 19:52:06 UTC (rev 10139)
@@ -8,7 +8,7 @@
-->
<head>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
- <meta name="generator" content="Docutils 0.22rc2: https://docutils.sourceforge.io/" />
+ <meta name="generator" content="Docutils 0.22rc3.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 2025-05-22 19:18:51 UTC (rev 10138)
+++ trunk/docutils/test/functional/expected/rst_html5_tuftig.html 2025-05-22 19:52:06 UTC (rev 10139)
@@ -2,7 +2,7 @@
<html xmlns="http://www.w3.org/1999/xhtml" xml:lang="en" lang="en">
<head>
<meta charset="utf-8" />
-<meta name="generator" content="Docutils 0.22rc2: https://docutils.sourceforge.io/" />
+<meta name="generator" content="Docutils 0.22rc3.dev: https://docutils.sourceforge.io/" />
<meta name="viewport" content="width=device-width, initial-scale=1" />
<title>Special Features of the tuftig.css Stylesheet</title>
<link rel="stylesheet" href="../input/data/minimal.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 2025-05-22 19:18:51 UTC (rev 10138)
+++ trunk/docutils/test/functional/expected/standalone_rst_docutils_xml.xml 2025-05-22 19:52:06 UTC (rev 10139)
@@ -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.22rc2 -->
+<!-- Generated by Docutils 0.22rc3.dev -->
<document ids="restructuredtext-test-document doctitle" names="restructuredtext\ test\ document doctitle" source="functional/input/standalone_rst_docutils_xml.rst" 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 2025-05-22 19:18:51 UTC (rev 10138)
+++ trunk/docutils/test/functional/expected/standalone_rst_html4css1.html 2025-05-22 19:52:06 UTC (rev 10139)
@@ -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.22rc2: https://docutils.sourceforge.io/" />
+<meta name="generator" content="Docutils 0.22rc3.dev: https://docutils.sourceforge.io/" />
<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" />
<meta name="author" content="David Goodger" />
Modified: trunk/docutils/test/functional/expected/standalone_rst_html5.html
===================================================================
--- trunk/docutils/test/functional/expected/standalone_rst_html5.html 2025-05-22 19:18:51 UTC (rev 10138)
+++ trunk/docutils/test/functional/expected/standalone_rst_html5.html 2025-05-22 19:52:06 UTC (rev 10139)
@@ -2,7 +2,7 @@
<html xmlns="http://www.w3.org/1999/xhtml" xml:lang="en" lang="en">
<head>
<meta charset="utf-8" />
-<meta name="generator" content="Docutils 0.22rc2: https://docutils.sourceforge.io/" />
+<meta name="generator" content="Docutils 0.22rc3.dev: https://docutils.sourceforge.io/" />
<meta name="viewport" content="width=device-width, initial-scale=1" />
<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_manpage.man
===================================================================
--- trunk/docutils/test/functional/expected/standalone_rst_manpage.man 2025-05-22 19:18:51 UTC (rev 10138)
+++ trunk/docutils/test/functional/expected/standalone_rst_manpage.man 2025-05-22 19:52:06 UTC (rev 10139)
@@ -1,5 +1,5 @@
.\" Man page generated from reStructuredText
-.\" by the Docutils 0.22rc2 manpage writer.
+.\" by the Docutils 0.22rc3.dev manpage writer.
.
.
.nr rst2man-indent-level 0
Modified: trunk/docutils/test/functional/expected/standalone_rst_s5_html_1.html
===================================================================
--- trunk/docutils/test/functional/expected/standalone_rst_s5_html_1.html 2025-05-22 19:18:51 UTC (rev 10138)
+++ trunk/docutils/test/functional/expected/standalone_rst_s5_html_1.html 2025-05-22 19:52:06 UTC (rev 10139)
@@ -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.22rc2: https://docutils.sourceforge.io/" />
+<meta name="generator" content="Docutils 0.22rc3.dev: https://docutils.sourceforge.io/" />
<meta name="version" content="S5 1.1" />
<meta name="author" content="David Goodger" />
<meta name="date" content="2005-11-28" />
Modified: trunk/docutils/test/functional/expected/standalone_rst_s5_html_2.html
===================================================================
--- trunk/docutils/test/functional/expected/standalone_rst_s5_html_2.html 2025-05-22 19:18:51 UTC (rev 10138)
+++ trunk/docutils/test/functional/expected/standalone_rst_s5_html_2.html 2025-05-22 19:52:06 UTC (rev 10139)
@@ -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.22rc2: https://docutils.sourceforge.io/" />
+<meta name="generator" content="Docutils 0.22rc3.dev: https://docutils.sourceforge.io/" />
<meta name="version" content="S5 1.1" />
<meta name="author" content="David Goodger" />
<meta name="d...
[truncated message content] |
|
From: <mi...@us...> - 2025-05-27 06:14:30
|
Revision: 10146
http://sourceforge.net/p/docutils/code/10146
Author: milde
Date: 2025-05-27 06:14:22 +0000 (Tue, 27 May 2025)
Log Message:
-----------
Deprecate the `TransformSpec.unknown_reference_resolvers` hook chain.
`unknown_reference_resolvers` were introduced to support component-specific
resolving of unknown references. Ian Bicking's "Wiki.py" module in the sandbox
shows that a simple transform can be used for that task.
Removing the hook and its complex specification will simplify both,
API and code base without loss of functionality.
The only known use case is the MoinMoin wiki.1
Versions <= 1.9 register a "resolver" function for "Wiki references".
MoinMoin 2.0 does not use the "unknown_reference_resolvers" hook;
MoinMoin 1.9 requires Python 2, so a removal will not affect
existing installations.
1 The LaTeX writer uses a "resolver function" for BibTeX citation_references
in Docutils 0.22 development and pre-release versions.
It will be changed to use a transform in the next commit.
Modified Paths:
--------------
trunk/docutils/RELEASE-NOTES.rst
trunk/docutils/docutils/__init__.py
trunk/docutils/docutils/io.py
trunk/docutils/docutils/transforms/__init__.py
trunk/docutils/test/test_transforms/test__init__.py
Modified: trunk/docutils/RELEASE-NOTES.rst
===================================================================
--- trunk/docutils/RELEASE-NOTES.rst 2025-05-25 21:05:14 UTC (rev 10145)
+++ trunk/docutils/RELEASE-NOTES.rst 2025-05-27 06:14:22 UTC (rev 10146)
@@ -163,6 +163,9 @@
* Remove the input_encoding_ auto-detection code in Docutils 1.0.
+* Remove the "TransformSpec.unknown_reference_resolvers" hook chain
+ in Docutils 1.0. Use a transform.
+
* Remove `parsers.rst.roles.set_classes()` and
`parsers.rst.roles.normalized_role_options()`
(obsoleted by `parsers.rst.roles.normalize_options()`) in Docutils 2.0.
Modified: trunk/docutils/docutils/__init__.py
===================================================================
--- trunk/docutils/docutils/__init__.py 2025-05-25 21:05:14 UTC (rev 10145)
+++ trunk/docutils/docutils/__init__.py 2025-05-27 06:14:22 UTC (rev 10146)
@@ -75,7 +75,8 @@
]
class _UnknownReferenceResolver(Protocol):
- """See `TransformSpec.unknown_reference_resolvers`."""
+ """Deprecated. Will be removed in Docutils 1.0."""
+ # See `TransformSpec.unknown_reference_resolvers`.
priority: int
@@ -284,41 +285,39 @@
unknown_reference_resolvers: Sequence[_UnknownReferenceResolver] = ()
"""List of hook functions which assist in resolving references.
- Override in subclasses to implement component-specific resolving of
- unknown references.
-
- Unknown references have a 'refname' attribute which doesn't correspond
- to any target in the document. Called when the transforms in
- `docutils.transforms.references` are unable to find a correct target.
-
- The list should contain functions which will try to resolve unknown
- references, with the following signature::
-
- def reference_resolver(node: nodes.Element) -> bool:
- '''Returns boolean: true if resolved, false if not.'''
-
- If the function is able to resolve the reference, it should also remove
- the 'refname' attribute and mark the node as resolved::
-
- del node['refname']
- node.resolved = True
-
- Each function must have a "priority" attribute which will affect the order
- the unknown_reference_resolvers are run
- cf. ../docs/api/transforms.html#transform-priority-range-categories ::
-
- reference_resolver.priority = 500
-
- Examples:
- `writers.latex2e.Writer` defines a resolver to mark citation references
- as resolved by BibTeX if the "use_bibtex" configuration setting is set.
-
- The `MoinMoin ReStructured Text Parser`__ provides a resolver for
- "WikiWiki links" (currently only in the outdated 1.9 version).
-
- __ https://github.com/moinwiki/moin-1.9/blob/1.9.11/MoinMoin/parser/
- text_rst.py
+ Deprecated. Will be removed in Docutils 1.0
"""
+ # Override in subclasses to implement component-specific resolving of
+ # unknown references.
+ #
+ # Unknown references have a 'refname' attribute which doesn't correspond
+ # to any target in the document. Called when the transforms in
+ # `docutils.transforms.references` are unable to find a correct target.
+ #
+ # The list should contain functions which will try to resolve unknown
+ # references, with the following signature::
+ #
+ # def reference_resolver(node: nodes.Element) -> bool:
+ # '''Returns boolean: true if resolved, false if not.'''
+ #
+ # If the function is able to resolve the reference, it should also remove
+ # the 'refname' attribute and mark the node as resolved::
+ #
+ # del node['refname']
+ # node.resolved = True
+ #
+ # Each function must have a "priority" attribute which will affect the
+ # order the unknown_reference_resolvers are run
+ # cf. ../docs/api/transforms.html#transform-priority-range-categories ::
+ #
+ # reference_resolver.priority = 500
+ #
+ # Examples:
+ # The `MoinMoin ReStructured Text Parser`__ provided a resolver for
+ # "WikiWiki links" in the 1.9 version.
+ #
+ # __ https://github.com/moinwiki/moin-1.9/blob/1.9.11/MoinMoin/parser/
+ # text_rst.py
class Component(SettingsSpec, TransformSpec):
Modified: trunk/docutils/docutils/io.py
===================================================================
--- trunk/docutils/docutils/io.py 2025-05-25 21:05:14 UTC (rev 10145)
+++ trunk/docutils/docutils/io.py 2025-05-27 06:14:22 UTC (rev 10146)
@@ -82,9 +82,9 @@
Docutils input objects must provide a `read()` method that
returns the source, typically as `str` instance.
- Inheriting `TransformSpec` allows input objects to add
- "transforms" and "unknown_reference_resolvers" to the "Transformer".
- (Optional for custom input objects since Docutils 0.19.)
+ Inheriting `TransformSpec` allows input objects to add "transforms" to
+ the "Transformer". (Since Docutils 0.19, input objects are no longer
+ required to be `TransformSpec` instances.)
"""
component_type: Final = 'input'
@@ -242,9 +242,9 @@
Docutils output objects must provide a `write()` method that
expects and handles one argument (the output).
- Inheriting `TransformSpec` allows output objects to add
- "transforms" and "unknown_reference_resolvers" to the "Transformer".
- (Optional for custom output objects since Docutils 0.19.)
+ Inheriting `TransformSpec` allows output objects to add "transforms" to
+ the "Transformer". (Since Docutils 0.19, output objects are no longer
+ required to be `TransformSpec` instances.)
"""
component_type: Final = 'output'
Modified: trunk/docutils/docutils/transforms/__init__.py
===================================================================
--- trunk/docutils/docutils/transforms/__init__.py 2025-05-25 21:05:14 UTC (rev 10145)
+++ trunk/docutils/docutils/transforms/__init__.py 2025-05-27 06:14:22 UTC (rev 10146)
@@ -25,6 +25,8 @@
__docformat__ = 'reStructuredText'
+import warnings
+
from docutils import languages, ApplicationError, TransformSpec
@@ -64,8 +66,8 @@
"""
Store "transforms" and apply them to the document tree.
- Collect lists of `Transform` instances and "unknown_reference_resolvers"
- from Docutils components (`TransformSpec` instances).
+ Collect lists of `Transform` instances from Docutils
+ components (`TransformSpec` instances).
Apply collected "transforms" to the document tree.
Also keeps track of components by component type name.
@@ -80,8 +82,11 @@
"""
self.unknown_reference_resolvers = []
- """List of hook functions which assist in resolving references."""
+ """List of hook functions which assist in resolving references.
+ Deprecated. Will be removed in Docutils 1.0.
+ """
+
self.document = document
"""The `nodes.document` object this Transformer is attached to."""
@@ -167,6 +172,11 @@
return f.priority
resolvers.sort(key=keyfun)
self.unknown_reference_resolvers += resolvers
+ if self.unknown_reference_resolvers:
+ warnings.warn('The `unknown_reference_resolvers` hook chain '
+ 'will be removed in Docutils 1.0.\n'
+ 'Use a transform to resolve references.',
+ DeprecationWarning, stacklevel=2)
def apply_transforms(self) -> None:
"""Apply all of the stored transforms, in priority order."""
Modified: trunk/docutils/test/test_transforms/test__init__.py
===================================================================
--- trunk/docutils/test/test_transforms/test__init__.py 2025-05-25 21:05:14 UTC (rev 10145)
+++ trunk/docutils/test/test_transforms/test__init__.py 2025-05-27 06:14:22 UTC (rev 10146)
@@ -17,6 +17,7 @@
# so we import the local `docutils` package.
sys.path.insert(0, str(Path(__file__).resolve().parents[2]))
+import docutils
from docutils import transforms, utils
@@ -47,5 +48,21 @@
self.assertEqual(transform_record[3], {'foo': 42})
+class TransformerWarningsTestCase(unittest.TestCase):
+
+ @staticmethod
+ def dummy_resolver(node):
+ # Cf. `TransformSpec.unknown_reference_resolvers`.
+ return node.resolved
+
+ def test_deprecation_warnings(self):
+ transformer = transforms.Transformer(utils.new_document('test data'))
+ component = docutils.Component()
+ component.unknown_reference_resolvers = [self.dummy_resolver]
+ self.dummy_resolver.priority = 50
+ with self.assertWarnsRegex(DeprecationWarning, 'will be removed'):
+ transformer.populate_from_components([component])
+
+
if __name__ == '__main__':
unittest.main()
This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site.
|
|
From: <mi...@us...> - 2025-05-27 06:15:18
|
Revision: 10147
http://sourceforge.net/p/docutils/code/10147
Author: milde
Date: 2025-05-27 06:15:14 +0000 (Tue, 27 May 2025)
Log Message:
-----------
LaTeX writer: Use a transform to resolve BibTeX references.
The 'use_bibtex' setting indicates that citation entries are fetched
from a BibTeX database by the backend (LaTeX).
Use a transfrom instead of the deprecated "unknown_reference_resolvers"
hook chain to mark citation_references as resolved.
Modified Paths:
--------------
trunk/docutils/HISTORY.rst
trunk/docutils/RELEASE-NOTES.rst
trunk/docutils/docs/api/transforms.rst
trunk/docutils/docutils/transforms/references.py
trunk/docutils/docutils/writers/latex2e/__init__.py
Modified: trunk/docutils/HISTORY.rst
===================================================================
--- trunk/docutils/HISTORY.rst 2025-05-27 06:14:22 UTC (rev 10146)
+++ trunk/docutils/HISTORY.rst 2025-05-27 06:15:14 UTC (rev 10147)
@@ -17,8 +17,16 @@
Release 0.22rc3 (unpublished)
=============================
-* nothing yet.
+* docutils/writers/latex2e/__init__.py
+ - Replace `Writer.bibtex_reference_resolver()` with a transform.
+
+* docutils/transforms/references.py
+
+ - New transform `CitationReferences`. Marks citation_references
+ as resolved if BibTeX is used by the backend (LaTeX).
+
+
Release 0.22rc2 (2025-05-22)
============================
Modified: trunk/docutils/RELEASE-NOTES.rst
===================================================================
--- trunk/docutils/RELEASE-NOTES.rst 2025-05-27 06:14:22 UTC (rev 10146)
+++ trunk/docutils/RELEASE-NOTES.rst 2025-05-27 06:15:14 UTC (rev 10147)
@@ -164,7 +164,8 @@
* Remove the input_encoding_ auto-detection code in Docutils 1.0.
* Remove the "TransformSpec.unknown_reference_resolvers" hook chain
- in Docutils 1.0. Use a transform.
+ in Docutils 1.0. Use a transform, see
+ `transforms.references.CitationReferences` for an example.
* Remove `parsers.rst.roles.set_classes()` and
`parsers.rst.roles.normalized_role_options()`
@@ -230,7 +231,10 @@
Release 0.22rc3 (unpublished)
=============================
-* nothing yet.
+New objects
+ `transforms.references.`CitationReferences`
+ Mark citation_references as resolved if the backend (LaTeX)
+ uses a BibTeX database.
Release 0.22rc2 (2025-05-22)
============================
Modified: trunk/docutils/docs/api/transforms.rst
===================================================================
--- trunk/docutils/docs/api/transforms.rst 2025-05-27 06:14:22 UTC (rev 10146)
+++ trunk/docutils/docs/api/transforms.rst 2025-05-27 06:15:14 UTC (rev 10147)
@@ -97,6 +97,8 @@
peps_.PEPZero peps.Headers (t/p) 760
+references_.CitationReferences latex2e (w) 770
+
components.Filter *not used* 780
universal_.Decorations Reader (r) 820
@@ -205,6 +207,7 @@
writers.latex2e.Writer
writer_aux.Admonitions
+ references.CitationReferences
writers._html_base.Writer:
writer_aux.Admonitions
Modified: trunk/docutils/docutils/transforms/references.py
===================================================================
--- trunk/docutils/docutils/transforms/references.py 2025-05-27 06:14:22 UTC (rev 10146)
+++ trunk/docutils/docutils/transforms/references.py 2025-05-27 06:15:14 UTC (rev 10147)
@@ -842,6 +842,31 @@
return footnote
+class CitationReferences(Transform):
+ """Resolve <citation_references>.
+
+ The 'use_bibtex'__ configuration setting indicates that citation entries
+ are fetched from a BibTeX database by the backend (LaTeX).
+
+ __ https://docutils.sourceforge.io/docs/user/config.html#use-bibtex
+ """
+ # TODO: Bibliography database support for other output formats.
+
+ default_priority = 770
+ # Apply between `InternalTargets` (660) and `DanglingReferences` (850)
+
+ def apply(self) -> None:
+ if not getattr(self.document.settings, 'use_bibtex', []):
+ return
+ for node in self.document.findall(nodes.citation_reference):
+ # Skip nodes that are resolved or have a matching target:
+ if node.resolved or self.document.nameids.get(node.get('refname')):
+ continue
+ if node.astext(): # ensure text content (becomes the BibTeX key)
+ node.delattr('refname')
+ node.resolved = True
+
+
class DanglingReferences(Transform):
"""
Modified: trunk/docutils/docutils/writers/latex2e/__init__.py
===================================================================
--- trunk/docutils/docutils/writers/latex2e/__init__.py 2025-05-27 06:14:22 UTC (rev 10146)
+++ trunk/docutils/docutils/writers/latex2e/__init__.py 2025-05-27 06:15:14 UTC (rev 10147)
@@ -20,7 +20,7 @@
from pathlib import Path
from docutils import frontend, nodes, languages, writers, utils
-from docutils.transforms import writer_aux
+from docutils.transforms import references, writer_aux
from docutils.utils._roman_numerals import RomanNumeral
from docutils.utils.math import pick_math_environment, unichar2tex
@@ -254,29 +254,13 @@
def __init__(self) -> None:
writers.Writer.__init__(self)
self.translator_class = LaTeXTranslator
- self.unknown_reference_resolvers = [self.bibtex_reference_resolver]
- self.bibtex_reference_resolver.priority = 400
- @staticmethod
- def bibtex_reference_resolver(node: nodes.Element) -> bool:
- """Mark citation references as resolved if BibTeX is used.
-
- Cf. `TransformSpec.unknown_reference_resolvers`.
- """
- if (isinstance(node, nodes.citation_reference)
- and node.document.settings.use_bibtex):
- del node['refname']
- node.resolved = True
- return True
- else:
- return False
-
def get_transforms(self):
# Override parent method to add latex-specific transforms
return super().get_transforms() + [
# Convert specific admonitions to generic one
writer_aux.Admonitions,
- # TODO: footnote collection transform
+ references.CitationReferences,
]
def translate(self) -> None:
This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site.
|
|
From: <mi...@us...> - 2025-05-27 06:17:34
|
Revision: 10148
http://sourceforge.net/p/docutils/code/10148
Author: milde
Date: 2025-05-27 06:17:22 +0000 (Tue, 27 May 2025)
Log Message:
-----------
Documentation Update
Update Link List:
reorganize, fix links, remove broken links and dead projects.
Update "transforms" documentation:
add cross-links, update, small edits.
Various minor documentation fixes.
Modified Paths:
--------------
trunk/docutils/FAQ.rst
trunk/docutils/RELEASE-NOTES.rst
trunk/docutils/docs/api/transforms.rst
trunk/docutils/docs/ref/doctree.rst
trunk/docutils/docs/user/config.rst
trunk/docutils/docs/user/links.rst
Modified: trunk/docutils/FAQ.rst
===================================================================
--- trunk/docutils/FAQ.rst 2025-05-27 06:15:14 UTC (rev 10147)
+++ trunk/docutils/FAQ.rst 2025-05-27 06:17:22 UTC (rev 10148)
@@ -382,18 +382,10 @@
Are there any Weblog (Blog) projects that use reStructuredText syntax?
----------------------------------------------------------------------
-With no implied endorsement or recommendation, and in no particular
-order:
+See the `Docutils Links`_.
-* `Firedrop <http://www.voidspace.org.uk/python/firedrop2/>`__
-* `PyBloxsom <http://pyblosxom.github.io/>`__
-* `Lino WebMan <http://lino.sourceforge.net/webman.html>`__
-* `Pelican <http://blog.getpelican.com/>`__
- (also listed `on PyPi <http://pypi.python.org/pypi/pelican>`__)
-
Please `let us know`_ of any other reStructuredText Blogs.
-
.. _Can lists be indented without generating block quotes?:
How should I mark up lists?
Modified: trunk/docutils/RELEASE-NOTES.rst
===================================================================
--- trunk/docutils/RELEASE-NOTES.rst 2025-05-27 06:15:14 UTC (rev 10147)
+++ trunk/docutils/RELEASE-NOTES.rst 2025-05-27 06:17:22 UTC (rev 10148)
@@ -164,8 +164,8 @@
* Remove the input_encoding_ auto-detection code in Docutils 1.0.
* Remove the "TransformSpec.unknown_reference_resolvers" hook chain
- in Docutils 1.0. Use a transform, see
- `transforms.references.CitationReferences` for an example.
+ in Docutils 1.0. Use a transform_,
+ see `transforms.references.CitationReferences` for an example.
* Remove `parsers.rst.roles.set_classes()` and
`parsers.rst.roles.normalized_role_options()`
@@ -209,10 +209,8 @@
__ docs/api/publisher.html#string-i-o
* Move math format conversion from docutils/utils/math (called from
- docutils/writers/_html_base.py) to a transform__.
+ docutils/writers/_html_base.py) to a transform_.
- __ docs/ref/transforms.html
-
* If the environment variable `SOURCE_DATE_EPOCH`_ is set, the `"date"`_
directive and the timestamp inserted by the "datestamp_"
configuration setting will use its value instead of the current time to
@@ -1441,11 +1439,11 @@
==========
.. _HISTORY: HISTORY.html
-.. _Python 3 compatibility: README.html#python-3-compatibility
+.. _transform: docs/api/transforms.html
+
.. _Docutils Document Model:
.. _Docutils XML: docs/ref/doctree.html
-.. _"refname" attribute: docs/ref/doctree.html#refname
.. _"colwidth" attribute: docs/ref/doctree.html#colwidth
.. _<doctest_block>: docs/ref/doctree.html#doctest-block
@@ -1494,7 +1492,6 @@
.. _docutils-cli.py:
.. _generic command line front end tool:
docs/user/tools.html#generic-command-line-front-end
-.. _rst2html.py:
.. _rst2html: docs/user/tools.html#rst2html
.. _rst2html4: docs/user/tools.html#rst2html4
.. _rst2html5: docs/user/tools.html#rst2html5
Modified: trunk/docutils/docs/api/transforms.rst
===================================================================
--- trunk/docutils/docs/api/transforms.rst 2025-05-27 06:15:14 UTC (rev 10147)
+++ trunk/docutils/docs/api/transforms.rst 2025-05-27 06:17:22 UTC (rev 10148)
@@ -22,29 +22,30 @@
`interpreted text`_, and do other context-sensitive processing.
Each transform is a subclass of `docutils.transforms.Transform`.
-There are `transforms added by components`_, others (e.g.
-``parts.Contents``) are added by the parser, if a corresponding directive_ is
-found in the document.
+Most transforms are added by components, others (e.g. `parts.Contents`) are
+added by the parser if a corresponding directive_ is found in the document.
To add a transform, components (objects inheriting from
`docutils.Component` like Readers, Parsers, Writers, Input, Output) overwrite
-the ``get_transforms()`` method of their base class. After the Reader has
+the `get_transforms()` method of their base class. After the Reader has
finished processing, the Publisher calls
-``Transformer.populate_from_components()`` with a list of components and all
-transforms returned by the component's ``get_transforms()`` method are
-stored in a `transformer object` attached to the document tree.
+`Transformer.populate_from_components()` with a list of components and all
+transforms returned by the component's `get_transforms()` method are
+stored in a `Transformer` object attached to the document tree.
-For more about transforms and the Transformer object, see also `PEP
-258`_. (The ``default_transforms()`` attribute of component classes mentioned
-there is deprecated. Use the ``get_transforms()`` method instead.)
+For more info about transforms and the `Transformer` object,
+see also `PEP 258`_. [#]_
+.. [#] The `default_transforms()` attribute of component classes mentioned
+ in PEP 258 is deprecated. Use the `get_transforms()` method instead.
+
.. _priority:
Transforms Listed in Priority Order
===================================
-Transform classes each have a `default priority` attribute which is used by
+Transform classes each have a `default_priority` attribute which is used by
the Transformer to apply transforms in order (low to high). The default
priority can be overridden when adding transforms to the Transformer object.
@@ -52,79 +53,79 @@
================================== ============================ ========
Transform: module.Class Added By Priority
================================== ============================ ========
-misc_.ClassAttribute `"class"`_ (d/p) 210
+misc_.ClassAttribute `"class"`_ (d/p) _`210`
-references_.Substitutions standalone (r), pep (r) 220
+references_.Substitutions standalone_ (r), pep_ (r) _`220`
-references_.PropagateTargets standalone (r), pep (r) 260
+references_.PropagateTargets standalone_ (r), pep_ (r) _`260`
-frontmatter.\ DocTitle_ standalone (r) 320
+frontmatter.\ DocTitle_ standalone_ (r) _`320`
-frontmatter.\ DocInfo_ standalone (r) 340
+frontmatter.\ DocInfo_ standalone_ (r) _`340`
-frontmatter.\ SectSubTitle_ standalone (r) 350
+frontmatter.\ SectSubTitle_ standalone_ (r) _`350`
-peps_.Headers pep (r) 360
+peps_.Headers pep_ (r) _`360`
-peps_.Contents pep (r) 380
+peps_.Contents pep_ (r) _`380`
-universal_.StripClassesAndElements Writer (w) 420
+universal_.StripClassesAndElements writers_ (w) _`420`
-references_.AnonymousHyperlinks standalone (r), pep (r) 440
+references_.AnonymousHyperlinks standalone_ (r), pep_ (r) _`440`
-references_.IndirectHyperlinks standalone (r), pep (r) 460
+references_.IndirectHyperlinks standalone_ (r), pep_ (r) _`460`
-peps_.TargetNotes pep (r) 520
+peps_.TargetNotes pep_ (r) _`520`
-references_.TargetNotes peps.TargetNotes (t/p) 0
+references_.TargetNotes peps.TargetNotes (t/p) 0
-misc_.CallBack peps.TargetNotes (t/p) 1
+misc_.CallBack peps.TargetNotes (t/p) 1
-references_.TargetNotes `"target-notes"`_ (d/p) 540
+references_.TargetNotes `"target-notes"`_ (d/p) _`540`
-references_.Footnotes standalone (r), pep (r) 620
+references_.Footnotes standalone_ (r), pep_ (r) _`620`
-references_.ExternalTargets standalone (r), pep (r) 640
+references_.ExternalTargets standalone_ (r), pep_ (r) _`640`
-references_.InternalTargets standalone (r), pep (r) 660
+references_.InternalTargets standalone_ (r), pep_ (r) _`660`
-parts_.SectNum `"sectnum"`_ (d/p) 710
+parts_.SectNum `"sectnum"`_ (d/p) _`710`
-parts_.Contents `"contents"`_ (d/p), 720
+parts_.Contents `"contents"`_ (d/p), _`720`
peps.Contents (t/p)
-universal_.StripComments Reader (r) 740
+universal_.StripComments readers_ (r) _`740`
-peps_.PEPZero peps.Headers (t/p) 760
+peps_.PEPZero peps.Headers (t/p) _`760`
-references_.CitationReferences latex2e (w) 770
+references_.CitationReferences latex2e_ (w) _`770`
-components.Filter *not used* 780
+components.Filter *not used* _`780`
-universal_.Decorations Reader (r) 820
+universal_.Decorations readers_ (r) _`820`
-misc_.Transitions standalone (r), pep (r) 830
+misc_.Transitions standalone_ (r), pep_ (r) _`830`
-universal_.Validate Parser 835
+universal_.Validate parsers_ (p) _`835`
-universal_.ExposeInternals Reader (r) 840
+universal_.ExposeInternals readers_ (r) _`840`
-references_.DanglingReferences standalone (r), pep (r) 850
+references_.DanglingReferences standalone_ (r), pep_ (r) _`850`
-universal_.SmartQuotes Parser 855
+universal_.SmartQuotes rst_ (p) _`855`
-universal_.Messages Writer (w) 860
+universal_.Messages writers_ (w) _`860`
-universal_.FilterMessages Writer (w) 870
+universal_.FilterMessages writers_ (w) _`870`
-universal_.TestMessages DocutilsTestSupport 880
+universal_.TestMessages DocutilsTestSupport _`880`
-writer_aux_.Compound *not used, to be removed* 910
+writer_aux_.Compound *not used, to be removed* _`910`
-writer_aux_.Admonitions _html_base (w), 920
- latex2e (w)
+writer_aux_.Admonitions `_html_base`_ (w), _`920`
+ latex2e_ (w)
-misc_.CallBack n/a 990
+misc_.CallBack n/a _`990`
================================== ============================ ========
Key:
@@ -155,62 +156,81 @@
==== ==== ================================================
-Transforms added by components
-===============================
+Transforms Added by Components
+==============================
+.. _readers:
+
readers.Reader:
- | universal.Decorations,
- | universal.ExposeInternals,
- | universal.StripComments
+ | universal.StripComments (740_)
+ | universal.Decorations (820_)
+ | universal.ExposeInternals (840_)
readers.ReReader:
None
+ .. _standalone:
+
readers.standalone.Reader:
- | references.Substitutions,
- | references.PropagateTargets,
- | frontmatter.DocTitle,
- | frontmatter.SectionSubTitle,
- | frontmatter.DocInfo,
- | references.AnonymousHyperlinks,
- | references.IndirectHyperlinks,
- | references.Footnotes,
- | references.ExternalTargets,
- | references.InternalTargets,
- | references.DanglingReferences,
- | misc.Transitions
+ | references.Substitutions (220_)
+ | references.PropagateTargets (260_)
+ | frontmatter.\ DocTitle_ (320_)
+ | frontmatter.\ DocInfo_ (340_)
+ | frontmatter.\ SectSubTitle_ (350_)
+ | references.AnonymousHyperlinks (440_)
+ | references.IndirectHyperlinks (460_)
+ | references.Footnotes (620_)
+ | references.ExternalTargets (640_)
+ | references.InternalTargets (660_)
+ | misc.Transitions (830_)
+ | references.DanglingReferences (850_)
+ .. _pep:
+
readers.pep.Reader:
- | references.Substitutions,
- | references.PropagateTargets,
- | references.AnonymousHyperlinks,
- | references.IndirectHyperlinks,
- | references.Footnotes,
- | references.ExternalTargets,
- | references.InternalTargets,
- | references.DanglingReferences,
- | misc.Transitions,
- | peps.Headers,
- | peps.Contents,
- | peps.TargetNotes
+ | references.Substitutions (220_)
+ | references.PropagateTargets (260_)
+ | peps.Headers (360_)
+ | peps.Contents (380_)
+ | references.AnonymousHyperlinks (440_)
+ | references.IndirectHyperlinks (460_)
+ | peps.TargetNotes (520_)
+ | references.Footnotes (620_)
+ | references.ExternalTargets (640_)
+ | references.InternalTargets (660_)
+ | misc.Transitions (830_)
+ | references.DanglingReferences (850_)
+ .. _parsers:
+
+parsers.Parser
+ universal_.Validate (835_)
+
+ .. _rst:
+
parsers.rst.Parser
- universal.SmartQuotes
+ universal.SmartQuotes (855_)
+ .. _writers:
+
writers.Writer:
- | universal.Messages,
- | universal.FilterMessages,
- | universal.StripClassesAndElements
+ | universal.StripClassesAndElements (420_)
+ | universal.Messages (860_)
+ | universal.FilterMessages (870_)
writers.UnfilteredWriter
None
+ .. _latex2e:
+
writers.latex2e.Writer
- writer_aux.Admonitions
- references.CitationReferences
+ | writer_aux.Admonitions (920_)
+ | references.CitationReferences (770_)
+ .. _`_html_base`:
+
writers._html_base.Writer:
- writer_aux.Admonitions
+ writer_aux.Admonitions (920_)
writers.odf_odt.Writer:
removes references.DanglingReferences
@@ -233,8 +253,8 @@
.. class:: field-indent-12em
:Module: frontmatter_
-:Added by: standalone Reader
-:Default priority_: 340
+:Added by: standalone_ Reader
+:Default priority_: 340_
:Configuration_ setting: docinfo_xform_ (default: True)
Given a document starting [#pre-docinfo]_ with a field list, the DocInfo
@@ -288,8 +308,8 @@
.. class:: field-indent-12em
:Module: frontmatter_
-:Added by: standalone Reader
-:Default priority_: 320
+:Added by: standalone_ Reader
+:Default priority_: 320_
:Configuration_ setting: doctitle_xform_ (default: True)
Under the conditions explained below, the DocTitle transform converts
@@ -433,8 +453,8 @@
.. class:: field-indent-12em
:Module: frontmatter_
-:Added by: standalone Reader
-:Default priority_: 350
+:Added by: standalone_ Reader
+:Default priority_: 350_
:Configuration_ setting: sectsubtitle_xform_ (default: False)
The SectSubTitle transform works like `step 2`_ of the DocTitle_
Modified: trunk/docutils/docs/ref/doctree.rst
===================================================================
--- trunk/docutils/docs/ref/doctree.rst 2025-05-27 06:15:14 UTC (rev 10147)
+++ trunk/docutils/docs/ref/doctree.rst 2025-05-27 06:17:22 UTC (rev 10148)
@@ -4805,8 +4805,9 @@
On a `\<target>`_ element, ``refname`` indicates an `indirect target`_
which may resolve to either an internal or external reference.
-Docutils transforms_ replace the ``refname`` attribute with a refid_
-pointing to the same element.
+Docutils transforms_ replace the ``refname`` attribute with
+a refid_ (refering to the same element) or a refuri_ (refering to an
+external ressource).
``refuri``
Modified: trunk/docutils/docs/user/config.rst
===================================================================
--- trunk/docutils/docs/user/config.rst 2025-05-27 06:15:14 UTC (rev 10147)
+++ trunk/docutils/docs/user/config.rst 2025-05-27 06:17:22 UTC (rev 10148)
@@ -1978,7 +1978,7 @@
use_bibtex
~~~~~~~~~~
-List of style and database(s) for the experimental `BibTeX` support
+List of style and database(s) for the experimental `BibTeX`_ support
(comma-separated_). Example::
--use-bibtex=unsrt,mydb1,mydb2
@@ -1990,6 +1990,8 @@
*Default*: empty list (don't use BibTeX). *Option* ``--use-bibtex``.
+.. _BibTeX: https://www.ctan.org/pkg/bibtex
+
use_latex_abstract
~~~~~~~~~~~~~~~~~~
Use LaTeX abstract environment for the document's abstract_.
Modified: trunk/docutils/docs/user/links.rst
===================================================================
--- trunk/docutils/docs/user/links.rst 2025-05-27 06:15:14 UTC (rev 10147)
+++ trunk/docutils/docs/user/links.rst 2025-05-27 06:17:22 UTC (rev 10148)
@@ -7,481 +7,416 @@
:Author: Lea Wiemann, the Docutils team
:Contact: doc...@li...
:Revision: $Revision$
-:Date: $Date$
+:Date: $Date$ [#]_
:Copyright: This document has been placed in the public domain.
+:Abstract: Links that users of Docutils_ and reStructuredText_ may find useful.
.. title:: Docutils Links
.. contents::
+ :depth: 2
-This document contains links that users of Docutils_ and reStructuredText_
-may find useful.
+.. [#] The most current version of this link list can always be found at
+ https://docutils.sourceforge.io/docs/user/links.html. If you find
+ outdated or broken links or want to suggest additions, please `let us
+ know`__ and we'll update the list here.
-The most current version of this link list can always be found at
-https://docutils.sourceforge.io/docs/user/links.html.
-If you find outdated or broken links or want to suggest additions,
-please `let us know`__ and we'll update the list here.
-
.. _Docutils: https://docutils.sourceforge.io/
.. _reStructuredText: https://docutils.sourceforge.io/rst.html
__ mailing-lists.html#docutils-users
-Editors
--------
+Extensions
+==========
-Advanced text editors with reStructuredText support, IDEs, and docutils GUIs:
+Drop-in components and front-end tools for Docutils that extend the
+reStructuredText syntax or feature set.
-* Emacs `rst mode <https://docutils.sourceforge.io/tools/editors/emacs>`__.
+Import
+------
-* `Vim <https://www.vim.org/index.php>`__:
+Markdown
+````````
- - `reStructuredText syntax highlighting mode
- <https://www.vim.org/scripts/script.php?script_id=973>`__,
+* `myst-docutils`_ --- the MyST_ Markdown parser for `single page builds`_.
- - `VST <https://www.vim.org/scripts/script.php?script_id=1334>`__ (Vim
- reStructuredText) plugin for Vim7 with folding.
+ .. _myst-docutils: https://pypi.org/project/myst-docutils/
+ .. _MyST: https://mystmd.org/guide/quickstart-myst-markdown
+ .. _single page builds:
+ https://myst-parser.readthedocs.io/en/latest/docutils.html
- - `VOoM <https://www.vim.org/scripts/script.php?script_id=2657>`__
- plugin for Vim that emulates two-pane outliner with
- support for reStructuredText (since version 4.0b2).
+* pycmark_ --- small, customizable drop-in parser for CommonMark_ Markdown.
- - `Riv: Take notes in rST <https://github.com/Rykka/riv.vim>`__ Vim
- plugin to take notes in reStructured text.
+ .. _pycmark: https://pypi.org/project/pycmark/
+ .. _CommonMark: https://spec.commonmark.org/current/
-* `reStructuredText Language Support for Visual Studio Code`__
- __ https://github.com/vscode-restructuredtext/vscode-restructuredtext
+.. Python 2 only
-* `reStructuredText editor plug-in for Eclipse`__
+ PySource_, by Tony Ibbs, is an experimental Python source Reader.
+ There is some related code in David Goodger's sandbox
+ (pysource_reader_) and a `Python Source Reader`_ document.
- __ http://resteditor.sourceforge.net/
+ .. _PySource: https://docutils.sourceforge.io/sandbox/tibs/pysource/
+ .. _pysource_reader: https://docutils.sourceforge.io/sandbox/davidg/pysource_reader/
+ .. _Python Source Reader: https://docutils.sourceforge.io/docs/dev/pysource.html
-* `JED <https://www.jedsoft.org/jed/>`__ programmers editor with
- `rst mode <httpss://jedmodes.sourceforge.io/mode/rst/>`__
-* Gnome's gedit offers syntax highlighting and a reST preview pane.
- Latest version of the plugin is available from `bittner @ github`_
- (See also: `Gedit third party plugins`__).
+.. Python 2 only
- .. _bittner @ github: https://github.com/bittner/gedit-reST-plugin
- __ https://wiki.gnome.org/Apps/Gedit/ThirdPartyPlugins-v3.8
+ The `ASCII art to SVG converter`_ (aafigure_) developed by
+ Chris Liechti can parse ASCII art images, embedded in reST documents and
+ output an image. This would mean that simple illustrations could be
+ embedded as ASCII art in the reST source and still look nice when
+ converted to e.g. HTML
+ .. _ASCII art to SVG converter:
+ https://docutils.sourceforge.io/sandbox/aafigure/
+ .. _aafigure: https://pypi.org/project/docutils-aafigure/
-* Gunnar Schwant's DocFactory_ is a wxPython GUI application for
- Docutils.
+.. only Python 2
- .. _DocFactory: https://docutils.sourceforge.io/sandbox/gschwant/docfactory/doc/
+ restxsl_ by Michael Alyn Miller, lets you transform reStructuredText
+ documents into XML/XHTML files using XSLT stylesheets.
-* ReSTedit_ by Bill Bumgarner is a Docutils GUI for Mac OS X.
+ .. _restxsl: http://www.strangeGizmo.com/products/restxsl/
- .. _ReSTedit: https://svn.red-bean.com/restedit/trunk/README.html
-* `ReText <https://pypi.org/project/ReText/>`_ is a simple but powerful
- editor for Markdown and reStructuredText markup languages.
- It is written in Python using PyQt libraries.
+Export
+------
-* Leo_ is an outliner_, written in Python using PyQt. It can be used as IDE
- for literal programming, as a filing cabinet holding any kind of data and
- as `document editor`__ with outlines containing reStructuredText markup.
+PDF
+```
- .. _Leo: https://leoeditor.com/
- .. _outliner: https://en.wikipedia.org/wiki/Outliner
- __ https://leoeditor.com/tutorial-rst3.html
+* RinohType_ --- pure Python PDF writer
-* `NoTex <https://notex.ch>`_ is a browser-based reStructuredText editor
- with syntax highlighting and PDF/HTML export functionality using Sphinx.
+ .. _RinohType: https://pypi.python.org/pypi/RinohType
-* `rsted <https://github.com/anru/rsted>`_ is a "simple online editor for
- reStructuredText on Flask". You can try it on http://rst.ninjs.org/
+* `rst2pdf (reportlab)`__ --- PDF writer based on ReportLab_.
+ __ https://pypi.org/project/rst2pdf/
+ .. _ReportLab: https://pypi.org/project/reportlab/
-Export
-------
+.. only Python 2
-Projects providing additional export routes.
+ `rst2pdf (rubber)`__ --- front end for PDF generation via LaTeX
+ using the rubber_ building system.
-PDF
-```
+ __ https://docutils.sourceforge.io/sandbox/rst2pdf_rubber/README.html
+ .. _rubber: https://gitlab.com/latex-rubber/rubber/
-* `rst2pdf (reportlab)`__ is a tool to go directly from
- reStructuredText to PDF, via ReportLab__. No LaTeX installation
- is required.
+ `rst2pdf (pdflatex)`__ --- minimal front end for PDF generation via LaTeX.
- __ https://pypi.org/project/rst2pdf/
- __ https://pypi.org/project/reportlab/
-
-* `rst2pdf (pdflatex)`__ by Martin Blais is a minimal front end
- producing LaTeX, compiling the LaTeX file, getting the produced
- output to the destination location and finally deleting all the
- messy temporary files that this process generates.
-
__ https://docutils.sourceforge.io/sandbox/blais/rst2pdf/
-* `rst2pdf (rubber)`__ is a front end for the generation of PDF
- documents from a reStructuredText source via LaTeX in one step
- cleaning up intermediate files. It uses the rubber__ Python wrapper
- for LaTeX and friends.
+.. Python 2 only (or broken)
- __ https://docutils.sourceforge.io/sandbox/rst2pdf/README.html
- __ https://launchpad.net/rubber
+ rlpdf_ --- another PDF writer based on ReportLab_.
-* rlpdf_ is another PDF Writer based on ReportLabs.
-
.. _rlpdf: https://docutils.sourceforge.io/sandbox/dreamcatcher/rlpdf/
-* RinohType_ is a pure Python PDF Writer based on a document template and a
- style sheet (beta).
+ >>> from rlpdf import Writer
+ ImportError: cannot import name 'Writer' from partially initialized
+ module 'rlpdf' (most likely due to a circular import)
- .. _RinohType: https://pypi.python.org/pypi/RinohType
-website generators and HTML variants
-````````````````````````````````````
+Others
+``````
-* The Sphinx_ Python Documentation Generator by Georg Brandl was
- originally created to translate the `Python documentation`_.
- In the meantime, there is a wide range of `Projects using Sphinx`__
+* `DocBook Writer`_ (only Python 2)
- It can generate complete web sites (interlinked and indexed HTML pages),
- ePub, LaTeX, and others from a set of rST source files.
+ .. _DocBook Writer: https://docutils.sourceforge.io/sandbox/oliverr/docbook/
- .. _Sphinx: https://www.sphinx-doc.org
- __ https://www.sphinx-doc.org/en/master/examples.html
+* `pickle writer`_ --- "pickle__" the document tree to a binary string.
-* The Nikola_ static site generator, uses reStructuredText by
- default.
+ .. _pickle writer:
+ https://docutils.sourceforge.io/sandbox/blais/pickle_writer/
+ __ https://docs.python.org/3/library/pickle.html
- .. _nikola: https://getnikola.com/
+* rst2confluence__ converts reStructuredText to Confluence__ CMS markup.
-* Pelican_ is a static site generator (mainly for blogs). Articles/pages can
- be written in reStructuredText or Markdown_ format.
+ __ https://github.com/netresearch/rst2confluence
+ __ https://www.atlassian.com/software/confluence
- .. _pelican: https://docs.getpelican.com
+* rst2epub2_ (only Python 2)
-* tinkerer_ is a static bloggin framework based on Sphinx_.
+ .. _rst2epub2: https://github.com/mattharrison/rst2epub2
- .. _tinkerer: https://pypi.org/project/Tinkerer/
+----------------------------------------------------------
-* htmlnav_ by Gunnar Schwant, is an HTML writer which supports navigation
- bars.
+There are more extensions in the `Docutils Sandbox`_.
- .. _htmlnav: https://docutils.sourceforge.io/sandbox/gschwant/htmlnav/
+.. _Docutils Sandbox: https://docutils.sourceforge.io/sandbox/README.html
-* rest2web, by Michael Foord, is a tool for creating web sites with
- reStructuredText. Development stalled, there is a fork at
- https://gitlab.com/wavexx/rest2web
-* `html4trans <https://docutils.sourceforge.io/sandbox/html4trans/>`__
- produces XHTML conforming to the version 1.0 Transitional DTD that
- contains enough formatting information to be viewed by a lightweight HTML
- browser without CSS support.
+Tools
+=====
-* A `simple HTML writer`_ by Bill Bumgarner that doesn't rely on CSS
- stylesheets.
+* a Makefile_ for driving Docutils,
- .. _simple HTML writer: https://docutils.sourceforge.io/sandbox/bbum/DocArticle/
+ .. _Makefile: https://docutils.sourceforge.io/sandbox/cben/make/
-ePub
-````
+* rstcheck_ checks syntax of reStructuredText and code blocks nested
+ within it.
-* rst2epub2_ by Matt Harrison includes the epublib (originally by Tim
- Tambin) and a rst2epub.py executable for the conversion.
+ .. _rstcheck: https://pypi.python.org/pypi/rstcheck
- .. _rst2epub2: https://github.com/mattharrison/rst2epub2
+* restview_ --- live preview for reStructuredText documents,
-* Sphinx_ provides ePub as output option, too.
+ .. _restview: https://mg.pov.lt/restview/
-Others
-``````
+Editors
+-------
-* Pandoc_ is a document converter that can write Markdown_,
- reStructuredText, HTML, LaTeX, RTF, DocBook XML, and S5.
+Editors and IDEs with reStructuredText support.
- .. _Pandoc: https://pandoc.org/
+* Eclipse_ IDE with `ReST Editor`__ plug-in.
-* restxsl_ by Michael Alyn Miller, lets you transform reStructuredText
- documents into XML/XHTML files using XSLT stylesheets.
+ .. _Eclipse: https://eclipseide.org/
+ __ http://resteditor.sourceforge.net/
- .. _restxsl: http://www.strangeGizmo.com/products/restxsl/
+* Emacs__ extensible text editor with `rst mode`__.
-* An `XSLT script`__ by Ladislav Lhotka enables reStructuredText annotations
- to be included in RELAG NG XML schemas.
+ __ https://www.gnu.org/software/emacs/
+ __ https://docutils.sourceforge.io/tools/editors/emacs/
- __ https://www.cesnet.cz/doc/techzpravy/2006/rngrest/
+* Geany_ lightweight IDE.
-* `DocBook Writer`_ by Oliver Rutherfurd.
+ .. _geany: http://www.geany.org/
- .. _DocBook Writer: https://docutils.sourceforge.io/sandbox/oliverr/docbook/
+* gedit_ with the gedit-reST-plugin__.
-* Nabu_, written by Martin Blais, is a publishing system which
- extracts information from reStructuredText documents and stores it
- in a database. Python knowledge is required to write extractor
- functions and to retrieve the data from the database again.
+ .. _gedit: https://gedit-text-editor.org/
+ __ https://github.com/bittner/gedit-reST-plugin
- .. _Nabu: https://github.com/blais/nabu
+* JED__ programmers editor with `rst mode`__.
-* The `pickle writer`_ by Martin Blais pickles the document tree to a binary
- string. Later unpickling will allow you to publish with other Writers.
+ __ https://www.jedsoft.org/jed/
+ __ https://jedmodes.sourceforge.io/mode/rst/
- .. _pickle writer: https://docutils.sourcef...
[truncated message content] |
|
From: <mi...@us...> - 2025-05-27 06:17:56
|
Revision: 10149
http://sourceforge.net/p/docutils/code/10149
Author: milde
Date: 2025-05-27 06:17:51 +0000 (Tue, 27 May 2025)
Log Message:
-----------
Announce upcoming changes to the default transforms.
Modified Paths:
--------------
trunk/docutils/RELEASE-NOTES.rst
trunk/docutils/docs/api/transforms.rst
Modified: trunk/docutils/RELEASE-NOTES.rst
===================================================================
--- trunk/docutils/RELEASE-NOTES.rst 2025-05-27 06:17:22 UTC (rev 10148)
+++ trunk/docutils/RELEASE-NOTES.rst 2025-05-27 06:17:51 UTC (rev 10149)
@@ -167,6 +167,12 @@
in Docutils 1.0. Use a transform_,
see `transforms.references.CitationReferences` for an example.
+* Ignore `transforms.references.DanglingReferences` and
+ `transforms.references.DanglingReferencesVisitor` in Docutils 1.0;
+ remove them in Docutils 2.0. [rationale__]
+
+ __ docs/api/transforms.html#dangling
+
* Remove `parsers.rst.roles.set_classes()` and
`parsers.rst.roles.normalized_role_options()`
(obsoleted by `parsers.rst.roles.normalize_options()`) in Docutils 2.0.
@@ -208,6 +214,9 @@
__ docs/api/publisher.html#string-i-o
+* Change the default priority of the `universal.SmartQuotes` transform_
+ from 855 (very late) to 510 (main) in Docutils 1.0.
+
* Move math format conversion from docutils/utils/math (called from
docutils/writers/_html_base.py) to a transform_.
Modified: trunk/docutils/docs/api/transforms.rst
===================================================================
--- trunk/docutils/docs/api/transforms.rst 2025-05-27 06:17:22 UTC (rev 10148)
+++ trunk/docutils/docs/api/transforms.rst 2025-05-27 06:17:51 UTC (rev 10149)
@@ -110,7 +110,8 @@
universal_.ExposeInternals readers_ (r) _`840`
-references_.DanglingReferences standalone_ (r), pep_ (r) _`850`
+references_.DanglingReferences standalone_ (r), pep_ (r), _`850`
+ *deprecated* [#dangling]_
universal_.SmartQuotes rst_ (p) _`855`
@@ -136,7 +137,17 @@
* (t): Transform
* (/p): Via a `\<pending>`_ element
+.. [#dangling] `references.DanglingReferences` will be split into a
+ transform resolving refnames__ to refids__ and a transform reporting
+ unresolved references to make space for reference-resolving transforms
+ added by extensions or applications
+ (cf. `Release Notes`__).
+ __ ../ref/doctree.html#refname
+ __ ../ref/doctree.html#refid
+ __ ../../RELEASE-NOTES.html#removals
+
+
Transform Priority Range Categories
-----------------------------------
This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site.
|
|
From: <mi...@us...> - 2025-06-01 08:34:09
|
Revision: 10150
http://sourceforge.net/p/docutils/code/10150
Author: milde
Date: 2025-06-01 08:34:07 +0000 (Sun, 01 Jun 2025)
Log Message:
-----------
manpage writer: do not drop text content of inline targets.
Inline targets are eponymous, they point to a text portion that is
also the base of the target's name and id.
Generated manpages do not implement internal hyperlinks but the
document source may be used with different writers and contain
cross references -> print the text as normal text.
Modified Paths:
--------------
trunk/docutils/HISTORY.rst
trunk/docutils/docutils/writers/manpage.py
trunk/docutils/test/test_writers/test_manpage.py
Modified: trunk/docutils/HISTORY.rst
===================================================================
--- trunk/docutils/HISTORY.rst 2025-05-27 06:17:51 UTC (rev 10149)
+++ trunk/docutils/HISTORY.rst 2025-06-01 08:34:07 UTC (rev 10150)
@@ -256,6 +256,7 @@
- Print Docutils version in header comment (feature-request #105).
- Stop converting text to full capitals (bug #481).
- Fix reference output (bug #497).
+ - Do not drop text of internal targets.
- Use macros .UR/.UE for hyperlink references unless the new
configuration setting text_references_ is True.
The current default is True (text references), it will change
Modified: trunk/docutils/docutils/writers/manpage.py
===================================================================
--- trunk/docutils/docutils/writers/manpage.py 2025-05-27 06:17:51 UTC (rev 10149)
+++ trunk/docutils/docutils/writers/manpage.py 2025-06-01 08:34:07 UTC (rev 10150)
@@ -1113,6 +1113,7 @@
% insert_URI_breakpoints(node.astext()))
raise nodes.SkipNode
# elif 'refid' in node:
+ # internal cross references are ignored (just print the text)
def _depart_reference_no_macro(self, node) -> None:
if 'refuri' in node:
@@ -1233,9 +1234,13 @@
self._active_table = None
def visit_target(self, node):
- # targets are in-document hyper targets, without any use for man-pages.
- raise nodes.SkipNode
+ # <target> elements are anchors of internal hyperlinks (not used
+ # in man-pages). Just print content (inline targets may contain text):
+ pass
+ def depart_target(self, node):
+ pass
+
def visit_tbody(self, node) -> None:
pass
Modified: trunk/docutils/test/test_writers/test_manpage.py
===================================================================
--- trunk/docutils/test/test_writers/test_manpage.py 2025-05-27 06:17:51 UTC (rev 10149)
+++ trunk/docutils/test/test_writers/test_manpage.py 2025-06-01 08:34:07 UTC (rev 10150)
@@ -358,6 +358,22 @@
public domain
.\\" End of generated man page.
"""],
+["""\
+Internal hyperlinks_ and targets_ are ignored.
+
+.. _hyperlinks:
+
+(Text content of hyperlinks and _`targets` is printed as normal text.)
+""",
+f"""{document_start}{indend_macros}.TH "" "" "" ""
+.SH Name
+ \\- \n\
+Internal hyperlinks and targets are ignored.
+.sp
+(Text content of hyperlinks and targets is printed as normal text.)
+.\\" End of generated man page.
+"""],
+
]
totest['table'] = [
This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site.
|
|
From: <mi...@us...> - 2025-06-01 15:39:37
|
Revision: 10151
http://sourceforge.net/p/docutils/code/10151
Author: milde
Date: 2025-06-01 15:39:34 +0000 (Sun, 01 Jun 2025)
Log Message:
-----------
Warn about duplicate name in references with embedded internal targets.
Named references with embedded internal targets like
```this <that_>`_`` did not check for duplicate names when generating
the target `<target ids="this" names="this" refid="that">`.
(References with embedded URI did check.)
Modified Paths:
--------------
trunk/docutils/HISTORY.rst
trunk/docutils/docutils/parsers/rst/states.py
trunk/docutils/test/test_parsers/test_rst/test_inline_markup.py
trunk/docutils/test/test_transforms/test_hyperlinks.py
Modified: trunk/docutils/HISTORY.rst
===================================================================
--- trunk/docutils/HISTORY.rst 2025-06-01 08:34:07 UTC (rev 10150)
+++ trunk/docutils/HISTORY.rst 2025-06-01 15:39:34 UTC (rev 10151)
@@ -26,7 +26,15 @@
- New transform `CitationReferences`. Marks citation_references
as resolved if BibTeX is used by the backend (LaTeX).
+* docutils/parsers/rst/states.py
+ - Warn about duplicate name in references with embedded internal targets.
+
+* docutils/writers/manpage.py
+
+ - Do not drop text of internal targets.
+
+
Release 0.22rc2 (2025-05-22)
============================
@@ -256,7 +264,6 @@
- Print Docutils version in header comment (feature-request #105).
- Stop converting text to full capitals (bug #481).
- Fix reference output (bug #497).
- - Do not drop text of internal targets.
- Use macros .UR/.UE for hyperlink references unless the new
configuration setting text_references_ is True.
The current default is True (text references), it will change
Modified: trunk/docutils/docutils/parsers/rst/states.py
===================================================================
--- trunk/docutils/docutils/parsers/rst/states.py 2025-06-01 08:34:07 UTC (rev 10150)
+++ trunk/docutils/docutils/parsers/rst/states.py 2025-06-01 15:39:34 UTC (rev 10151)
@@ -857,8 +857,8 @@
self.document.note_refname(reference)
else:
reference['refuri'] = alias
- self.document.note_explicit_target(target, self.parent)
# target.note_referenced_by(name=refname)
+ self.document.note_explicit_target(target, self.parent)
node_list.append(target)
else:
reference['refname'] = refname
Modified: trunk/docutils/test/test_parsers/test_rst/test_inline_markup.py
===================================================================
--- trunk/docutils/test/test_parsers/test_rst/test_inline_markup.py 2025-06-01 08:34:07 UTC (rev 10150)
+++ trunk/docutils/test/test_parsers/test_rst/test_inline_markup.py 2025-06-01 15:39:34 UTC (rev 10151)
@@ -23,6 +23,8 @@
class ParserTestCase(unittest.TestCase):
+ maxDiff = None
+
def test_parser(self):
parser = Parser()
settings = get_default_settings(Parser)
@@ -1152,6 +1154,33 @@
<reference name="anonymouscall" refuri="anonymouscall">
anonymouscall
"""],
+["""\
+Report duplicate refnames. First use: _`named.txt` vs. _`anonymous.html`.
+
+Embedded targets: `<named.txt>`_, `<anonymous.html>`__
+""",
+"""\
+<document source="test data">
+ <paragraph>
+ Report duplicate refnames. First use: \n\
+ <target dupnames="named.txt" ids="named-txt">
+ named.txt
+ vs. \n\
+ <target ids="anonymous-html" names="anonymous.html">
+ anonymous.html
+ .
+ <system_message backrefs="named-txt-1" level="2" line="4" source="test data" type="WARNING">
+ <paragraph>
+ Duplicate explicit target name: "named.txt".
+ <paragraph>
+ Embedded targets: \n\
+ <reference name="named.txt" refuri="named.txt">
+ named.txt
+ <target dupnames="named.txt" ids="named-txt-1" refuri="named.txt">
+ , \n\
+ <reference name="anonymous.html" refuri="anonymous.html">
+ anonymous.html
+"""],
]
totest['embedded_aliases'] = [
@@ -1163,7 +1192,7 @@
<paragraph>
<reference name="phrase reference" refname="alias">
phrase reference
- <target names="phrase\\ reference" refname="alias">
+ <target ids="phrase-reference" names="phrase\\ reference" refname="alias">
"""],
["""\
`anonymous reference <alias_>`__
@@ -1245,6 +1274,33 @@
<reference name="anonymous reference" refname="aliaswith\\ escaped :characters">
anonymous reference
"""],
+["""\
+Report duplicate refnames: First use: _`named` vs. _`anonymous`.
+
+Embedded alias: `named <anonymous_>`_, `ano <anonymous_>`__
+""",
+"""\
+<document source="test data">
+ <paragraph>
+ Report duplicate refnames: First use: \n\
+ <target dupnames="named" ids="named">
+ named
+ vs. \n\
+ <target ids="anonymous" names="anonymous">
+ anonymous
+ .
+ <system_message backrefs="named-1" level="2" line="4" source="test data" type="WARNING">
+ <paragraph>
+ Duplicate explicit target name: "named".
+ <paragraph>
+ Embedded alias: \n\
+ <reference name="named" refname="anonymous">
+ named
+ <target dupnames="named" ids="named-1" refname="anonymous">
+ , \n\
+ <reference name="ano" refname="anonymous">
+ ano
+"""],
]
totest['inline_targets'] = [
Modified: trunk/docutils/test/test_transforms/test_hyperlinks.py
===================================================================
--- trunk/docutils/test/test_transforms/test_hyperlinks.py 2025-06-01 08:34:07 UTC (rev 10150)
+++ trunk/docutils/test/test_transforms/test_hyperlinks.py 2025-06-01 15:39:34 UTC (rev 10151)
@@ -27,6 +27,8 @@
class TransformTestCase(unittest.TestCase):
+ maxDiff = None
+
def test_transforms(self):
parser = Parser()
settings = get_default_settings(Parser)
@@ -373,7 +375,7 @@
An \n\
<reference name="embedded alias" refuri="ham.py">
embedded alias
- <target names="embedded\\ alias" refuri="ham.py">
+ <target ids="embedded-alias" names="embedded\\ alias" refuri="ham.py">
.
<paragraph>
Another reference to the same \n\
@@ -405,11 +407,11 @@
An \n\
<problematic ids="problematic-1" refid="system-message-2">
`embedded alias <alias_>`_
- <target names="embedded\\ alias" refname="alias">
+ <target ids="embedded-alias" names="embedded\\ alias" refname="alias">
with unknown reference.
<system_message ids="system-message-1" level="3" line="1" source="test data" type="ERROR">
<paragraph>
- Indirect hyperlink target "embedded alias" refers to target "alias", which does not exist.
+ Indirect hyperlink target "embedded alias" (id="embedded-alias") refers to target "alias", which does not exist.
<system_message backrefs="problematic-1" ids="system-message-2" level="3" line="1" source="test data" type="ERROR">
<paragraph>
Unknown target name: "alias".
This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site.
|
|
From: <mi...@us...> - 2025-06-02 19:20:28
|
Revision: 10152
http://sourceforge.net/p/docutils/code/10152
Author: milde
Date: 2025-06-02 19:20:17 +0000 (Mon, 02 Jun 2025)
Log Message:
-----------
Announce deprecation of `<target>` elements with content. Prepare "latex" writer.
The `<target>` element has 2 use cases:
a) as empty "body element" to provide a "name" attribute for the next
body element (via the `references.PropagateTargets` transform)
or to map a reference name to a "refid" or "refuri".
b) as "inline element" with text content to provide an anchor.
For use case b), the generic `<inline>` element is equally well suited.
Deprecation of the inline use simplifies the definition and validation
of `<target>` elements (only valid as empty block-level element).
Change `LaTeXTranslator.visit_inline()` to insert labels for the given node's IDs.
(Preparation for the future use of `<inline>` for inline anchors and generally
a good idea.)
Modified Paths:
--------------
trunk/docutils/HISTORY.rst
trunk/docutils/RELEASE-NOTES.rst
trunk/docutils/docutils/writers/latex2e/__init__.py
Modified: trunk/docutils/HISTORY.rst
===================================================================
--- trunk/docutils/HISTORY.rst 2025-06-01 15:39:34 UTC (rev 10151)
+++ trunk/docutils/HISTORY.rst 2025-06-02 19:20:17 UTC (rev 10152)
@@ -20,6 +20,8 @@
* docutils/writers/latex2e/__init__.py
- Replace `Writer.bibtex_reference_resolver()` with a transform.
+ - `LaTeXTranslator.visit_inline()` now inserts labels for the
+ node's IDs.
* docutils/transforms/references.py
Modified: trunk/docutils/RELEASE-NOTES.rst
===================================================================
--- trunk/docutils/RELEASE-NOTES.rst 2025-06-01 15:39:34 UTC (rev 10151)
+++ trunk/docutils/RELEASE-NOTES.rst 2025-06-02 19:20:17 UTC (rev 10152)
@@ -59,6 +59,12 @@
* The "rst" parser will warn if a `"figure"`_ directive is missing both
caption and legend in Docutils 1.0.
+* The "rst" parser will use <inline> elements for inline targets
+ in Docutils 1.0.
+
+* <target> elements with content will be deprecated in Docutils 1.0
+ and invalid in Docutils 2.0.
+
* To match the definition in the "Exchange Table Model", the
`"colwidth" attribute`_ will be stored as a `str` (instead of
numerical) value in Python element instances in Docutils 1.0.
Modified: trunk/docutils/docutils/writers/latex2e/__init__.py
===================================================================
--- trunk/docutils/docutils/writers/latex2e/__init__.py 2025-06-01 15:39:34 UTC (rev 10151)
+++ trunk/docutils/docutils/writers/latex2e/__init__.py 2025-06-02 19:20:17 UTC (rev 10152)
@@ -1765,7 +1765,6 @@
def visit_caption(self, node) -> None:
self.out.append('\n\\caption{')
- self.out += self.ids_to_labels(node, set_anchor=False)
self.visit_inline(node)
def depart_caption(self, node) -> None:
@@ -2334,7 +2333,8 @@
num = '[%s]' % num
self.out.append('%%\n\\DUfootnotetext{%s}{%s}{%s}{' %
(node['ids'][0], backref, self.encode(num)))
- if node['ids'] == node['names']:
+ if node['ids'] == [nodes.make_id(n) for n in node['names']]:
+ # autonumber-label: create anchor
self.out += self.ids_to_labels(node)
# prevent spurious whitespace if footnote starts with paragraph:
if len(node) > 1 and isinstance(node[1], nodes.paragraph):
@@ -2505,7 +2505,17 @@
def depart_image(self, node) -> None:
self.out += self.ids_to_labels(node, newline=True)
- def visit_inline(self, node) -> None: # <span>, i.e. custom roles
+ def visit_inline(self, node) -> None:
+ # This function is also called by the visiting functions for
+ # specific inline elements, <caption>, and <paragraph>.
+
+ # Handle "ids" attribute:
+ # do we need a \phantomsection?
+ set_anchor = not (isinstance(node.parent, (nodes.caption, nodes.title))
+ or isinstance(node, nodes.caption))
+ add_newline = isinstance(node, nodes.paragraph)
+ self.out += self.ids_to_labels(node, set_anchor, newline=add_newline)
+ # Handle "classes" attribute:
for cls in node['classes']:
if cls.startswith('language-'):
language = self.babel.language_name(cls[9:])
@@ -2705,15 +2715,19 @@
def visit_math(self, node, math_env='$'):
"""math role"""
- self.visit_inline(node)
self.requirements['amsmath'] = r'\usepackage{amsmath}'
math_code = node.astext().translate(unichar2tex.uni2tex_table)
if math_env == '$':
+ self.visit_inline(node)
if self.alltt:
wrapper = ['\\(', '\\)']
else:
wrapper = ['$', '$']
else:
+ for cls in node['classes']:
+ if not self.fallback_stylesheet:
+ self.fallbacks['inline'] = PreambleCmds.inline
+ self.out.append(r'\DUrole{%s}{' % cls)
labels = self.ids_to_labels(node, set_anchor=False, newline=True)
wrapper = ['%%\n\\begin{%s}\n' % math_env,
'\n',
@@ -2814,7 +2828,6 @@
self.out.append('\n')
else:
self.out.append('\n')
- self.out += self.ids_to_labels(node, newline=True)
self.visit_inline(node)
def depart_paragraph(self, node) -> None:
@@ -3111,13 +3124,10 @@
## self.out.append('%% %s\n' % node) # for debugging
return
self.out.append('%\n')
- # do we need an anchor (\phantomsection)?
- set_anchor = not isinstance(node.parent, (nodes.caption, nodes.title))
- # TODO: where else can/must we omit the \phantomsection?
- self.out += self.ids_to_labels(node, set_anchor)
+ self.visit_inline(node)
def depart_target(self, node) -> None:
- pass
+ self.depart_inline(node)
def visit_tbody(self, node) -> None:
# BUG write preamble if not yet done (colspecs not [])
This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site.
|