|
From: <mi...@us...> - 2021-09-20 13:03:41
|
Revision: 8831
http://sourceforge.net/p/docutils/code/8831
Author: milde
Date: 2021-09-20 13:03:39 +0000 (Mon, 20 Sep 2021)
Log Message:
-----------
Skip system_messages when propagating targets. Fixes bug #425.
Testing with "alltests.py" is currently impossible due to
caching (see itest_hyperlinks_de.py)
Modified Paths:
--------------
trunk/docutils/HISTORY.txt
trunk/docutils/docutils/transforms/references.py
trunk/docutils/test/test_transforms/test_hyperlinks.py
Added Paths:
-----------
trunk/docutils/test/test_transforms/itest_hyperlinks_de.py
Modified: trunk/docutils/HISTORY.txt
===================================================================
--- trunk/docutils/HISTORY.txt 2021-09-20 13:03:28 UTC (rev 8830)
+++ trunk/docutils/HISTORY.txt 2021-09-20 13:03:39 UTC (rev 8831)
@@ -57,6 +57,10 @@
.. _LaTeX syntax for mathematics: docs/ref/rst/mathematics.html
+* docutils/transforms/references.py
+
+ - Skip system_messages when propagating targets. Fixes bug #425.
+
* docutils/utils/__init__.py
- Removed ``unique_combinations`` (obsoleted by ``itertools.combinations``).
@@ -109,13 +113,13 @@
- Apply patch #181 "Fix tocdepth when chapter/part in use" by
John Thorvald Wodder II.
-
+
- Fix newlines after/before ids_to_labels() (cf. patch #183).
- Refactor/revise ToC writing.
-
+
- Don't add ``\phantomsection`` to labels in math-blocks.
-
+
- Improve spacing and allow customization of Docutils-generated table
of contents.
Modified: trunk/docutils/docutils/transforms/references.py
===================================================================
--- trunk/docutils/docutils/transforms/references.py 2021-09-20 13:03:28 UTC (rev 8830)
+++ trunk/docutils/docutils/transforms/references.py 2021-09-20 13:03:39 UTC (rev 8831)
@@ -42,7 +42,7 @@
def apply(self):
for target in self.document.traverse(nodes.target):
- # Only block-level targets without reference (like ".. target:"):
+ # Only block-level targets without reference (like ".. _target:"):
if (isinstance(target.parent, nodes.TextElement) or
(target.hasattr('refid') or target.hasattr('refuri') or
target.hasattr('refname'))):
@@ -49,41 +49,44 @@
continue
assert len(target) == 0, 'error: block-level target has children'
next_node = target.next_node(ascend=True)
+ # skip system messages (may be removed by universal.FilterMessages)
+ while isinstance(next_node, nodes.system_message):
+ next_node = next_node.next_node(ascend=True, descend=False)
# Do not move names and ids into Invisibles (we'd lose the
# attributes) or different Targetables (e.g. footnotes).
- if (next_node is not None and
- ((not isinstance(next_node, nodes.Invisible) and
- not isinstance(next_node, nodes.Targetable)) or
- isinstance(next_node, nodes.target))):
- next_node['ids'].extend(target['ids'])
- next_node['names'].extend(target['names'])
- # Set defaults for next_node.expect_referenced_by_name/id.
- if not hasattr(next_node, 'expect_referenced_by_name'):
- next_node.expect_referenced_by_name = {}
- if not hasattr(next_node, 'expect_referenced_by_id'):
- next_node.expect_referenced_by_id = {}
- for id in target['ids']:
- # Update IDs to node mapping.
- self.document.ids[id] = next_node
- # If next_node is referenced by id ``id``, this
- # target shall be marked as referenced.
- next_node.expect_referenced_by_id[id] = target
- for name in target['names']:
- next_node.expect_referenced_by_name[name] = target
- # If there are any expect_referenced_by_... attributes
- # in target set, copy them to next_node.
- next_node.expect_referenced_by_name.update(
- getattr(target, 'expect_referenced_by_name', {}))
- next_node.expect_referenced_by_id.update(
- getattr(target, 'expect_referenced_by_id', {}))
- # Set refid to point to the first former ID of target
- # which is now an ID of next_node.
- target['refid'] = target['ids'][0]
- # Clear ids and names; they have been moved to
- # next_node.
- target['ids'] = []
- target['names'] = []
- self.document.note_refid(target)
+ if (next_node is None
+ or isinstance(next_node, (nodes.Invisible, nodes.Targetable))
+ and not isinstance(next_node, nodes.target)):
+ continue
+ next_node['ids'].extend(target['ids'])
+ next_node['names'].extend(target['names'])
+ # Set defaults for next_node.expect_referenced_by_name/id.
+ if not hasattr(next_node, 'expect_referenced_by_name'):
+ next_node.expect_referenced_by_name = {}
+ if not hasattr(next_node, 'expect_referenced_by_id'):
+ next_node.expect_referenced_by_id = {}
+ for id in target['ids']:
+ # Update IDs to node mapping.
+ self.document.ids[id] = next_node
+ # If next_node is referenced by id ``id``, this
+ # target shall be marked as referenced.
+ next_node.expect_referenced_by_id[id] = target
+ for name in target['names']:
+ next_node.expect_referenced_by_name[name] = target
+ # If there are any expect_referenced_by_... attributes
+ # in target set, copy them to next_node.
+ next_node.expect_referenced_by_name.update(
+ getattr(target, 'expect_referenced_by_name', {}))
+ next_node.expect_referenced_by_id.update(
+ getattr(target, 'expect_referenced_by_id', {}))
+ # Set refid to point to the first former ID of target
+ # which is now an ID of next_node.
+ target['refid'] = target['ids'][0]
+ # Clear ids and names; they have been moved to
+ # next_node.
+ target['ids'] = []
+ target['names'] = []
+ self.document.note_refid(target)
class AnonymousHyperlinks(Transform):
Added: trunk/docutils/test/test_transforms/itest_hyperlinks_de.py
===================================================================
--- trunk/docutils/test/test_transforms/itest_hyperlinks_de.py (rev 0)
+++ trunk/docutils/test/test_transforms/itest_hyperlinks_de.py 2021-09-20 13:03:39 UTC (rev 8831)
@@ -0,0 +1,76 @@
+#! /usr/bin/env python
+
+# $Id$
+# Author: David Goodger <go...@py...>
+# Copyright: This module has been placed in the public domain.
+
+"""
+Tests for docutils.transforms.references.Hyperlinks with non-English language.
+
+TODO: This test fails currently when run as part of "alltests" because
+
+ - the "info" system-messages for directive fallbacks are only generated
+ once (the name -> directive mapping is cached in
+ ``docutils.parsers.rst.directives._directives``).
+
+ - the cache is not reset between after processing a document
+ (i.e. it contains name -> directive mappings from other tests).
+
+ See also https://sourceforge.net/p/docutils/feature-requests/71/
+"""
+
+from __future__ import absolute_import
+
+if __name__ == '__main__':
+ import __init__
+from test_transforms import DocutilsTestSupport
+from docutils.transforms.references import PropagateTargets, \
+ AnonymousHyperlinks, IndirectHyperlinks, ExternalTargets, \
+ InternalTargets, DanglingReferences
+from docutils.parsers.rst import Parser, directives
+
+def suite():
+ parser = Parser()
+ settings = {}
+ settings['language_code'] = 'de'
+ s = DocutilsTestSupport.TransformTestSuite(
+ parser, suite_settings=settings)
+ s.generateTests(totest)
+ return s
+
+totest = {}
+
+totest['hyperlinks'] = ((PropagateTargets, AnonymousHyperlinks,
+ IndirectHyperlinks, ExternalTargets,
+ InternalTargets, DanglingReferences), [
+
+["""\
+Target_ should propagate past the system_message to set "id" on note.
+
+.. _target:
+.. note:: Kurznotiz
+ :name: mynote
+""",
+"""\
+<document source="test data">
+ <paragraph>
+ <reference name="Target" refid="target">
+ Target
+ should propagate past the system_message to set "id" on note.
+ <target refid="target">
+ <system_message level="1" line="4" source="test data" type="INFO">
+ <paragraph>
+ No directive entry for "note" in module "docutils.parsers.rst.languages.de".
+ Using English fallback for directive "note".
+ <note ids="mynote target" names="mynote target">
+ <paragraph>
+ Kurznotiz
+ <system_message level="1" source="test data" type="INFO">
+ <paragraph>
+ Using <module 'docutils.languages.de' from '/usr/local/src/docutils-git-svn/docutils/docutils/languages/de.pyc'> for language "de".
+"""],
+])
+
+if __name__ == '__main__':
+ import unittest
+ unittest.main(defaultTest='suite')
Property changes on: trunk/docutils/test/test_transforms/itest_hyperlinks_de.py
___________________________________________________________________
Added: svn:eol-style
## -0,0 +1 ##
+native
\ No newline at end of property
Added: svn:keywords
## -0,0 +1 ##
+Author Date Id Revision
\ No newline at end of property
Modified: trunk/docutils/test/test_transforms/test_hyperlinks.py
===================================================================
--- trunk/docutils/test/test_transforms/test_hyperlinks.py 2021-09-20 13:03:28 UTC (rev 8830)
+++ trunk/docutils/test/test_transforms/test_hyperlinks.py 2021-09-20 13:03:39 UTC (rev 8831)
@@ -30,9 +30,8 @@
# target/reference, direct/indirect, internal/external, and named/anonymous,
# plus embedded URIs.
totest['exhaustive_hyperlinks'] = ((PropagateTargets, AnonymousHyperlinks,
- IndirectHyperlinks,
- ExternalTargets, InternalTargets,
- DanglingReferences), [
+ IndirectHyperlinks, ExternalTargets,
+ InternalTargets, DanglingReferences), [
["""\
direct_ external
@@ -185,7 +184,7 @@
internal
<target ids="indirect" names="indirect" refname="implicit">
<paragraph>
- Direct internal reference:
+ Direct internal reference: \n\
<problematic ids="problematic-2" refid="system-message-2">
Implicit_
<system_message backrefs="problematic-1" ids="system-message-1" level="3" line="11" source="test data" type="ERROR">
@@ -840,7 +839,7 @@
<title refid="toc-entry-1">
Section
<paragraph>
- Testing an
+ Testing an \n\
<reference name="indirect reference to the table of contents" refid="table-of-contents">
indirect reference to the table of contents
.
This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site.
|
|
From: <mi...@us...> - 2021-09-24 13:35:28
|
Revision: 8834
http://sourceforge.net/p/docutils/code/8834
Author: milde
Date: 2021-09-24 13:35:26 +0000 (Fri, 24 Sep 2021)
Log Message:
-----------
Unify behaviour of "widths" option.
Check that the lenght of an integer list equals the number of
table columns also for the "table" directive.
TODO: use the last value for additional columns
and ignore values for missing columns instead?
Modified Paths:
--------------
trunk/docutils/HISTORY.txt
trunk/docutils/docutils/parsers/rst/directives/tables.py
Modified: trunk/docutils/HISTORY.txt
===================================================================
--- trunk/docutils/HISTORY.txt 2021-09-24 12:52:39 UTC (rev 8833)
+++ trunk/docutils/HISTORY.txt 2021-09-24 13:35:26 UTC (rev 8834)
@@ -42,6 +42,12 @@
- Add `class` option to `Raw` directive.
+* docutils/parsers/rst/directives/tables.py:
+
+ - Unify behaviour of "widths" option: check that the lenght of an
+ integer list equals the number of table columns also for the "table"
+ directive.
+
* docutils/tools/math/math2html.py,
docutils/tools/math/tex2unicode.py,
docutils/writers/html5/math.css
Modified: trunk/docutils/docutils/parsers/rst/directives/tables.py
===================================================================
--- trunk/docutils/docutils/parsers/rst/directives/tables.py 2021-09-24 12:52:39 UTC (rev 8833)
+++ trunk/docutils/docutils/parsers/rst/directives/tables.py 2021-09-24 13:35:26 UTC (rev 8834)
@@ -103,17 +103,18 @@
def widths(self):
return self.options.get('widths', '')
- def get_column_widths(self, max_cols):
+ def get_column_widths(self, n_cols):
if isinstance(self.widths, list):
- if len(self.widths) != max_cols:
+ if len(self.widths) != n_cols:
+ # TODO: use last value for missing columns?
error = self.state_machine.reporter.error(
'"%s" widths do not match the number of columns in table '
- '(%s).' % (self.name, max_cols), nodes.literal_block(
+ '(%s).' % (self.name, n_cols), nodes.literal_block(
self.block_text, self.block_text), line=self.lineno)
raise SystemMessagePropagation(error)
col_widths = self.widths
- elif max_cols:
- col_widths = [100 // max_cols] * max_cols
+ elif n_cols:
+ col_widths = [100 // n_cols] * n_cols
else:
error = self.state_machine.reporter.error(
'No table data detected in CSV file.', nodes.literal_block(
@@ -151,18 +152,19 @@
self.set_table_width(table_node)
if 'align' in self.options:
table_node['align'] = self.options.get('align')
- tgroup = table_node[0]
if isinstance(self.widths, list):
+ tgroup = table_node[0]
+ try:
+ col_widths = self.get_column_widths(tgroup["cols"])
+ except SystemMessagePropagation as detail:
+ return [detail.args[0]]
colspecs = [child for child in tgroup.children
if child.tagname == 'colspec']
- for colspec, col_width in zip(colspecs, self.widths):
+ for colspec, col_width in zip(colspecs, col_widths):
colspec['colwidth'] = col_width
- # @@@ the colwidths argument for <tgroup> is not part of the
- # XML Exchange Table spec (https://www.oasis-open.org/specs/tm9901.htm)
- # and hence violates the docutils.dtd.
if self.widths == 'auto':
table_node['classes'] += ['colwidths-auto']
- elif self.widths: # "grid" or list of integers
+ elif self.widths: # override "table-style" setting
table_node['classes'] += ['colwidths-given']
self.add_name(table_node)
if title:
@@ -483,7 +485,7 @@
table = nodes.table()
if self.widths == 'auto':
table['classes'] += ['colwidths-auto']
- elif self.widths: # "grid" or list of integers
+ elif self.widths: # override "table-style" setting
table['classes'] += ['colwidths-given']
tgroup = nodes.tgroup(cols=len(col_widths))
table += tgroup
This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site.
|
|
From: <mi...@us...> - 2021-09-30 10:15:48
|
Revision: 8835
http://sourceforge.net/p/docutils/code/8835
Author: milde
Date: 2021-09-30 10:15:45 +0000 (Thu, 30 Sep 2021)
Log Message:
-----------
LaTeX writer: New algorithm for table colum widths. Fixes bug #422.
New configuration setting "legacy_column_widths" for backwards
compatibility.
Only write "continued on next page..." if it fits without
making the table columns wider.
Table `width` option overrides conflicting "auto" column `widths`.
Modified Paths:
--------------
trunk/docutils/HISTORY.txt
trunk/docutils/RELEASE-NOTES.txt
trunk/docutils/docs/ref/doctree.txt
trunk/docutils/docs/ref/rst/directives.txt
trunk/docutils/docs/user/config.txt
trunk/docutils/docs/user/latex.txt
trunk/docutils/docutils/parsers/rst/directives/tables.py
trunk/docutils/docutils/writers/latex2e/__init__.py
trunk/docutils/test/functional/expected/latex_cornercases.tex
trunk/docutils/test/functional/expected/latex_memoir.tex
trunk/docutils/test/functional/expected/standalone_rst_latex.tex
trunk/docutils/test/functional/expected/standalone_rst_xetex.tex
trunk/docutils/test/functional/input/data/tables_latex.txt
trunk/docutils/test/functional/tests/latex_cornercases.py
trunk/docutils/test/test_writers/test_latex2e.py
Modified: trunk/docutils/HISTORY.txt
===================================================================
--- trunk/docutils/HISTORY.txt 2021-09-24 13:35:26 UTC (rev 8834)
+++ trunk/docutils/HISTORY.txt 2021-09-30 10:15:45 UTC (rev 8835)
@@ -111,7 +111,6 @@
- Overwrite methods in _html_base.HTMLTranslator that use HTM5 tags
(details, aside, nav, ...) and attributes (role, aria-level).
-
* docutils/writers/latex2e/__init__.py
- The setting `legacy_class_functions`_ now defaults to "False".
@@ -129,6 +128,19 @@
- Improve spacing and allow customization of Docutils-generated table
of contents.
+ - New algorithm for table colum widths. Fixes bug #422.
+ New configuration setting legacy_column_widths_.
+
+ Table.set_table_style() arguments changed.
+
+ Only write "continued on next page..." if it fits
+ without making the table columns wider.
+
+ Table `width` option overrides conflicting "auto" column `widths`.
+
+.. _legacy_column_widths: docs/user/config.html#legacy-column-widths
+
+
* docutils/writers/latex2e/docutils.sty
- Fix excessive padding above sidebar titles.
Modified: trunk/docutils/RELEASE-NOTES.txt
===================================================================
--- trunk/docutils/RELEASE-NOTES.txt 2021-09-24 13:35:26 UTC (rev 8834)
+++ trunk/docutils/RELEASE-NOTES.txt 2021-09-30 10:15:45 UTC (rev 8835)
@@ -31,11 +31,12 @@
deprecated ``<colgroup><col width="...">...``.
The `html5` writer will default to ``:widths: auto`` and use
- ``style="width: ..%"`` if the `"widths" option`__ sets explicite table
- column widths. Use ``:widths: grid`` to keep the current default
- column widths.
+ ``style="width: ..%"`` if the `"widths" option`__ is used.
+ Use the table-style__ setting with value "colwidths-grid" to
+ keep the current default.
- __ docs/ref/rst/directives.html#table
+ __ docs/ref/rst/directives.html#table
+ __ docs/user/config.html#table-style
- Move attribution behind the blockquote to comply with the
`"living standard"`__?
@@ -48,11 +49,13 @@
* `latex2e` writer:
- - Change default of ``use_latex_citations`` to True.
+ - Change default of use_latex_citations_ setting to True.
- - Remove ``--use-verbatim-when-possible`` option
- (use ``--literal-block-env=verbatim``).
+ - Change default of legacy_column_widths_ setting to False.
+ - Remove ``use_verbatim_when_possible`` setting
+ (use literal_block_env_: verbatim).
+
* Remove the "rawsource" attribute and argument from nodes.Text:
we store the null-escaped text in Text nodes since 0.16 so there is no
additional information in the rawsource.
@@ -78,6 +81,8 @@
.. _rst2html.py: docs/user/tools.html#rst2html-py
.. _reference name: docs/ref/rst/restructuredtext.html#reference-names
.. _html_writer: docs/user/config.html#html-writer
+.. _literal_block_env: docs/user/config.html#literal-block-env
+.. _use_latex_citations: docs/user/config.html#use-latex-citations
Release 0.18.dev
@@ -146,9 +151,11 @@
* docutils/utils/math/math2html.py,
docutils/utils/math/latex2mathml.py
- Major refactoring and fixes/additions
- (cf. `LaTeX syntax for mathematics`_).
+ - Major refactoring and fixes/additions
+ (cf. `LaTeX syntax for mathematics`_).
+* New configuration setting: [latex writers] legacy_column_widths_.
+
* Various bugfixes and improvements (see HISTORY_).
__ docs/ref/doctree.html#meta
@@ -157,8 +164,9 @@
.. _id_prefix: docs/user/config.html#id-prefix
.. _auto_id_prefix: docs/user/config.html#auto-id-prefix
.. _details disclosure elements:
- https://www.w3.org/TR/html52/interactive-elements.html#the-details-element
+ https://www.w3.org/TR/html52/interactive-elements.html#the-details-element
.. _LaTeX syntax for mathematics: docs/ref/rst/mathematics.html
+.. _legacy_column_widths: docs/user/config.html#legacy-column-widths
Release 0.17.1 (2021-04-16)
Modified: trunk/docutils/docs/ref/doctree.txt
===================================================================
--- trunk/docutils/docs/ref/doctree.txt 2021-09-24 13:35:26 UTC (rev 8834)
+++ trunk/docutils/docs/ref/doctree.txt 2021-09-30 10:15:45 UTC (rev 8835)
@@ -978,6 +978,9 @@
In contrast to the definition in the exchange-table-model_,
unitless values of the "colwidth" are interpreted as proportional
values, not fixed values with unit "pt".
+
+ .. The reference implementation `html4css2` converts column
+ widths values to percentages.
Future versions of Docutils may use the standard form
``number*``, e.g., “5*” for 5 times the proportion.
Modified: trunk/docutils/docs/ref/rst/directives.txt
===================================================================
--- trunk/docutils/docs/ref/rst/directives.txt 2021-09-24 13:35:26 UTC (rev 8834)
+++ trunk/docutils/docs/ref/rst/directives.txt 2021-09-30 10:15:45 UTC (rev 8835)
@@ -947,18 +947,11 @@
The following options are recognized:
-``widths`` : integer [integer...] or "auto"
- A list of relative column widths.
- The default is equal-width columns (100%/#columns).
- "auto" delegates the determination of column widths to the backend
- (LaTeX, the HTML browser, ...).
-
-``width`` : `length`_ or `percentage`_
- Sets the width of the table to the specified length or percentage
- of the line width. If omitted, the renderer determines the width
- of the table based on its contents or the column ``widths``.
-
+``align`` : "left", "center", or "right"
+ The horizontal alignment of the table.
+ (New in Docutils 0.13)
+
``header-rows`` : integer
The number of rows of list data to use in the table header.
Defaults to 0.
@@ -967,10 +960,22 @@
The number of table columns to use as stubs (row titles, on the
left). Defaults to 0.
-``align`` : "left", "center", or "right"
- The horizontal alignment of the table.
- (New in Docutils 0.13)
+ .. _table width:
+``width`` : `length`_ or `percentage`_
+ Sets the width of the table to the specified length or percentage
+ of the line width. If omitted, the renderer determines the width
+ of the table based on its contents or the column ``widths``.
+
+ .. _column widths:
+
+``widths`` : integer [integer...] or "auto"
+ A list of relative column widths.
+ The default is equal-width columns (100%/#columns).
+
+ "auto" delegates the determination of column widths to the backend
+ (LaTeX, the HTML browser, ...).
+
and the common options class_ and name_.
Modified: trunk/docutils/docs/user/config.txt
===================================================================
--- trunk/docutils/docs/user/config.txt 2021-09-24 13:35:26 UTC (rev 8834)
+++ trunk/docutils/docs/user/config.txt 2021-09-30 10:15:45 UTC (rev 8835)
@@ -1221,6 +1221,13 @@
(leave out the ``<colgroup>`` column specification).
Overridden by the "widths" option of the `table directive`_.
+.. TODO: the HTML5 writer also supports
+
+ colwidths-grid
+ Backwards compatibility setting. Write column widths
+ determined from the source to the HTML file.
+ Overridden by the "widths" option of the `table directive`_.
+
Default: "". Option: ``--table-style``.
.. _table directive: ../ref/rst/directives.html#table
@@ -1588,6 +1595,7 @@
.. _hyperref TeX package: http://tug.org/applications/hyperref/
+
latex_preamble
~~~~~~~~~~~~~~
@@ -1607,7 +1615,7 @@
values are handled with wrappers and admonitions use the ``DUadmonition``
environment. See `Generating LaTeX with Docutils`__ for details.
-Default: False.
+Default: False (changed in Docutils 0.18).
Options: ``--legacy-class-functions``, ``--new-class-functions``.
New in Docutils 0.17.
@@ -1614,6 +1622,26 @@
__ latex.html#classes
+
+legacy_column_widths
+~~~~~~~~~~~~~~~~~~~~
+
+Use "legacy algorithm" or new algorithm to determine table column widths.
+
+The new algorithm limits the table width to the text width or specified
+table width and keeps the ratio of specified column widths.
+
+Custom table and/or column widths can be set with the respective options
+of the `table directive`_. See also `Generating LaTeX with Docutils`__.
+
+Default: True (will change to False in 0.19).
+Options: ``--legacy-column-widths``, ``--new-column-widths``.
+
+New in Docutils 0.18.
+
+__ latex.html#table-style
+
+
literal_block_env
~~~~~~~~~~~~~~~~~
@@ -1628,6 +1656,7 @@
.. _parsed literal: ../ref/rst/directives.html#parsed-literal
+
reference_label
~~~~~~~~~~~~~~~
@@ -1744,34 +1773,14 @@
Specify the default style for tables_.
See also `table_style [html writers]`_.
-Supported values:
+Supported values: "booktabs", "borderless", "colwidths-auto", and "standard".
+See `Generating LaTeX with Docutils`__ for details.
-standard
- Borders around all cells.
+Default: "standard". Option: ``--table-style``.
-booktabs
- A line above and below the table and one after the head.
+__ latex.html#tables
-borderless
- No borders.
-align-left, align-center, align-right
- Align tables.
-
-colwidths-auto, colwidths-given
- Column width determination by LaTeX or Docutils (default).
- Overridden by the `table directive`_'s :widths: option.
-
- .. warning::
-
- ``colwidths-auto`` is only suited for tables with simple cell content.
-
- LaTeX puts the content of auto-sized columns on one line (merging
- paragraphs) and may fail with complex content.
-
-Default: "standard". Option: ``--table-style``.
-
-
.. _template [latex writers]:
template
Modified: trunk/docutils/docs/user/latex.txt
===================================================================
--- trunk/docutils/docs/user/latex.txt 2021-09-24 13:35:26 UTC (rev 8834)
+++ trunk/docutils/docs/user/latex.txt 2021-09-30 10:15:45 UTC (rev 8835)
@@ -250,7 +250,7 @@
``language-`` set the elements language property.
* The table element recognizes some special class values. See section
- table_.
+ `table style`_.
* If the legacy-class-functions_ setting is True, the special macros
``\DUadmonition`` and ``\DUtitle`` are written with a comma separated
@@ -1614,64 +1614,54 @@
.. _CSS length unit ``px``: http://www.w3.org/TR/css-values-3/#px
.. _reference pixel: http://www.w3.org/TR/css-values-3/#reference-pixel
-table
------
+table style
+------------
-A pre-configured table style can be globally selected via the table-style_
+A pre-configured *table style* can be globally selected via the table_style_
setting or set for individual tables via a `class directive`_ or the class
option of the `table directive`_.
-.. _table-style: config.html#table-style-latex-writers
-.. _table directive: ../ref/rst/directives.html#table
+Supported values:
-topic element
--------------
+standard
+ Borders around all cells.
-A topic_ is like a block quote with a title, or a self-contained section
-with no subsections. Topics and rubrics can be used at places where a
-`section title`_ is not allowed (e.g. inside a directive).
+booktabs
+ A line above and below the table and one after the head.
-Example:
- Use a standard paragraph for a topic::
+borderless
+ No borders.
- \newcommand{\DUCLASStopic}{%
- \renewenvironment{quote}{}{}%
- }
+colwidths-auto
+ Column width determination by LaTeX.
+ Overridden by the `table directive`_'s "widths" option.
-.. _topic: ../ref/rst/directives.html#topic
-.. _section title: ../ref/rst/restructuredtext.html#sections
+ .. warning::
+ ``colwidths-auto`` is only suited for tables with simple cell content.
-titles
-------
+ LaTeX puts the content of auto-sized columns on one line (merging
+ paragraphs) and may fail with complex content.
-The titles of admonitions_, sidebar_, and `topic element`_ use
-the ``\DUtitle`` command.
+.. eventually in future
-Example 1:
- a centered and somewhat larger title for topcis::
+ align-left, align-center, align-right
+ Align tables.
- \newcommand*{\DUCLASStopic}{
- \renewcommand*{\DUtitle}[1]{\subsection*{\centering #1}
- }
+By default, *column widths* are computed from the source column widths.
+The `legacy_column_widths`_ setting selects the conversion algorithm.
+Custom column widths can be set with the "widths" option of the `table
+directive`_.
-Example 2:
- a right-pointing hand as title for the "attention" directive::
+See also the section on problems with tables_ below.
- \usepackage{pifont}
- \newcommand*{\DUCLASSattention}{
- \renewcommand*{\DUtitle}[1]{\ding{43}}
- }
+.. _new_column_widths:
+.. _legacy_column_widths: config.html#legacy-column-widths
+.. _table_style: config.html#table-style-latex-writers
+.. _"widths" option:
+.. _table directive: ../ref/rst/directives.html#table
- The title argument is "swallowed" by the command.
- To have both, hand and title use::
- \usepackage{pifont}
- \newcommand*{\DUCLASSattention}{
- \newcommand*{\DUtitle}[1]{\ding{43} #1}
- }
-
-
table of contents
-----------------
@@ -1734,6 +1724,36 @@
.. _interpreted text: ../ref/rst/restructuredtext.html#interpreted-text
+titles
+------
+
+The titles of admonitions_, sidebar_, and `topic element`_ use
+the ``\DUtitle`` command.
+
+Example 1:
+ a centered and somewhat larger title for topcis::
+
+ \newcommand*{\DUCLASStopic}{
+ \renewcommand*{\DUtitle}[1]{\subsection*{\centering #1}
+ }
+
+Example 2:
+ a right-pointing hand as title for the "attention" directive::
+
+ \usepackage{pifont}
+ \newcommand*{\DUCLASSattention}{
+ \renewcommand*{\DUtitle}[1]{\ding{43}}
+ }
+
+ The title argument is "swallowed" by the command.
+ To have both, hand and title use::
+
+ \usepackage{pifont}
+ \newcommand*{\DUCLASSattention}{
+ \newcommand*{\DUtitle}[1]{\ding{43} #1}
+ }
+
+
text encoding
-------------
@@ -1778,6 +1798,24 @@
.. _ucs: http://ctan.org/pkg/unicode
+topic element
+-------------
+
+A topic_ is like a block quote with a title, or a self-contained section
+with no subsections. Topics and rubrics can be used at places where a
+`section title`_ is not allowed (e.g. inside a directive).
+
+Example:
+ Use a standard paragraph for a topic::
+
+ \newcommand{\DUCLASStopic}{%
+ \renewenvironment{quote}{}{}%
+ }
+
+.. _topic: ../ref/rst/directives.html#topic
+.. _section title: ../ref/rst/restructuredtext.html#sections
+
+
transition element
------------------
@@ -1849,7 +1887,7 @@
maybe far away from the footnote mark (see e.g. `<rst/demo.txt>`_).
To get footnote mark and text at the same page, keep footnote mark and
-footnote text close together!
+footnote text close together.
non-breaking hyperlinks
@@ -1908,7 +1946,8 @@
Images__ are included in LaTeX with the help of the `graphicx` package. The
supported file formats depend on the used driver:
-* pdflatex_ and xelatex_ work with PNG, JPG, or PDF, but **not EPS**.
+* pdflatex_, lualatex, and xelatex_ work with PNG, JPG, or PDF,
+ but **not EPS**.
* Standard latex_ can include **only EPS** graphics, no other format.
* latex + dvipdfmx works with EPS and JPG (add 'dvipdfmx' to the
documentoptions_ or graphicx-option_ setting
@@ -2045,8 +2084,7 @@
page foot.
Workaround:
- Select footnote and citation handling with the docutils-footnotes_ and
- use-latex-citations_ options.
+ Select citation handling with the use_latex_citations_ option.
If ``use-latex-citations`` is used, a bibliography is inserted right at
the end of the document. *This should be customizable*.
@@ -2056,36 +2094,22 @@
group, i.e. ``[cite1]_ [cite2]_`` results in ``\cite{cite1,cite2}``.
The appearance in the output can be configured in a `style sheet`_.
-.. _docutils-footnotes: config.html#docutils-footnotes
-.. _use-latex-citations: config.html#use-latex-citations
+.. _use_latex_citations: config.html#use-latex-citations
Tables
``````
-* reST-documents line length is assumed to be 80 characters. The
- *tablewidth* is set relative to this value. If someone produces documents
- with line length of 132 this will lead to suboptimal results.
+* Too wide tables (cf. `bug #422`_):
- You may use the `:widths:` option to manually set the table column widths.
+ Try the new_column_widths_ algorithm or use the `"widths" option`_ to
+ manually set the table column widths.
-* Table: multicol cells are always left aligned.
-
* Table cells with both multirow and multicolumn are currently not possible.
-* literal-blocks in table cells:
+.. _bug #422: https://sourceforge.net/p/docutils/bugs/422/
- - If verbatim or flushleft is used one gets vertical space above and below.
- - This is bad for the topmost paragraph in a cell, therefore the writer
- uses raggedright.
- - Ragged right fails on followup paragraphs as the vertical space would be
- missing.
-* ``--table-style=booktabs``, ``..class:: booktab``: `booktabs` version
- 1.00 does not work with `longtable`. This is solved in newer versions
- (current is 2005/04/14 v1.61803).
-
-
Figures
```````
Modified: trunk/docutils/docutils/parsers/rst/directives/tables.py
===================================================================
--- trunk/docutils/docutils/parsers/rst/directives/tables.py 2021-09-24 13:35:26 UTC (rev 8834)
+++ trunk/docutils/docutils/parsers/rst/directives/tables.py 2021-09-30 10:15:45 UTC (rev 8835)
@@ -164,7 +164,7 @@
colspec['colwidth'] = col_width
if self.widths == 'auto':
table_node['classes'] += ['colwidths-auto']
- elif self.widths: # override "table-style" setting
+ elif self.widths: # "grid" or list of integers
table_node['classes'] += ['colwidths-given']
self.add_name(table_node)
if title:
@@ -485,7 +485,7 @@
table = nodes.table()
if self.widths == 'auto':
table['classes'] += ['colwidths-auto']
- elif self.widths: # override "table-style" setting
+ elif self.widths: # explicitely set column widths
table['classes'] += ['colwidths-given']
tgroup = nodes.tgroup(cols=len(col_widths))
table += tgroup
Modified: trunk/docutils/docutils/writers/latex2e/__init__.py
===================================================================
--- trunk/docutils/docutils/writers/latex2e/__init__.py 2021-09-24 13:35:26 UTC (rev 8834)
+++ trunk/docutils/docutils/writers/latex2e/__init__.py 2021-09-30 10:15:45 UTC (rev 8835)
@@ -52,8 +52,10 @@
r'\usepackage{mathptmx} % Times',
r'\usepackage[scaled=.90]{helvet}',
r'\usepackage{courier}'])
- table_style_values = ('standard', 'booktabs', 'nolines', 'borderless',
- 'colwidths-auto', 'colwidths-given')
+ table_style_values = (# TODO: align-left, align-center, align-right,
+ 'booktabs', 'borderless', 'colwidths-auto',
+ 'colwidths-given', # set by parser if "widths" option is specified
+ 'nolines', 'standard')
settings_spec = (
'LaTeX-Specific Options',
@@ -226,6 +228,17 @@
{'dest': 'legacy_class_functions',
'action': 'store_false',
'validator': frontend.validate_boolean}),
+ ('Use legacy algorithm to determine table column widths (default).',
+ ['--legacy-column-widths'],
+ {'default': True,
+ 'action': 'store_true',
+ 'validator': frontend.validate_boolean}),
+ ('Use new algorithm to determine table column widths '
+ '(future default).',
+ ['--new-column-widths'],
+ {'dest': 'legacy_column_widths',
+ 'action': 'store_false',
+ 'validator': frontend.validate_boolean}),
# TODO: implement "latex footnotes" alternative
('Footnotes with numbers/symbols by Docutils. (default) '
'(The alternative, --latex-footnotes, is not implemented yet.)',
@@ -498,7 +511,7 @@
class PreambleCmds(object):
"""Building blocks for the latex preamble."""
-# Requirements
+# Requirements and Setup
PreambleCmds.color = r"""\usepackage{color}"""
@@ -518,11 +531,9 @@
PreambleCmds.table = r"""\usepackage{longtable,ltcaption,array}
\setlength{\extrarowheight}{2pt}
\newlength{\DUtablewidth} % internal use in tables"""
-# if booktabs:
-# \newcommand{\DUcolumnwidth}[1]{\dimexpr #1\DUtablewidth-2\tabcolsep\relax}
-# else:
-# \newcommand{\DUcolumnwidth}[1]{\dimexpr #1\DUtablewidth-2\tabcolsep-\arrayrulewidth\relax}
+PreambleCmds.table_columnwidth = r"""\newcommand{\DUcolumnwidth}[1]{\dimexpr#1\DUtablewidth-2\tabcolsep\relax}"""
+
PreambleCmds.textcomp = r"""\usepackage{textcomp} % text symbol macros"""
# TODO? Options [force,almostfull] prevent spurious error messages,
# see de.comp.text.tex/2005-12/msg01855
@@ -827,9 +838,6 @@
class Table(object):
"""Manage a table while traversing.
- Maybe change to a mixin defining the visit/departs, but then
- class Table internal variables are in the Translator.
-
Table style might be
:standard: horizontal and vertical lines
@@ -838,11 +846,11 @@
:nolines: alias for borderless
:colwidths-auto: column widths determined by LaTeX
- :colwidths-given: use colum widths from rST source
"""
def __init__(self, translator, latex_type):
self._translator = translator
self._latex_type = latex_type
+ self.legacy_column_widths = False
self.close()
self._colwidths = []
@@ -867,15 +875,20 @@
def is_open(self):
return self._open
- def set_table_style(self, table_style, classes):
+ def set_table_style(self, node, settings):
+ self.legacy_column_widths = settings.legacy_column_widths
+ if 'align' in node:
+ self.set('align', node['align'])
+ # TODO: elif 'align' in classes/settings.table-style:
+ # self.set('align', ...)
borders = [cls.replace('nolines', 'borderless')
- for cls in ['standard'] + table_style + classes
- if cls in ('standard', 'booktabs', 'borderless', 'nolines')]
+ for cls in ['standard'] + settings.table_style + node['classes']
+ if cls in ('standard', 'booktabs', 'borderless', 'nolines')]
self.borders = borders[-1]
- self.colwidths_auto = (('colwidths-auto' in classes
- and 'colwidths-given' not in table_style)
- or ('colwidths-auto' in table_style
- and ('colwidths-given' not in classes)))
+ self.colwidths_auto = (('colwidths-auto' in node['classes']
+ or 'colwidths-auto' in settings.table_style)
+ and 'colwidths-given' not in node['classes']
+ and 'width' not in node)
def get_latex_type(self):
if self._latex_type == 'longtable' and not self.caption:
@@ -911,7 +924,12 @@
else:
opening = [r'\begin{%s}%s' % (latex_type, align)]
if not self.colwidths_auto:
- opening.insert(-1, r'\setlength{\DUtablewidth}{%s}%%'%width)
+ if self.borders == 'standard' and not self.legacy_column_widths:
+ opening.insert(-1, r'\setlength{\DUtablewidth}'
+ r'{\dimexpr%s-%i\arrayrulewidth\relax}%%'
+ % (width, len(self._col_specs)+1))
+ else:
+ opening.insert(-1, r'\setlength{\DUtablewidth}{%s}%%' % width)
return '\n'.join(opening)
def get_closing(self):
@@ -932,39 +950,55 @@
def get_colspecs(self, node):
"""Return column specification for longtable.
-
- Assumes reST line length being 80 characters.
- Table width is hairy.
-
- === ===
- ABC DEF
- === ===
-
- usually gets too narrow, therefore we add 1 (fiddlefactor).
"""
bar = self.get_vertical_bar()
- self._rowspan= [0] * len(self._col_specs)
+ self._rowspan = [0] * len(self._col_specs)
if self.colwidths_auto:
self._colwidths = []
latex_colspecs = ['l'] * len(self._col_specs)
- else:
+ elif self.legacy_column_widths:
+ # use old algorithm for backwards compatibility
width = 80 # assumed standard line length
+ factor = 0.93 # do not make it full linewidth
# first see if we get too wide.
total_width = sum(node['colwidth']+1 for node in self._col_specs)
- # do not make it full linewidth
- factor = 0.93
- if total_width > 80:
+ if total_width > width:
factor *= width / total_width
- self._colwidths = [(factor * float(node['colwidth']+1)/width)
+ self._colwidths = [(factor * (node['colwidth']+1)/width)
+ 0.005 for node in self._col_specs]
latex_colspecs = ['p{%.3f\\DUtablewidth}' % colwidth
for colwidth in self._colwidths]
+ else:
+ # No of characters corresponding to table width = 100%
+ # Characters/line with LaTeX article, A4, Times, default margins
+ # depends on character: M: 40, A: 50, x: 70, i: 120.
+ norm_length = 40
+ # Allowance to prevent unpadded columns like
+ # === ==
+ # ABC DE
+ # === ==
+ # getting too narrow:
+ if 'colwidths-given' not in node.parent.parent['classes']:
+ allowance = 1
+ else:
+ allowance = 0 # "widths" option specified, use exact ratio
+ self._colwidths = [(node['colwidth']+allowance)/norm_length
+ for node in self._col_specs]
+ total_width = sum(self._colwidths)
+ # Limit to 100%, force 100% if table width is specified:
+ if total_width > 1 or 'width' in node.parent.parent.attributes:
+ self._colwidths = [colwidth/total_width
+ for colwidth in self._colwidths]
+ latex_colspecs = ['p{\\DUcolumnwidth{%.3f}}' % colwidth
+ for colwidth in self._colwidths]
return bar + bar.join(latex_colspecs) + bar
def get_column_width(self):
"""Return columnwidth for current cell (not multicell)."""
try:
- return '%.2f\\DUtablewidth' % self._colwidths[self._cell_in_row]
+ if self.legacy_column_widths:
+ return '%.2f\\DUtablewidth' % self._colwidths[self._cell_in_row]
+ return '\\DUcolumnwidth{%.2f}' % self._colwidths[self._cell_in_row]
except IndexError:
return '*'
@@ -971,10 +1005,12 @@
def get_multicolumn_width(self, start, len_):
"""Return sum of columnwidths for multicell."""
try:
- mc_width = sum([width
- for width in ([self._colwidths[start + co]
- for co in range(len_)])])
- return 'p{%.2f\\DUtablewidth}' % mc_width
+ multicol_width = sum([width
+ for width in ([self._colwidths[start + co]
+ for co in range(len_)])])
+ if self.legacy_column_widths:
+ return 'p{%.2f\\DUtablewidth}' % multicol_width
+ return 'p{\\DUcolumnwidth{%.3f}}' % multicol_width
except IndexError:
return 'l'
@@ -1009,11 +1045,17 @@
if 1 == self._translator.thead_depth():
a.append('\\endfirsthead\n')
else:
+ n_c = len(self._col_specs)
a.append('\\endhead\n')
- a.append(r'\multicolumn{%d}{r}' % len(self._col_specs) +
- r'{... continued on next page} \\')
- a.append('\n\\endfoot\n\\endlastfoot\n')
- # for longtable one could add firsthead, foot and lastfoot
+ # footer on all but last page (if it fits):
+ twidth = sum([node['colwidth']+2 for node in self._col_specs])
+ if twidth > 30 or (twidth > 12 and not self.colwidths_auto):
+ a.append(r'\multicolumn{%d}{%s}'
+ % (n_c, self.get_multicolumn_width(0, n_c))
+ + r'{\raggedleft\ldots continued on next page}\\'
+ + '\n')
+ a.append('\\endfoot\n\\endlastfoot\n')
+ # for longtable one could add firsthead, foot and lastfoot
self._in_thead -= 1
return a
@@ -2906,6 +2948,8 @@
def visit_table(self, node):
self.duclass_open(node)
self.requirements['...
[truncated message content] |
|
From: <mi...@us...> - 2021-10-01 13:39:36
|
Revision: 8836
http://sourceforge.net/p/docutils/code/8836
Author: milde
Date: 2021-10-01 13:39:33 +0000 (Fri, 01 Oct 2021)
Log Message:
-----------
HTML5: New default for table column widths (fixes bug #426).
Only specify table column widths, if the "widths" option is set
and is not "auto".
The `table_style`_ setting "colwidths-grid" restores the
current default.
Modified Paths:
--------------
trunk/docutils/HISTORY.txt
trunk/docutils/RELEASE-NOTES.txt
trunk/docutils/docs/ref/rst/directives.txt
trunk/docutils/docs/user/config.txt
trunk/docutils/docutils/writers/_html_base.py
trunk/docutils/docutils/writers/latex2e/__init__.py
trunk/docutils/test/functional/expected/footnotes_html5.html
trunk/docutils/test/functional/expected/latex_memoir.tex
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/standalone_rst_html4css1.html
trunk/docutils/test/functional/expected/standalone_rst_html5.html
trunk/docutils/test/functional/expected/standalone_rst_latex.tex
trunk/docutils/test/functional/expected/standalone_rst_xetex.tex
trunk/docutils/test/functional/input/data/math.txt
trunk/docutils/test/test_writers/test_html5_polyglot_parts.py
Modified: trunk/docutils/HISTORY.txt
===================================================================
--- trunk/docutils/HISTORY.txt 2021-09-30 10:15:45 UTC (rev 8835)
+++ trunk/docutils/HISTORY.txt 2021-10-01 13:39:33 UTC (rev 8836)
@@ -26,7 +26,7 @@
__ docs/ref/doctree.html#meta
- - document.make_id(): Keep leading number and hyphen characters
+ - document.make_id(): Do not strip leading number and hyphen characters
from `name` if the id_prefix setting is non-empty.
- ``Node.traverse()`` returns an iterator instead of a list.
@@ -44,7 +44,7 @@
* docutils/parsers/rst/directives/tables.py:
- - Unify behaviour of "widths" option: check that the lenght of an
+ - Unify behaviour of `"widths" option`_: check that the lenght of an
integer list equals the number of table columns also for the "table"
directive.
@@ -86,6 +86,13 @@
and system-messages and <nav> for the table of contents. Use <div>
for citations.
+ - Only specify table column widths, if the `"widths" option`_ is set
+ and is not "auto" (fixes bug #426).
+ The `table_style`_ setting "colwidths-grid" restores the current default.
+
+ .. _"widths" option: docs/ref/rst/directives.html#column-widths
+ .. _table_style: docs/user/config.html#table-style
+
- Use ARIA roles to enable accessible HTML for abstract, dedication,
the table of contents, footnote, references, footnotes, citations,
and backlinks.
@@ -98,6 +105,10 @@
Use class value "backrefs" instead of "fn-backref" for a span of
back-references.
+ - Do not write class values handled by the HTML writer
+ ("colwidths-auto", "colwidths-given", "colwidths-grid") to the
+ output.
+
- Move space character between section number and heading into
"sectnum" span.
@@ -106,6 +117,7 @@
- Items of a definition list with class argument "details" are
converted to `details disclosure elements`.
+
* docutils/writers/html4css1/__init__.py:
- Overwrite methods in _html_base.HTMLTranslator that use HTM5 tags
Modified: trunk/docutils/RELEASE-NOTES.txt
===================================================================
--- trunk/docutils/RELEASE-NOTES.txt 2021-09-30 10:15:45 UTC (rev 8835)
+++ trunk/docutils/RELEASE-NOTES.txt 2021-10-01 13:39:33 UTC (rev 8836)
@@ -27,17 +27,6 @@
``[role="doc-noteref"]`` instead of ``.footnote-reference``
(see minimal.css for examples).
- - Do not specify relative column widths with the
- deprecated ``<colgroup><col width="...">...``.
-
- The `html5` writer will default to ``:widths: auto`` and use
- ``style="width: ..%"`` if the `"widths" option`__ is used.
- Use the table-style__ setting with value "colwidths-grid" to
- keep the current default.
-
- __ docs/ref/rst/directives.html#table
- __ docs/user/config.html#table-style
-
- Move attribution behind the blockquote to comply with the
`"living standard"`__?
(HTML5__ allows <cite> elements inside a blockquote, cf. Example 16.)
@@ -91,9 +80,9 @@
* Output changes:
Identifiers:
- If the id_prefix_ setting is non-empty, leading number and hyphen
- characters will not be stripped from a `reference name`_ during
- `identifier normalization`_.
+ During `identifier normalization`_, leading number and hyphen
+ characters are no longer stripped from a `reference name`_, if the
+ id_prefix_ setting is non-empty.
Example:
with ``--id-prefix="DU-"``, a section with title "34. May"
@@ -100,18 +89,30 @@
currently gets the identifier key ``DU-may`` and after the
change the identifier key ``DU-34-may``.
- The default value for the auto_id_prefix_ setting changed to "%":
- use the tag name as prefix for auto-generated IDs.
- Set auto_id_prefix_ to "id" if you want unchanged auto-IDs.
+ The default value for the auto_id_prefix_ setting changed to ``%``:
+ "use the tag name as prefix for auto-generated IDs".
+ Set auto_id_prefix_ to ``id`` for unchanged auto-IDs.
HTML5:
- Write footnote brackets and field term colons to HTML, so that they
- are present also without CSS and when copying text.
-
- Use semantic tag <aside> for footnote text and citations,
- topics (except abstract and toc), admonitions, and system messages
+ Use the semantic tag <aside> for footnote text and citations, topics
+ (except abstract and toc), admonitions, and system messages.
Use <nav> for the Table of Contents.
+
+ Make "auto" table column widths the default: Only specify column
+ widths, if the `"widths" option`_ is set and not "auto".
+ The table-style__ setting "colwidths-grid" restores the current default.
+ .. _"widths" option: __ docs/ref/rst/directives.html#table
+ __ docs/user/config.html#table-style
+
+ Items of a definition list with class argument "details" are
+ converted to `details disclosure elements`_. Example::
+
+ ..class:: details
+
+ Summary
+ This additional information should be hidden.
+
Do not add "compound-first", "compound-middle", or "compound-last" to
elements nested in a compound. Use child selector and ":first-child",
":last-child" pseudo classes instead.
@@ -118,14 +119,14 @@
Use class value "backrefs" instead of "fn-backref" for a span of
back-references.
- Items of a definition list with class argument "details" are
- converted to `details disclosure elements`_.
+ Write footnote brackets and field term colons to HTML, so that they
+ are present also without CSS and when copying text.
Move space character between section number and heading into
"sectnum" span.
math-output: html
- Support more commands, fix mapping fo commands to Unicode characters.
+ Support more commands, fix mapping of commands to Unicode characters.
Scale variable sized operators and big delimiters with CSS.
Don't use <tt> element (deprecated in HTML5).
Use STIX fonts if available.
@@ -134,9 +135,9 @@
`legacy_class_functions`_ setting default changed to "False":
admonitions are now environments.
-* ``nodes.Node.traverse()`` returns an iterator instead of a list.
+* New standard Docutils doctree node "meta__".
-* Make meta__ a standard Docutils doctree node.
+* New configuration setting: [latex writers] legacy_column_widths_.
* Removed files:
@@ -148,14 +149,13 @@
* Removed attribute: ``HTMLTranslator.topic_classes``
(check node.parent.classes instead).
-* docutils/utils/math/math2html.py,
- docutils/utils/math/latex2mathml.py
+* Major refactoring and fixes/additions in
+ ``docutils/utils/math/math2html.py`` and
+ ``docutils/utils/math/latex2mathml.py``
+ (mathematical notation in HTML, cf. `LaTeX syntax for mathematics`_).
- - Major refactoring and fixes/additions
- (cf. `LaTeX syntax for mathematics`_).
+* ``nodes.Node.traverse()`` returns an iterator instead of a list.
-* New configuration setting: [latex writers] legacy_column_widths_.
-
* Various bugfixes and improvements (see HISTORY_).
__ docs/ref/doctree.html#meta
Modified: trunk/docutils/docs/ref/rst/directives.txt
===================================================================
--- trunk/docutils/docs/ref/rst/directives.txt 2021-09-30 10:15:45 UTC (rev 8835)
+++ trunk/docutils/docs/ref/rst/directives.txt 2021-10-01 13:39:33 UTC (rev 8836)
@@ -768,6 +768,8 @@
Sets the width of the table to the specified length or percentage
of the line width. If omitted, the renderer determines the width
of the table based on its contents or the column ``widths``.
+
+ .. _column-widths:
``widths`` : "auto", "grid", or a list of integers
A list of relative column widths.
Modified: trunk/docutils/docs/user/config.txt
===================================================================
--- trunk/docutils/docs/user/config.txt 2021-09-30 10:15:45 UTC (rev 8835)
+++ trunk/docutils/docs/user/config.txt 2021-10-01 13:39:33 UTC (rev 8836)
@@ -1221,8 +1221,6 @@
(leave out the ``<colgroup>`` column specification).
Overridden by the "widths" option of the `table directive`_.
-.. TODO: the HTML5 writer also supports
-
colwidths-grid
Backwards compatibility setting. Write column widths
determined from the source to the HTML file.
Modified: trunk/docutils/docutils/writers/_html_base.py
===================================================================
--- trunk/docutils/docutils/writers/_html_base.py 2021-09-30 10:15:45 UTC (rev 8835)
+++ trunk/docutils/docutils/writers/_html_base.py 2021-10-01 13:39:33 UTC (rev 8836)
@@ -123,7 +123,8 @@
{'dest': 'compact_field_lists', 'action': 'store_false'}),
('Added to standard table classes. '
'Defined styles: borderless, booktabs, '
- 'align-left, align-center, align-right, colwidths-auto. ',
+ 'align-left, align-center, align-right, '
+ 'colwidths-auto, colwidths-grid.',
['--table-style'],
{'default': ''}),
('Math output format (one of "MathML", "HTML", "MathJax", '
@@ -426,6 +427,10 @@
if languages:
# attribute name is 'lang' in XHTML 1.0 but 'xml:lang' in 1.1
atts[self.lang_attribute] = languages[0]
+ # filter classes that are processed by the writer:
+ internal = ('colwidths-auto', 'colwidths-given', 'colwidths-grid')
+ if isinstance(node, nodes.table):
+ classes = [cls for cls in classes if cls not in internal]
if classes:
atts['class'] = ' '.join(classes)
assert 'id' not in atts
@@ -671,8 +676,8 @@
nodes.colspec):
return
if 'colwidths-auto' in node.parent.parent['classes'] or (
- 'colwidths-auto' in self.settings.table_style and
- ('colwidths-given' not in node.parent.parent['classes'])):
+ 'colwidths-grid' not in self.settings.table_style
+ and 'colwidths-given' not in node.parent.parent['classes']):
return
total_width = sum(node['colwidth'] for node in self.colspecs)
self.body.append(self.starttag(node, 'colgroup'))
Modified: trunk/docutils/docutils/writers/latex2e/__init__.py
===================================================================
--- trunk/docutils/docutils/writers/latex2e/__init__.py 2021-09-30 10:15:45 UTC (rev 8835)
+++ trunk/docutils/docutils/writers/latex2e/__init__.py 2021-10-01 13:39:33 UTC (rev 8836)
@@ -52,10 +52,9 @@
r'\usepackage{mathptmx} % Times',
r'\usepackage[scaled=.90]{helvet}',
r'\usepackage{courier}'])
- table_style_values = (# TODO: align-left, align-center, align-right,
+ table_style_values = [# TODO: align-left, align-center, align-right, ??
'booktabs', 'borderless', 'colwidths-auto',
- 'colwidths-given', # set by parser if "widths" option is specified
- 'nolines', 'standard')
+ 'nolines', 'standard']
settings_spec = (
'LaTeX-Specific Options',
@@ -1606,7 +1605,8 @@
if language:
self.babel.otherlanguages[language] = True
self.out.append('\\begin{selectlanguage}{%s}\n' % language)
- elif isinstance(node, nodes.table) and cls in Writer.table_style_values:
+ elif (isinstance(node, nodes.table)
+ and cls in Writer.table_style_values + ['colwidths-given']):
pass
else:
if not self.fallback_stylesheet:
@@ -1620,7 +1620,8 @@
language = self.babel.language_name(cls[9:])
if language:
self.out.append('\\end{selectlanguage}\n')
- elif isinstance(node, nodes.table) and cls in Writer.table_style_values:
+ elif (isinstance(node, nodes.table)
+ and cls in Writer.table_style_values + ['colwidths-given']):
pass
else:
if not self.fallback_stylesheet:
Modified: trunk/docutils/test/functional/expected/footnotes_html5.html
===================================================================
--- trunk/docutils/test/functional/expected/footnotes_html5.html 2021-09-30 10:15:45 UTC (rev 8835)
+++ trunk/docutils/test/functional/expected/footnotes_html5.html 2021-10-01 13:39:33 UTC (rev 8836)
@@ -108,10 +108,6 @@
<aside class="footnote superscript" id="footnote-10" role="note">
<span class="label"><span class="fn-bracket">[</span><a role="doc-backlink" href="#footnote-reference-13">10</a><span class="fn-bracket">]</span></span>
<table>
-<colgroup>
-<col style="width: 36%" />
-<col style="width: 64%" />
-</colgroup>
<tbody>
<tr><td><p>a</p></td>
<td><p>table</p></td>
Modified: trunk/docutils/test/functional/expected/latex_memoir.tex
===================================================================
--- trunk/docutils/test/functional/expected/latex_memoir.tex 2021-09-30 10:15:45 UTC (rev 8835)
+++ trunk/docutils/test/functional/expected/latex_memoir.tex 2021-10-01 13:39:33 UTC (rev 8836)
@@ -1840,7 +1840,7 @@
\begin{description}
\item[{Math-Accents:}] \leavevmode
-\setlength{\DUtablewidth}{\linewidth}%
+\setlength{\DUtablewidth}{1.000\linewidth}%
\begin{longtable*}{p{0.315\DUtablewidth}p{0.315\DUtablewidth}p{0.315\DUtablewidth}}
$\acute{a}$ \texttt{\textbackslash{}acute\{a\}}
Modified: trunk/docutils/test/functional/expected/math_output_html.html
===================================================================
--- trunk/docutils/test/functional/expected/math_output_html.html 2021-09-30 10:15:45 UTC (rev 8835)
+++ trunk/docutils/test/functional/expected/math_output_html.html 2021-10-01 13:39:33 UTC (rev 8836)
@@ -74,7 +74,7 @@
physical system changes in time.</p>
<dl class="docutils">
<dt>Math-Accents:</dt>
-<dd><table border="1" class="colwidths-given borderless first last docutils">
+<dd><table border="1" class="borderless first last docutils" style="width: 100%">
<colgroup>
<col width="33%" />
<col width="33%" />
Modified: trunk/docutils/test/functional/expected/math_output_latex.html
===================================================================
--- trunk/docutils/test/functional/expected/math_output_latex.html 2021-09-30 10:15:45 UTC (rev 8835)
+++ trunk/docutils/test/functional/expected/math_output_latex.html 2021-10-01 13:39:33 UTC (rev 8836)
@@ -47,7 +47,7 @@
physical system changes in time.</p>
<dl class="docutils">
<dt>Math-Accents:</dt>
-<dd><table border="1" class="colwidths-given borderless first last docutils">
+<dd><table border="1" class="borderless first last docutils" style="width: 100%">
<colgroup>
<col width="33%" />
<col width="33%" />
Modified: trunk/docutils/test/functional/expected/math_output_mathjax.html
===================================================================
--- trunk/docutils/test/functional/expected/math_output_mathjax.html 2021-09-30 10:15:45 UTC (rev 8835)
+++ trunk/docutils/test/functional/expected/math_output_mathjax.html 2021-10-01 13:39:33 UTC (rev 8836)
@@ -60,7 +60,7 @@
physical system changes in time.</p>
<dl class="docutils">
<dt>Math-Accents:</dt>
-<dd><table border="1" class="colwidths-given borderless first last docutils">
+<dd><table border="1" class="borderless first last docutils" style="width: 100%">
<colgroup>
<col width="33%" />
<col width="33%" />
Modified: trunk/docutils/test/functional/expected/math_output_mathml.html
===================================================================
--- trunk/docutils/test/functional/expected/math_output_mathml.html 2021-09-30 10:15:45 UTC (rev 8835)
+++ trunk/docutils/test/functional/expected/math_output_mathml.html 2021-10-01 13:39:33 UTC (rev 8836)
@@ -209,12 +209,7 @@
physical system changes in time.</p>
<dl>
<dt>Math-Accents:</dt>
-<dd><table class="colwidths-given borderless">
-<colgroup>
-<col style="width: 33%" />
-<col style="width: 33%" />
-<col style="width: 33%" />
-</colgroup>
+<dd><table class="borderless" style="width: 100%;">
<tbody>
<tr><td><p><math xmlns="http://www.w3.org/1998/Math/MathML">
<mover>
Modified: trunk/docutils/test/functional/expected/standalone_rst_html4css1.html
===================================================================
--- trunk/docutils/test/functional/expected/standalone_rst_html4css1.html 2021-09-30 10:15:45 UTC (rev 8835)
+++ trunk/docutils/test/functional/expected/standalone_rst_html4css1.html 2021-10-01 13:39:33 UTC (rev 8836)
@@ -733,7 +733,7 @@
<p>With the "widths" argument "auto" (or "class" value "colwidths-auto"),
column widths are determined by the backend (if supported by the
writer/backend).</p>
-<span id="target1"></span><table border="1" class="colwidths-auto docutils" id="target2">
+<span id="target1"></span><table border="1" class="docutils" id="target2">
<thead valign="bottom">
<tr><th class="head">A</th>
<th class="head">B</th>
@@ -1193,7 +1193,7 @@
<div class="section" id="list-tables">
<h2><a class="toc-backref" href="#toc-entry-41">2.22 List Tables</a></h2>
<p>Here's a list table exercising all features:</p>
-<table border="1" class="colwidths-given test docutils" style="width: 95%">
+<table border="1" class="test docutils" style="width: 95%">
<caption>list table with integral header</caption>
<colgroup>
<col width="26%" />
@@ -1222,7 +1222,7 @@
</tr>
</tbody>
</table>
-<table border="1" class="colwidths-auto docutils align-center">
+<table border="1" class="docutils align-center">
<caption>center aligned list table</caption>
<tbody valign="top">
<tr><td>Albatross</td>
Modified: trunk/docutils/test/functional/expected/standalone_rst_html5.html
===================================================================
--- trunk/docutils/test/functional/expected/standalone_rst_html5.html 2021-09-30 10:15:45 UTC (rev 8835)
+++ trunk/docutils/test/functional/expected/standalone_rst_html5.html 2021-10-01 13:39:33 UTC (rev 8836)
@@ -608,10 +608,6 @@
<p>Plaintext markup syntax and parser system.</p>
<div class="legend">
<table>
-<colgroup>
-<col style="width: 20%" />
-<col style="width: 80%" />
-</colgroup>
<tbody>
<tr><td><p>re</p></td>
<td><p>Revised, revisited, based on 're' module.</p></td>
@@ -676,10 +672,6 @@
directive:</p>
<table class="align-left">
<caption>left-aligned table</caption>
-<colgroup>
-<col style="width: 50%" />
-<col style="width: 50%" />
-</colgroup>
<thead>
<tr><th class="head"><p>A</p></th>
<th class="head"><p>not A</p></th>
@@ -696,10 +688,6 @@
</table>
<table class="align-center">
<caption>center-aligned table</caption>
-<colgroup>
-<col style="width: 50%" />
-<col style="width: 50%" />
-</colgroup>
<thead>
<tr><th class="head"><p>A</p></th>
<th class="head"><p>not A</p></th>
@@ -716,10 +704,6 @@
</table>
<table class="align-right">
<caption>right-aligned table</caption>
-<colgroup>
-<col style="width: 50%" />
-<col style="width: 50%" />
-</colgroup>
<thead>
<tr><th class="head"><p>A</p></th>
<th class="head"><p>not A</p></th>
@@ -737,7 +721,7 @@
<p>With the "widths" argument "auto" (or "class" value "colwidths-auto"),
column widths are determined by the backend (if supported by the
writer/backend).</p>
-<span id="target1"></span><table class="colwidths-auto" id="target2">
+<span id="target1"></span><table id="target2">
<thead>
<tr><th class="head"><p>A</p></th>
<th class="head"><p>B</p></th>
@@ -942,11 +926,6 @@
<p>Compound 7, tests the inclusion of various block-level
elements in one logical paragraph. First a table,</p>
<table>
-<colgroup>
-<col style="width: 33%" />
-<col style="width: 33%" />
-<col style="width: 33%" />
-</colgroup>
<tbody>
<tr><td><p>Left cell, first
paragraph.</p>
@@ -1084,11 +1063,6 @@
<h3><a class="toc-backref" href="#toc-entry-38" role="doc-backlink"><span class="sectnum">2.19 </span>Colspanning tables</a></h3>
<p>This table has a cell spanning two columns:</p>
<table>
-<colgroup>
-<col style="width: 31%" />
-<col style="width: 31%" />
-<col style="width: 38%" />
-</colgroup>
<thead>
<tr><th class="head" colspan="2"><p>Inputs</p></th>
<th class="head"><p>Output</p></th>
@@ -1122,11 +1096,6 @@
<h3><a class="toc-backref" href="#toc-entry-39" role="doc-backlink"><span class="sectnum">2.20 </span>Rowspanning tables</a></h3>
<p>Here's a table with cells spanning several rows:</p>
<table>
-<colgroup>
-<col style="width: 44%" />
-<col style="width: 22%" />
-<col style="width: 33%" />
-</colgroup>
<thead>
<tr><th class="head"><p>Header row, column 1
(header rows optional)</p></th>
@@ -1155,12 +1124,6 @@
<h3><a class="toc-backref" href="#toc-entry-40" role="doc-backlink"><span class="sectnum">2.21 </span>Complex tables</a></h3>
<p>Here's a complex table, which should test all features.</p>
<table>
-<colgroup>
-<col style="width: 43%" />
-<col style="width: 21%" />
-<col style="width: 18%" />
-<col style="width: 18%" />
-</colgroup>
<thead>
<tr><th class="head"><p>Header row, column 1
(header rows optional)</p></th>
@@ -1203,7 +1166,7 @@
<section id="list-tables">
<h3><a class="toc-backref" href="#toc-entry-41" role="doc-backlink"><span class="sectnum">2.22 </span>List Tables</a></h3>
<p>Here's a list table exercising all features:</p>
-<table class="colwidths-given test" style="width: 95%;">
+<table class="test" style="width: 95%;">
<caption>list table with integral header</caption>
<colgroup>
<col style="width: 26%" />
@@ -1232,7 +1195,7 @@
</tr>
</tbody>
</table>
-<table class="align-center colwidths-auto">
+<table class="align-center">
<caption>center aligned list table</caption>
<tbody>
<tr><td><p>Albatross</p></td>
@@ -1475,11 +1438,6 @@
<li><p>Numbered tables can be achieved with the "numbered" class option:</p>
<table class="numbered">
<caption>truth values</caption>
-<colgroup>
-<col style="width: 29%" />
-<col style="width: 29%" />
-<col style="width: 42%" />
-</colgroup>
<thead>
<tr><th class="head"><p>A</p></th>
<th class="head"><p>B</p></th>
@@ -1514,7 +1472,7 @@
</ul>
<p>"Booktabs" style table, numbered, centre-aligned, with auto-sized columns:</p>
<blockquote>
-<table class="align-center booktabs numbered colwidths-auto">
+<table class="align-center booktabs numbered">
<caption>I/O values</caption>
<thead>
<tr><th class="head" colspan="2"><p>Input</p></th>
Modified: trunk/docutils/test/functional/expected/standalone_rst_latex.tex
===================================================================
--- trunk/docutils/test/functional/expected/standalone_rst_latex.tex 2021-09-30 10:15:45 UTC (rev 8835)
+++ trunk/docutils/test/functional/expected/standalone_rst_latex.tex 2021-10-01 13:39:33 UTC (rev 8836)
@@ -1862,7 +1862,7 @@
\begin{description}
\item[{Math-Accents:}] \leavevmode
-\setlength{\DUtablewidth}{\linewidth}%
+\setlength{\DUtablewidth}{1.000\linewidth}%
\begin{longtable*}{p{0.315\DUtablewidth}p{0.315\DUtablewidth}p{0.315\DUtablewidth}}
$\acute{a}$ \texttt{\textbackslash{}acute\{a\}}
Modified: trunk/docutils/test/functional/expected/standalone_rst_xetex.tex
===================================================================
--- trunk/docutils/test/functional/expected/standalone_rst_xetex.tex 2021-09-30 10:15:45 UTC (rev 8835)
+++ trunk/docutils/test/functional/expected/standalone_rst_xetex.tex 2021-10-01 13:39:33 UTC (rev 8836)
@@ -1900,7 +1900,7 @@
\begin{description}
\item[{Math-Accents:}] \leavevmode
-\setlength{\DUtablewidth}{\linewidth}%
+\setlength{\DUtablewidth}{1.000\linewidth}%
\begin{longtable*}{p{0.315\DUtablewidth}p{0.315\DUtablewidth}p{0.315\DUtablewidth}}
$\acute{a}$ \texttt{\textbackslash{}acute\{a\}}
Modified: trunk/docutils/test/functional/input/data/math.txt
===================================================================
--- trunk/docutils/test/functional/input/data/math.txt 2021-09-30 10:15:45 UTC (rev 8835)
+++ trunk/docutils/test/functional/input/data/math.txt 2021-10-01 13:39:33 UTC (rev 8836)
@@ -49,7 +49,7 @@
Math-Accents:
.. list-table::
:class: borderless
- :widths: 26 26 26
+ :width: 100%
* - :math:`\acute{a}` ``\acute{a}``
- :math:`\dot{t}` ``\dot{t}``
Modified: trunk/docutils/test/test_writers/test_html5_polyglot_parts.py
===================================================================
--- trunk/docutils/test/test_writers/test_html5_polyglot_parts.py 2021-09-30 10:15:45 UTC (rev 8835)
+++ trunk/docutils/test/test_writers/test_html5_polyglot_parts.py 2021-10-01 13:39:33 UTC (rev 8836)
@@ -350,10 +350,6 @@
""",
"""\
{'fragment': '''<table class="align-right">
-<colgroup>
-<col style="width: 50%%" />
-<col style="width: 50%%" />
-</colgroup>
<tbody>
<tr><td><p>1</p></td>
<td><p>2</p></td>
@@ -365,10 +361,6 @@
</table>\\n''',
'html_body': '''<main>
<table class="align-right">
-<colgroup>
-<col style="width: 50%%" />
-<col style="width: 50%%" />
-</colgroup>
<tbody>
<tr><td><p>1</p></td>
<td><p>2</p></td>
This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site.
|
|
From: <mi...@us...> - 2021-10-04 08:36:16
|
Revision: 8840
http://sourceforge.net/p/docutils/code/8840
Author: milde
Date: 2021-10-04 08:36:11 +0000 (Mon, 04 Oct 2021)
Log Message:
-----------
Fix by Mickey Endito for source location (line number) of attributions.
New unittest case for the internal "source" and "line" attributes.
Modified Paths:
--------------
trunk/docutils/HISTORY.txt
trunk/docutils/docutils/parsers/rst/states.py
Added Paths:
-----------
trunk/docutils/test/test_parsers/test_rst/test_source_line.py
Modified: trunk/docutils/HISTORY.txt
===================================================================
--- trunk/docutils/HISTORY.txt 2021-10-03 07:43:01 UTC (rev 8839)
+++ trunk/docutils/HISTORY.txt 2021-10-04 08:36:11 UTC (rev 8840)
@@ -63,6 +63,11 @@
.. _LaTeX syntax for mathematics: docs/ref/rst/mathematics.html
+* docutils/parsers/rst/states.py:
+
+ - Fix source location (line number) for attribution elements.
+ Patch by Mickey Endito.
+
* docutils/transforms/references.py
- Skip system_messages when propagating targets. Fixes bug #425.
Modified: trunk/docutils/docutils/parsers/rst/states.py
===================================================================
--- trunk/docutils/docutils/parsers/rst/states.py 2021-10-03 07:43:01 UTC (rev 8839)
+++ trunk/docutils/docutils/parsers/rst/states.py 2021-10-04 08:36:11 UTC (rev 8840)
@@ -1181,7 +1181,7 @@
elements.append(blockquote)
if attribution_lines:
attribution, messages = self.parse_attribution(
- attribution_lines, attribution_offset)
+ attribution_lines, line_offset+attribution_offset)
blockquote += attribution
elements += messages
line_offset = new_line_offset
@@ -1251,7 +1251,7 @@
def parse_attribution(self, indented, line_offset):
text = '\n'.join(indented).rstrip()
- lineno = self.state_machine.abs_line_number() + line_offset
+ lineno = 1 + line_offset # line_offset is zero-based
textnodes, messages = self.inline_text(text, lineno)
node = nodes.attribution(text, '', *textnodes)
node.source, node.line = self.state_machine.get_source_and_line(lineno)
Added: trunk/docutils/test/test_parsers/test_rst/test_source_line.py
===================================================================
--- trunk/docutils/test/test_parsers/test_rst/test_source_line.py (rev 0)
+++ trunk/docutils/test/test_parsers/test_rst/test_source_line.py 2021-10-04 08:36:11 UTC (rev 8840)
@@ -0,0 +1,187 @@
+#! /usr/bin/env python
+# coding: utf-8
+# $Id$
+# Author: Günter Milde
+# Maintainer: doc...@li...
+# :Copyright: 2021 Günter Milde,
+# :License: Released under the terms of the `2-Clause BSD license`_, in short:
+#
+# Copying and distribution of this file, with or without modification,
+# are permitted in any medium without royalty provided the copyright
+# notice and this notice are preserved.
+# This file is offered as-is, without any warranty.
+#
+# .. _2-Clause BSD license: https://opensource.org/licenses/BSD-2-Clause
+
+"""Test internal source and line attributes (for correct error reporting).
+
+This test is to ensure source and line numbers are correct.
+It does not fix the API regarding which nodes have
+source and line attributes -- additional nodes may grow them,
+this is regarded a compatible feature additon.
+"""
+
+# Requires the `universal.ExposeInternals` transform (tested in
+# ``test_transforms/test_expose_internals.py``)
+# to make internal attributes visible.
+
+from __future__ import absolute_import
+import os
+
+if __name__ == '__main__':
+ import __init__
+from test_transforms import DocutilsTestSupport # before importing docutils!
+from docutils.transforms.universal import ExposeInternals
+from docutils.parsers.rst import Parser
+
+
+def suite():
+ parser = Parser()
+ s = DocutilsTestSupport.TransformTestSuite(
+ parser, suite_settings={'expose_internals': ['line', 'source']})
+ s.generateTests(totest)
+ return s
+
+mydir = 'test_parsers/test_rst/'
+include14 = os.path.join(mydir, 'includes/include14.txt')
+
+totest = {}
+
+totest['transitions'] = ((ExposeInternals,), [
+["""\
+Paragraph starting in line 1.
+With *inline* element in line 2.
+
+ Block quote in line 4
+
+ -- attribution
+ in line 6
+
+* bullet list in line 9
+* second item in line 10
+
+1. enumerated list in line 12
+""",
+"""\
+<document source="test data">
+ <paragraph internal:line="1" internal:source="test data">
+ Paragraph starting in line 1.
+ With \n\
+ <emphasis>
+ inline
+ element in line 2.
+ <block_quote internal:source="test data">
+ <paragraph internal:line="4" internal:source="test data">
+ Block quote in line 4
+ <attribution internal:line="6" internal:source="test data">
+ attribution
+ in line 6
+ <bullet_list bullet="*" internal:line="9" internal:source="test data">
+ <list_item internal:source="test data">
+ <paragraph internal:line="9" internal:source="test data">
+ bullet list in line 9
+ <list_item internal:source="test data">
+ <paragraph internal:line="10" internal:source="test data">
+ second item in line 10
+ <enumerated_list enumtype="arabic" internal:line="12" internal:source="test data" prefix="" suffix=".">
+ <list_item internal:source="test data">
+ <paragraph internal:line="12" internal:source="test data">
+ enumerated list in line 12
+"""],
+["""\
+Paragraph
+
+ Block quote in line 3
+
+ -- attribution in line 5
+""",
+"""\
+<document source="test data">
+ <paragraph internal:line="1" internal:source="test data">
+ Paragraph
+ <block_quote internal:source="test data">
+ <paragraph internal:line="3" internal:source="test data">
+ Block quote in line 3
+ <attribution internal:line="5" internal:source="test data">
+ attribution in line 5
+"""],
+["""\
+Paragraph
+
+ Block quote in line 3
+
+ nested block quote
+ in line 5
+
+ double nested quote in line 8
+
+ -- double-nested attribution in line 10
+
+ line 12
+
+ -- nested attribution in line 14
+
+ -- attribution in line 16
+""",
+"""\
+<document source="test data">
+ <paragraph internal:line="1" internal:source="test data">
+ Paragraph
+ <block_quote internal:source="test data">
+ <paragraph internal:line="3" internal:source="test data">
+ Block quote in line 3
+ <block_quote>
+ <paragraph internal:line="5" internal:source="test data">
+ nested block quote
+ in line 5
+ <block_quote>
+ <paragraph internal:line="8" internal:source="test data">
+ double nested quote in line 8
+ <attribution internal:line="10" internal:source="test data">
+ double-nested attribution in line 10
+ <paragraph internal:line="12" internal:source="test data">
+ line 12
+ <attribution internal:line="14" internal:source="test data">
+ nested attribution in line 14
+ <attribution internal:line="16" internal:source="test data">
+ attribution in line 16
+"""],
+["""\
+Paragraph
+
+.. include:: %s
+""" % include14,
+"""\
+<document source="test data">
+ <paragraph internal:line="1" internal:source="test data">
+ Paragraph
+ <paragraph internal:line="1" internal:source="test_parsers/test_rst/includes/include14.txt">
+ Paragraph starting in line 1.
+ With \n\
+ <emphasis>
+ inline
+ element in line 2.
+ <block_quote internal:source="test_parsers/test_rst/includes/include14.txt">
+ <paragraph internal:line="4" internal:source="test_parsers/test_rst/includes/include14.txt">
+ Block quote in line 4
+ <attribution internal:line="6" internal:source="test_parsers/test_rst/includes/include14.txt">
+ attribution
+ in line 6
+ <bullet_list bullet="*" internal:line="9" internal:source="test_parsers/test_rst/includes/include14.txt">
+ <list_item internal:source="test_parsers/test_rst/includes/include14.txt">
+ <paragraph internal:line="9" internal:source="test_parsers/test_rst/includes/include14.txt">
+ bullet list in line 9
+ <list_item internal:source="test_parsers/test_rst/includes/include14.txt">
+ <paragraph internal:line="10" internal:source="test_parsers/test_rst/includes/include14.txt">
+ second item in line 10
+ <enumerated_list enumtype="arabic" internal:line="12" internal:source="test_parsers/test_rst/includes/include14.txt" prefix="" suffix=".">
+ <list_item internal:source="internal padding after test_parsers/test_rst/includes/include14.txt">
+ <paragraph internal:line="12" internal:source="test_parsers/test_rst/includes/include14.txt">
+ enumerated list in line 12
+"""],
+])
+
+
+if __name__ == '__main__':
+ import unittest
+ unittest.main(defaultTest='suite')
Property changes on: trunk/docutils/test/test_parsers/test_rst/test_source_line.py
___________________________________________________________________
Added: svn:eol-style
## -0,0 +1 ##
+native
\ No newline at end of property
Added: svn:keywords
## -0,0 +1 ##
+Author Date Id Revision
\ No newline at end of property
This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site.
|
|
From: <mi...@us...> - 2021-10-04 13:10:14
|
Revision: 8842
http://sourceforge.net/p/docutils/code/8842
Author: milde
Date: 2021-10-04 13:10:11 +0000 (Mon, 04 Oct 2021)
Log Message:
-----------
Add line, source, and rawsource attributes to blockquote nodes.
Fix docstring for states.Body.split_attribution().
Patch by Mickey Endito.
Modified Paths:
--------------
trunk/docutils/HISTORY.txt
trunk/docutils/docutils/parsers/rst/states.py
trunk/docutils/test/test_parsers/test_rst/test_source_line.py
Modified: trunk/docutils/HISTORY.txt
===================================================================
--- trunk/docutils/HISTORY.txt 2021-10-04 13:10:01 UTC (rev 8841)
+++ trunk/docutils/HISTORY.txt 2021-10-04 13:10:11 UTC (rev 8842)
@@ -67,6 +67,8 @@
- Fix source location (line number) for attribution elements.
Patch by Mickey Endito.
+ - Add line, source, and rawsource internal attributes for blockquote
+ elements. Patch by Mickey Endito.
* docutils/transforms/references.py
Modified: trunk/docutils/docutils/parsers/rst/states.py
===================================================================
--- trunk/docutils/docutils/parsers/rst/states.py 2021-10-04 13:10:01 UTC (rev 8841)
+++ trunk/docutils/docutils/parsers/rst/states.py 2021-10-04 13:10:11 UTC (rev 8842)
@@ -626,6 +626,9 @@
check it for validity. If not found or invalid, generate a warning
and ignore the start-string. Implicit inline markup (e.g. standalone
URIs) is found last.
+
+ :text: source string
+ :lineno: absolute line number (cf. statemachine.get_source_and_line())
"""
self.reporter = memo.reporter
self.document = memo.document
@@ -1171,12 +1174,14 @@
def block_quote(self, indented, line_offset):
elements = []
while indented:
+ blockquote = nodes.block_quote(rawsource='\n'.join(indented))
+ (blockquote.source, blockquote.line) = \
+ self.state_machine.get_source_and_line(line_offset+1)
(blockquote_lines,
attribution_lines,
attribution_offset,
indented,
new_line_offset) = self.split_attribution(indented, line_offset)
- blockquote = nodes.block_quote()
self.nested_parse(blockquote_lines, line_offset, blockquote)
elements.append(blockquote)
if attribution_lines:
@@ -1203,8 +1208,8 @@
* Every line after that must have consistent indentation.
* Attributions must be preceded by block quote content.
- Return a tuple of: (block quote content lines, content offset,
- attribution lines, attribution offset, remaining indented lines).
+ Return a tuple of: (block quote content lines, attribution lines,
+ attribution offset, remaining indented lines, remaining lines offset).
"""
blank = None
nonblank_seen = False
Modified: trunk/docutils/test/test_parsers/test_rst/test_source_line.py
===================================================================
--- trunk/docutils/test/test_parsers/test_rst/test_source_line.py 2021-10-04 13:10:01 UTC (rev 8841)
+++ trunk/docutils/test/test_parsers/test_rst/test_source_line.py 2021-10-04 13:10:11 UTC (rev 8842)
@@ -16,13 +16,12 @@
"""Test internal source and line attributes (for correct error reporting).
This test is to ensure source and line numbers are correct.
-It does not fix the API regarding which nodes have
-source and line attributes -- additional nodes may grow them,
-this is regarded a compatible feature additon.
+It does not fix behaviour regarding which nodes have source/line attributes,
+adding them to more nodes is regarded a compatible feature extension.
"""
# Requires the `universal.ExposeInternals` transform (tested in
-# ``test_transforms/test_expose_internals.py``)
+# ``test_transforms/test_expose_internals.py``)
# to make internal attributes visible.
from __future__ import absolute_import
@@ -53,10 +52,10 @@
With *inline* element in line 2.
Block quote in line 4
-
- -- attribution
+
+ -- attribution
in line 6
-
+
* bullet list in line 9
* second item in line 10
@@ -70,7 +69,7 @@
<emphasis>
inline
element in line 2.
- <block_quote internal:source="test data">
+ <block_quote internal:line="4" internal:source="test data">
<paragraph internal:line="4" internal:source="test data">
Block quote in line 4
<attribution internal:line="6" internal:source="test data">
@@ -92,7 +91,7 @@
Paragraph
Block quote in line 3
-
+
-- attribution in line 5
""",
"""\
@@ -99,7 +98,7 @@
<document source="test data">
<paragraph internal:line="1" internal:source="test data">
Paragraph
- <block_quote internal:source="test data">
+ <block_quote internal:line="3" internal:source="test data">
<paragraph internal:line="3" internal:source="test data">
Block quote in line 3
<attribution internal:line="5" internal:source="test data">
@@ -109,18 +108,18 @@
Paragraph
Block quote in line 3
-
- nested block quote
+
+ nested block quote
in line 5
-
+
double nested quote in line 8
-
+
-- double-nested attribution in line 10
-
+
line 12
-- nested attribution in line 14
-
+
-- attribution in line 16
""",
"""\
@@ -127,14 +126,14 @@
<document source="test data">
<paragraph internal:line="1" internal:source="test data">
Paragraph
- <block_quote internal:source="test data">
+ <block_quote internal:line="3" internal:source="test data">
<paragraph internal:line="3" internal:source="test data">
Block quote in line 3
- <block_quote>
+ <block_quote internal:line="5" internal:source="test data">
<paragraph internal:line="5" internal:source="test data">
nested block quote
in line 5
- <block_quote>
+ <block_quote internal:line="8" internal:source="test data">
<paragraph internal:line="8" internal:source="test data">
double nested quote in line 8
<attribution internal:line="10" internal:source="test data">
@@ -161,7 +160,7 @@
<emphasis>
inline
element in line 2.
- <block_quote internal:source="test_parsers/test_rst/includes/include14.txt">
+ <block_quote internal:line="4" internal:source="test_parsers/test_rst/includes/include14.txt">
<paragraph internal:line="4" internal:source="test_parsers/test_rst/includes/include14.txt">
Block quote in line 4
<attribution internal:line="6" internal:source="test_parsers/test_rst/includes/include14.txt">
@@ -179,6 +178,36 @@
<paragraph internal:line="12" internal:source="test_parsers/test_rst/includes/include14.txt">
enumerated list in line 12
"""],
+["""\
+Paragraph
+
+ Block quote in line 3
+
+ -- attribution in line 5
+
+ Second block quote in line 7
+
+ -- attribution in line 9
+
+Final paragraph in line 11
+""",
+"""\
+<document source="test data">
+ <paragraph internal:line="1" internal:source="test data">
+ Paragraph
+ <block_quote internal:line="3" internal:source="test data">
+ <paragraph internal:line="3" internal:source="test data">
+ Block quote in line 3
+ <attribution internal:line="5" internal:source="test data">
+ attribution in line 5
+ <block_quote internal:line="7" internal:source="test data">
+ <paragraph internal:line="7" internal:source="test data">
+ Second block quote in line 7
+ <attribution internal:line="9" internal:source="test data">
+ attribution in line 9
+ <paragraph internal:line="11" internal:source="test data">
+ Final paragraph in line 11
+"""],
])
This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site.
|
|
From: <gr...@us...> - 2021-10-05 19:58:06
|
Revision: 8845
http://sourceforge.net/p/docutils/code/8845
Author: grubert
Date: 2021-10-05 19:58:02 +0000 (Tue, 05 Oct 2021)
Log Message:
-----------
Release 0.18b1
Modified Paths:
--------------
trunk/docutils/HISTORY.txt
trunk/docutils/README.txt
trunk/docutils/RELEASE-NOTES.txt
trunk/docutils/docutils/__init__.py
trunk/docutils/setup.py
trunk/docutils/test/functional/expected/compact_lists.html
trunk/docutils/test/functional/expected/dangerous.html
trunk/docutils/test/functional/expected/embed_images_html5.html
trunk/docutils/test/functional/expected/field_name_limit.html
trunk/docutils/test/functional/expected/footnotes_html5.html
trunk/docutils/test/functional/expected/math_output_html.html
trunk/docutils/test/functional/expected/math_output_latex.html
trunk/docutils/test/functional/expected/math_output_mathjax.html
trunk/docutils/test/functional/expected/math_output_mathml.html
trunk/docutils/test/functional/expected/misc_rst_html4css1.html
trunk/docutils/test/functional/expected/misc_rst_html5.html
trunk/docutils/test/functional/expected/pep_html.html
trunk/docutils/test/functional/expected/standalone_rst_docutils_xml.xml
trunk/docutils/test/functional/expected/standalone_rst_html4css1.html
trunk/docutils/test/functional/expected/standalone_rst_html5.html
trunk/docutils/test/functional/expected/standalone_rst_s5_html_1.html
trunk/docutils/test/functional/expected/standalone_rst_s5_html_2.html
Modified: trunk/docutils/HISTORY.txt
===================================================================
--- trunk/docutils/HISTORY.txt 2021-10-05 19:45:59 UTC (rev 8844)
+++ trunk/docutils/HISTORY.txt 2021-10-05 19:58:02 UTC (rev 8845)
@@ -11,8 +11,8 @@
.. contents::
-Changes Since 0.17.1
-====================
+Release 0.18b1 (2021-10-05)
+===========================
* docutils/frontend.py
@@ -44,7 +44,7 @@
* docutils/parsers/rst/directives/tables.py:
- - Unify behaviour of `"widths" option`_: check that the lenght of an
+ - Unify behaviour of `"widths" option`_: check that the length of an
integer list equals the number of table columns also for the "table"
directive.
Modified: trunk/docutils/README.txt
===================================================================
--- trunk/docutils/README.txt 2021-10-05 19:45:59 UTC (rev 8844)
+++ trunk/docutils/README.txt 2021-10-05 19:58:02 UTC (rev 8845)
@@ -1,6 +1,6 @@
-===============================
- README: Docutils 0.18b.dev
-===============================
+=========================
+ README: Docutils 0.18b1
+=========================
:Author: David Goodger
:Contact: go...@py...
Modified: trunk/docutils/RELEASE-NOTES.txt
===================================================================
--- trunk/docutils/RELEASE-NOTES.txt 2021-10-05 19:45:59 UTC (rev 8844)
+++ trunk/docutils/RELEASE-NOTES.txt 2021-10-05 19:58:02 UTC (rev 8845)
@@ -76,8 +76,8 @@
.. _use_latex_citations: docs/user/config.html#use-latex-citations
-Release 0.18.dev
-================
+Release 0.18b1 (2021-10-05)
+===========================
.. Note::
Modified: trunk/docutils/docutils/__init__.py
===================================================================
--- trunk/docutils/docutils/__init__.py 2021-10-05 19:45:59 UTC (rev 8844)
+++ trunk/docutils/docutils/__init__.py 2021-10-05 19:58:02 UTC (rev 8845)
@@ -56,7 +56,7 @@
__docformat__ = 'reStructuredText'
-__version__ = '0.18b.dev'
+__version__ = '0.18b1'
"""Docutils version identifier (complies with PEP 440)::
major.minor[.micro][releaselevel[serial]][.dev]
@@ -115,8 +115,8 @@
micro=0,
releaselevel='beta', # one of 'alpha', 'beta', 'candidate', 'final'
# pre-release serial number (0 for final releases and active development):
- serial=0,
- release=False # True for official releases and pre-releases
+ serial=1,
+ release=True # True for official releases and pre-releases
)
"""Comprehensive version information tuple. See 'Version Numbering' in
docs/dev/policies.txt."""
Modified: trunk/docutils/setup.py
===================================================================
--- trunk/docutils/setup.py 2021-10-05 19:45:59 UTC (rev 8844)
+++ trunk/docutils/setup.py 2021-10-05 19:58:02 UTC (rev 8845)
@@ -31,7 +31,7 @@
input Docutils supports reStructuredText, an easy-to-read,
what-you-see-is-what-you-get plaintext markup syntax.""", # wrap at col 60
'url': 'http://docutils.sourceforge.net/',
- 'version': '0.18b.dev',
+ 'version': '0.18b1',
'author': 'David Goodger',
'author_email': 'go...@py...',
'maintainer': 'docutils-develop list',
Modified: trunk/docutils/test/functional/expected/compact_lists.html
===================================================================
--- trunk/docutils/test/functional/expected/compact_lists.html 2021-10-05 19:45:59 UTC (rev 8844)
+++ trunk/docutils/test/functional/expected/compact_lists.html 2021-10-05 19:58:02 UTC (rev 8845)
@@ -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.18b.dev: http://docutils.sourceforge.net/" />
+<meta name="generator" content="Docutils 0.18b1: http://docutils.sourceforge.net/" />
<title>compact_lists.txt</title>
<link rel="stylesheet" href="../input/data/html4css1.css" type="text/css" />
</head>
Modified: trunk/docutils/test/functional/expected/dangerous.html
===================================================================
--- trunk/docutils/test/functional/expected/dangerous.html 2021-10-05 19:45:59 UTC (rev 8844)
+++ trunk/docutils/test/functional/expected/dangerous.html 2021-10-05 19:58:02 UTC (rev 8845)
@@ -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.18b.dev: http://docutils.sourceforge.net/" />
+<meta name="generator" content="Docutils 0.18b1: http://docutils.sourceforge.net/" />
<title>dangerous.txt</title>
<link rel="stylesheet" href="../input/data/html4css1.css" type="text/css" />
</head>
Modified: trunk/docutils/test/functional/expected/embed_images_html5.html
===================================================================
--- trunk/docutils/test/functional/expected/embed_images_html5.html 2021-10-05 19:45:59 UTC (rev 8844)
+++ trunk/docutils/test/functional/expected/embed_images_html5.html 2021-10-05 19:58:02 UTC (rev 8845)
@@ -3,7 +3,7 @@
<head>
<meta charset="utf-8"/>
<meta name="viewport" content="width=device-width, initial-scale=1" />
-<meta name="generator" content="Docutils 0.18b.dev: http://docutils.sourceforge.net/" />
+<meta name="generator" content="Docutils 0.18b1: http://docutils.sourceforge.net/" />
<title>Embedded Images</title>
<link rel="stylesheet" href="../input/data/minimal.css" type="text/css" />
<link rel="stylesheet" href="../input/data/plain.css" type="text/css" />
Modified: trunk/docutils/test/functional/expected/field_name_limit.html
===================================================================
--- trunk/docutils/test/functional/expected/field_name_limit.html 2021-10-05 19:45:59 UTC (rev 8844)
+++ trunk/docutils/test/functional/expected/field_name_limit.html 2021-10-05 19:58:02 UTC (rev 8845)
@@ -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.18b.dev: http://docutils.sourceforge.net/" />
+<meta name="generator" content="Docutils 0.18b1: http://docutils.sourceforge.net/" />
<title>field_list.txt</title>
<link rel="stylesheet" href="../input/data/html4css1.css" type="text/css" />
</head>
Modified: trunk/docutils/test/functional/expected/footnotes_html5.html
===================================================================
--- trunk/docutils/test/functional/expected/footnotes_html5.html 2021-10-05 19:45:59 UTC (rev 8844)
+++ trunk/docutils/test/functional/expected/footnotes_html5.html 2021-10-05 19:58:02 UTC (rev 8845)
@@ -3,7 +3,7 @@
<head>
<meta charset="utf-8"/>
<meta name="viewport" content="width=device-width, initial-scale=1" />
-<meta name="generator" content="Docutils 0.18b.dev: http://docutils.sourceforge.net/" />
+<meta name="generator" content="Docutils 0.18b1: http://docutils.sourceforge.net/" />
<title>Test footnote and citation rendering</title>
<link rel="stylesheet" href="../input/data/minimal.css" type="text/css" />
<link rel="stylesheet" href="../input/data/responsive.css" type="text/css" />
Modified: trunk/docutils/test/functional/expected/math_output_html.html
===================================================================
--- trunk/docutils/test/functional/expected/math_output_html.html 2021-10-05 19:45:59 UTC (rev 8844)
+++ trunk/docutils/test/functional/expected/math_output_html.html 2021-10-05 19:58:02 UTC (rev 8845)
@@ -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.18b.dev: http://docutils.sourceforge.net/" />
+<meta name="generator" content="Docutils 0.18b1: http://docutils.sourceforge.net/" />
<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 2021-10-05 19:45:59 UTC (rev 8844)
+++ trunk/docutils/test/functional/expected/math_output_latex.html 2021-10-05 19:58:02 UTC (rev 8845)
@@ -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.18b.dev: http://docutils.sourceforge.net/" />
+<meta name="generator" content="Docutils 0.18b1: http://docutils.sourceforge.net/" />
<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 2021-10-05 19:45:59 UTC (rev 8844)
+++ trunk/docutils/test/functional/expected/math_output_mathjax.html 2021-10-05 19:58:02 UTC (rev 8845)
@@ -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.18b.dev: http://docutils.sourceforge.net/" />
+<meta name="generator" content="Docutils 0.18b1: http://docutils.sourceforge.net/" />
<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 2021-10-05 19:45:59 UTC (rev 8844)
+++ trunk/docutils/test/functional/expected/math_output_mathml.html 2021-10-05 19:58:02 UTC (rev 8845)
@@ -3,7 +3,7 @@
<head>
<meta charset="utf-8"/>
<meta name="viewport" content="width=device-width, initial-scale=1" />
-<meta name="generator" content="Docutils 0.18b.dev: http://docutils.sourceforge.net/" />
+<meta name="generator" content="Docutils 0.18b1: http://docutils.sourceforge.net/" />
<title>Mathematics</title>
<link rel="stylesheet" href="../input/data/minimal.css" type="text/css" />
<link rel="stylesheet" href="../input/data/plain.css" type="text/css" />
Modified: trunk/docutils/test/functional/expected/misc_rst_html4css1.html
===================================================================
--- trunk/docutils/test/functional/expected/misc_rst_html4css1.html 2021-10-05 19:45:59 UTC (rev 8844)
+++ trunk/docutils/test/functional/expected/misc_rst_html4css1.html 2021-10-05 19:58:02 UTC (rev 8845)
@@ -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.18b.dev: http://docutils.sourceforge.net/" />
+<meta name="generator" content="Docutils 0.18b1: http://docutils.sourceforge.net/" />
<title>Additional tests with html4css1</title>
<link rel="stylesheet" href="foo&bar.css" type="text/css" />
<link rel="stylesheet" href="functional/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 2021-10-05 19:45:59 UTC (rev 8844)
+++ trunk/docutils/test/functional/expected/misc_rst_html5.html 2021-10-05 19:58:02 UTC (rev 8845)
@@ -3,7 +3,7 @@
<head>
<meta charset="utf-8"/>
<meta name="viewport" content="width=device-width, initial-scale=1" />
-<meta name="generator" content="Docutils 0.18b.dev: http://docutils.sourceforge.net/" />
+<meta name="generator" content="Docutils 0.18b1: http://docutils.sourceforge.net/" />
<title>Additional tests with HTML 5</title>
<link rel="stylesheet" href="../input/data/minimal.css" type="text/css" />
<link rel="stylesheet" href="../input/data/responsive.css" type="text/css" />
Modified: trunk/docutils/test/functional/expected/pep_html.html
===================================================================
--- trunk/docutils/test/functional/expected/pep_html.html 2021-10-05 19:45:59 UTC (rev 8844)
+++ trunk/docutils/test/functional/expected/pep_html.html 2021-10-05 19:58:02 UTC (rev 8845)
@@ -8,7 +8,7 @@
-->
<head>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
- <meta name="generator" content="Docutils 0.18b.dev: http://docutils.sourceforge.net/" />
+ <meta name="generator" content="Docutils 0.18b1: http://docutils.sourceforge.net/" />
<title>PEP 100 -- Test PEP</title>
<link rel="stylesheet" href="../input/data/html4css1.css" type="text/css" />
</head>
Modified: trunk/docutils/test/functional/expected/standalone_rst_docutils_xml.xml
===================================================================
--- trunk/docutils/test/functional/expected/standalone_rst_docutils_xml.xml 2021-10-05 19:45:59 UTC (rev 8844)
+++ trunk/docutils/test/functional/expected/standalone_rst_docutils_xml.xml 2021-10-05 19:58:02 UTC (rev 8845)
@@ -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.18b.dev -->
+<!-- Generated by Docutils 0.18b1 -->
<document ids="restructuredtext-test-document doctitle" names="restructuredtext\ test\ document doctitle" source="functional/input/standalone_rst_docutils_xml.txt" title="reStructuredText Test Document">
<title>reStructuredText Test Document</title>
<subtitle ids="examples-of-syntax-constructs subtitle" names="examples\ of\ syntax\ constructs subtitle">Examples of Syntax Constructs</subtitle>
Modified: trunk/docutils/test/functional/expected/standalone_rst_html4css1.html
===================================================================
--- trunk/docutils/test/functional/expected/standalone_rst_html4css1.html 2021-10-05 19:45:59 UTC (rev 8844)
+++ trunk/docutils/test/functional/expected/standalone_rst_html4css1.html 2021-10-05 19:58:02 UTC (rev 8845)
@@ -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.18b.dev: http://docutils.sourceforge.net/" />
+<meta name="generator" content="Docutils 0.18b1: http://docutils.sourceforge.net/" />
<title>reStructuredText Test Document</title>
<meta content="reStructuredText, test, parser" name="keywords" />
<meta content="A test document, containing at least one example of each reStructuredText construct." lang="en" name="description" />
Modified: trunk/docutils/test/functional/expected/standalone_rst_html5.html
===================================================================
--- trunk/docutils/test/functional/expected/standalone_rst_html5.html 2021-10-05 19:45:59 UTC (rev 8844)
+++ trunk/docutils/test/functional/expected/standalone_rst_html5.html 2021-10-05 19:58:02 UTC (rev 8845)
@@ -3,7 +3,7 @@
<head>
<meta charset="utf-8"/>
<meta name="viewport" content="width=device-width, initial-scale=1" />
-<meta name="generator" content="Docutils 0.18b.dev: http://docutils.sourceforge.net/" />
+<meta name="generator" content="Docutils 0.18b1: http://docutils.sourceforge.net/" />
<title>reStructuredText Test Document</title>
<meta content="reStructuredText, test, parser" name="keywords" />
<meta content="A test document, containing at least one example of each reStructuredText construct." lang="en" name="description" xml:lang="en" />
Modified: trunk/docutils/test/functional/expected/standalone_rst_s5_html_1.html
===================================================================
--- trunk/docutils/test/functional/expected/standalone_rst_s5_html_1.html 2021-10-05 19:45:59 UTC (rev 8844)
+++ trunk/docutils/test/functional/expected/standalone_rst_s5_html_1.html 2021-10-05 19:58:02 UTC (rev 8845)
@@ -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.18b.dev: http://docutils.sourceforge.net/" />
+<meta name="generator" content="Docutils 0.18b1: http://docutils.sourceforge.net/" />
<meta name="version" content="S5 1.1" />
<title>Slide Shows</title>
<meta name="author" content="David Goodger" />
Modified: trunk/docutils/test/functional/expected/standalone_rst_s5_html_2.html
===================================================================
--- trunk/docutils/test/functional/expected/standalone_rst_s5_html_2.html 2021-10-05 19:45:59 UTC (rev 8844)
+++ trunk/docutils/test/functional/expected/standalone_rst_s5_html_2.html 2021-10-05 19:58:02 UTC (rev 8845)
@@ -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.18b.dev: http://docutils.sourceforge.net/" />
+<meta name="generator" content="Docutils 0.18b1: http://docutils.sourceforge.net/" />
<meta name="version" content="S5 1.1" />
<title>Slide Shows</title>
<meta name="author" content="David Goodger" />
This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site.
|
|
From: <gr...@us...> - 2021-10-05 21:47:41
|
Revision: 8848
http://sourceforge.net/p/docutils/code/8848
Author: grubert
Date: 2021-10-05 21:47:38 +0000 (Tue, 05 Oct 2021)
Log Message:
-----------
release number 0.18b2.dev
Modified Paths:
--------------
trunk/docutils/HISTORY.txt
trunk/docutils/README.txt
trunk/docutils/docutils/__init__.py
trunk/docutils/setup.py
trunk/docutils/test/functional/expected/compact_lists.html
trunk/docutils/test/functional/expected/dangerous.html
trunk/docutils/test/functional/expected/embed_images_html5.html
trunk/docutils/test/functional/expected/field_name_limit.html
trunk/docutils/test/functional/expected/footnotes_html5.html
trunk/docutils/test/functional/expected/math_output_html.html
trunk/docutils/test/functional/expected/math_output_latex.html
trunk/docutils/test/functional/expected/math_output_mathjax.html
trunk/docutils/test/functional/expected/math_output_mathml.html
trunk/docutils/test/functional/expected/misc_rst_html4css1.html
trunk/docutils/test/functional/expected/misc_rst_html5.html
trunk/docutils/test/functional/expected/pep_html.html
trunk/docutils/test/functional/expected/standalone_rst_docutils_xml.xml
trunk/docutils/test/functional/expected/standalone_rst_html4css1.html
trunk/docutils/test/functional/expected/standalone_rst_html5.html
trunk/docutils/test/functional/expected/standalone_rst_s5_html_1.html
trunk/docutils/test/functional/expected/standalone_rst_s5_html_2.html
Modified: trunk/docutils/HISTORY.txt
===================================================================
--- trunk/docutils/HISTORY.txt 2021-10-05 21:35:01 UTC (rev 8847)
+++ trunk/docutils/HISTORY.txt 2021-10-05 21:47:38 UTC (rev 8848)
@@ -11,6 +11,11 @@
.. contents::
+Changes Since 0.18b1
+====================
+
+Will be merged on release.
+
Release 0.18b1 (2021-10-05)
===========================
Modified: trunk/docutils/README.txt
===================================================================
--- trunk/docutils/README.txt 2021-10-05 21:35:01 UTC (rev 8847)
+++ trunk/docutils/README.txt 2021-10-05 21:47:38 UTC (rev 8848)
@@ -1,5 +1,5 @@
=========================
- README: Docutils 0.18b1
+ README: Docutils 0.18b2.dev
=========================
:Author: David Goodger
Modified: trunk/docutils/docutils/__init__.py
===================================================================
--- trunk/docutils/docutils/__init__.py 2021-10-05 21:35:01 UTC (rev 8847)
+++ trunk/docutils/docutils/__init__.py 2021-10-05 21:47:38 UTC (rev 8848)
@@ -56,7 +56,7 @@
__docformat__ = 'reStructuredText'
-__version__ = '0.18b1'
+__version__ = '0.18b2.dev'
"""Docutils version identifier (complies with PEP 440)::
major.minor[.micro][releaselevel[serial]][.dev]
@@ -115,8 +115,8 @@
micro=0,
releaselevel='beta', # one of 'alpha', 'beta', 'candidate', 'final'
# pre-release serial number (0 for final releases and active development):
- serial=1,
- release=True # True for official releases and pre-releases
+ serial=2,
+ release=False # True for official releases and pre-releases
)
"""Comprehensive version information tuple. See 'Version Numbering' in
docs/dev/policies.txt."""
Modified: trunk/docutils/setup.py
===================================================================
--- trunk/docutils/setup.py 2021-10-05 21:35:01 UTC (rev 8847)
+++ trunk/docutils/setup.py 2021-10-05 21:47:38 UTC (rev 8848)
@@ -31,7 +31,7 @@
input Docutils supports reStructuredText, an easy-to-read,
what-you-see-is-what-you-get plaintext markup syntax.""", # wrap at col 60
'url': 'http://docutils.sourceforge.net/',
- 'version': '0.18b1',
+ 'version': '0.18b2.dev',
'author': 'David Goodger',
'author_email': 'go...@py...',
'maintainer': 'docutils-develop list',
Modified: trunk/docutils/test/functional/expected/compact_lists.html
===================================================================
--- trunk/docutils/test/functional/expected/compact_lists.html 2021-10-05 21:35:01 UTC (rev 8847)
+++ trunk/docutils/test/functional/expected/compact_lists.html 2021-10-05 21:47:38 UTC (rev 8848)
@@ -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.18b1: http://docutils.sourceforge.net/" />
+<meta name="generator" content="Docutils 0.18b2.dev: http://docutils.sourceforge.net/" />
<title>compact_lists.txt</title>
<link rel="stylesheet" href="../input/data/html4css1.css" type="text/css" />
</head>
Modified: trunk/docutils/test/functional/expected/dangerous.html
===================================================================
--- trunk/docutils/test/functional/expected/dangerous.html 2021-10-05 21:35:01 UTC (rev 8847)
+++ trunk/docutils/test/functional/expected/dangerous.html 2021-10-05 21:47:38 UTC (rev 8848)
@@ -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.18b1: http://docutils.sourceforge.net/" />
+<meta name="generator" content="Docutils 0.18b2.dev: http://docutils.sourceforge.net/" />
<title>dangerous.txt</title>
<link rel="stylesheet" href="../input/data/html4css1.css" type="text/css" />
</head>
Modified: trunk/docutils/test/functional/expected/embed_images_html5.html
===================================================================
--- trunk/docutils/test/functional/expected/embed_images_html5.html 2021-10-05 21:35:01 UTC (rev 8847)
+++ trunk/docutils/test/functional/expected/embed_images_html5.html 2021-10-05 21:47:38 UTC (rev 8848)
@@ -3,7 +3,7 @@
<head>
<meta charset="utf-8"/>
<meta name="viewport" content="width=device-width, initial-scale=1" />
-<meta name="generator" content="Docutils 0.18b1: http://docutils.sourceforge.net/" />
+<meta name="generator" content="Docutils 0.18b2.dev: http://docutils.sourceforge.net/" />
<title>Embedded Images</title>
<link rel="stylesheet" href="../input/data/minimal.css" type="text/css" />
<link rel="stylesheet" href="../input/data/plain.css" type="text/css" />
Modified: trunk/docutils/test/functional/expected/field_name_limit.html
===================================================================
--- trunk/docutils/test/functional/expected/field_name_limit.html 2021-10-05 21:35:01 UTC (rev 8847)
+++ trunk/docutils/test/functional/expected/field_name_limit.html 2021-10-05 21:47:38 UTC (rev 8848)
@@ -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.18b1: http://docutils.sourceforge.net/" />
+<meta name="generator" content="Docutils 0.18b2.dev: http://docutils.sourceforge.net/" />
<title>field_list.txt</title>
<link rel="stylesheet" href="../input/data/html4css1.css" type="text/css" />
</head>
Modified: trunk/docutils/test/functional/expected/footnotes_html5.html
===================================================================
--- trunk/docutils/test/functional/expected/footnotes_html5.html 2021-10-05 21:35:01 UTC (rev 8847)
+++ trunk/docutils/test/functional/expected/footnotes_html5.html 2021-10-05 21:47:38 UTC (rev 8848)
@@ -3,7 +3,7 @@
<head>
<meta charset="utf-8"/>
<meta name="viewport" content="width=device-width, initial-scale=1" />
-<meta name="generator" content="Docutils 0.18b1: http://docutils.sourceforge.net/" />
+<meta name="generator" content="Docutils 0.18b2.dev: http://docutils.sourceforge.net/" />
<title>Test footnote and citation rendering</title>
<link rel="stylesheet" href="../input/data/minimal.css" type="text/css" />
<link rel="stylesheet" href="../input/data/responsive.css" type="text/css" />
Modified: trunk/docutils/test/functional/expected/math_output_html.html
===================================================================
--- trunk/docutils/test/functional/expected/math_output_html.html 2021-10-05 21:35:01 UTC (rev 8847)
+++ trunk/docutils/test/functional/expected/math_output_html.html 2021-10-05 21:47:38 UTC (rev 8848)
@@ -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.18b1: http://docutils.sourceforge.net/" />
+<meta name="generator" content="Docutils 0.18b2.dev: http://docutils.sourceforge.net/" />
<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 2021-10-05 21:35:01 UTC (rev 8847)
+++ trunk/docutils/test/functional/expected/math_output_latex.html 2021-10-05 21:47:38 UTC (rev 8848)
@@ -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.18b1: http://docutils.sourceforge.net/" />
+<meta name="generator" content="Docutils 0.18b2.dev: http://docutils.sourceforge.net/" />
<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 2021-10-05 21:35:01 UTC (rev 8847)
+++ trunk/docutils/test/functional/expected/math_output_mathjax.html 2021-10-05 21:47:38 UTC (rev 8848)
@@ -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.18b1: http://docutils.sourceforge.net/" />
+<meta name="generator" content="Docutils 0.18b2.dev: http://docutils.sourceforge.net/" />
<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 2021-10-05 21:35:01 UTC (rev 8847)
+++ trunk/docutils/test/functional/expected/math_output_mathml.html 2021-10-05 21:47:38 UTC (rev 8848)
@@ -3,7 +3,7 @@
<head>
<meta charset="utf-8"/>
<meta name="viewport" content="width=device-width, initial-scale=1" />
-<meta name="generator" content="Docutils 0.18b1: http://docutils.sourceforge.net/" />
+<meta name="generator" content="Docutils 0.18b2.dev: http://docutils.sourceforge.net/" />
<title>Mathematics</title>
<link rel="stylesheet" href="../input/data/minimal.css" type="text/css" />
<link rel="stylesheet" href="../input/data/plain.css" type="text/css" />
Modified: trunk/docutils/test/functional/expected/misc_rst_html4css1.html
===================================================================
--- trunk/docutils/test/functional/expected/misc_rst_html4css1.html 2021-10-05 21:35:01 UTC (rev 8847)
+++ trunk/docutils/test/functional/expected/misc_rst_html4css1.html 2021-10-05 21:47:38 UTC (rev 8848)
@@ -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.18b1: http://docutils.sourceforge.net/" />
+<meta name="generator" content="Docutils 0.18b2.dev: http://docutils.sourceforge.net/" />
<title>Additional tests with html4css1</title>
<link rel="stylesheet" href="foo&bar.css" type="text/css" />
<link rel="stylesheet" href="functional/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 2021-10-05 21:35:01 UTC (rev 8847)
+++ trunk/docutils/test/functional/expected/misc_rst_html5.html 2021-10-05 21:47:38 UTC (rev 8848)
@@ -3,7 +3,7 @@
<head>
<meta charset="utf-8"/>
<meta name="viewport" content="width=device-width, initial-scale=1" />
-<meta name="generator" content="Docutils 0.18b1: http://docutils.sourceforge.net/" />
+<meta name="generator" content="Docutils 0.18b2.dev: http://docutils.sourceforge.net/" />
<title>Additional tests with HTML 5</title>
<link rel="stylesheet" href="../input/data/minimal.css" type="text/css" />
<link rel="stylesheet" href="../input/data/responsive.css" type="text/css" />
Modified: trunk/docutils/test/functional/expected/pep_html.html
===================================================================
--- trunk/docutils/test/functional/expected/pep_html.html 2021-10-05 21:35:01 UTC (rev 8847)
+++ trunk/docutils/test/functional/expected/pep_html.html 2021-10-05 21:47:38 UTC (rev 8848)
@@ -8,7 +8,7 @@
-->
<head>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
- <meta name="generator" content="Docutils 0.18b1: http://docutils.sourceforge.net/" />
+ <meta name="generator" content="Docutils 0.18b2.dev: http://docutils.sourceforge.net/" />
<title>PEP 100 -- Test PEP</title>
<link rel="stylesheet" href="../input/data/html4css1.css" type="text/css" />
</head>
Modified: trunk/docutils/test/functional/expected/standalone_rst_docutils_xml.xml
===================================================================
--- trunk/docutils/test/functional/expected/standalone_rst_docutils_xml.xml 2021-10-05 21:35:01 UTC (rev 8847)
+++ trunk/docutils/test/functional/expected/standalone_rst_docutils_xml.xml 2021-10-05 21:47:38 UTC (rev 8848)
@@ -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.18b1 -->
+<!-- Generated by Docutils 0.18b2.dev -->
<document ids="restructuredtext-test-document doctitle" names="restructuredtext\ test\ document doctitle" source="functional/input/standalone_rst_docutils_xml.txt" title="reStructuredText Test Document">
<title>reStructuredText Test Document</title>
<subtitle ids="examples-of-syntax-constructs subtitle" names="examples\ of\ syntax\ constructs subtitle">Examples of Syntax Constructs</subtitle>
Modified: trunk/docutils/test/functional/expected/standalone_rst_html4css1.html
===================================================================
--- trunk/docutils/test/functional/expected/standalone_rst_html4css1.html 2021-10-05 21:35:01 UTC (rev 8847)
+++ trunk/docutils/test/functional/expected/standalone_rst_html4css1.html 2021-10-05 21:47:38 UTC (rev 8848)
@@ -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.18b1: http://docutils.sourceforge.net/" />
+<meta name="generator" content="Docutils 0.18b2.dev: http://docutils.sourceforge.net/" />
<title>reStructuredText Test Document</title>
<meta content="reStructuredText, test, parser" name="keywords" />
<meta content="A test document, containing at least one example of each reStructuredText construct." lang="en" name="description" />
Modified: trunk/docutils/test/functional/expected/standalone_rst_html5.html
===================================================================
--- trunk/docutils/test/functional/expected/standalone_rst_html5.html 2021-10-05 21:35:01 UTC (rev 8847)
+++ trunk/docutils/test/functional/expected/standalone_rst_html5.html 2021-10-05 21:47:38 UTC (rev 8848)
@@ -3,7 +3,7 @@
<head>
<meta charset="utf-8"/>
<meta name="viewport" content="width=device-width, initial-scale=1" />
-<meta name="generator" content="Docutils 0.18b1: http://docutils.sourceforge.net/" />
+<meta name="generator" content="Docutils 0.18b2.dev: http://docutils.sourceforge.net/" />
<title>reStructuredText Test Document</title>
<meta content="reStructuredText, test, parser" name="keywords" />
<meta content="A test document, containing at least one example of each reStructuredText construct." lang="en" name="description" xml:lang="en" />
Modified: trunk/docutils/test/functional/expected/standalone_rst_s5_html_1.html
===================================================================
--- trunk/docutils/test/functional/expected/standalone_rst_s5_html_1.html 2021-10-05 21:35:01 UTC (rev 8847)
+++ trunk/docutils/test/functional/expected/standalone_rst_s5_html_1.html 2021-10-05 21:47:38 UTC (rev 8848)
@@ -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.18b1: http://docutils.sourceforge.net/" />
+<meta name="generator" content="Docutils 0.18b2.dev: http://docutils.sourceforge.net/" />
<meta name="version" content="S5 1.1" />
<title>Slide Shows</title>
<meta name="author" content="David Goodger" />
Modified: trunk/docutils/test/functional/expected/standalone_rst_s5_html_2.html
===================================================================
--- trunk/docutils/test/functional/expected/standalone_rst_s5_html_2.html 2021-10-05 21:35:01 UTC (rev 8847)
+++ trunk/docutils/test/functional/expected/standalone_rst_s5_html_2.html 2021-10-05 21:47:38 UTC (rev 8848)
@@ -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.18b1: http://docutils.sourceforge.net/" />
+<meta name="generator" content="Docutils 0.18b2.dev: http://docutils.sourceforge.net/" />
<meta name="version" content="S5 1.1" />
<title>Slide Shows</title>
<meta name="author" content="David Goodger" />
This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site.
|
|
From: <mi...@us...> - 2021-10-12 11:42:35
|
Revision: 8849
http://sourceforge.net/p/docutils/code/8849
Author: milde
Date: 2021-10-12 11:42:33 +0000 (Tue, 12 Oct 2021)
Log Message:
-----------
Fix a bug in nodes.document.set_name_id_map().
Don't change a list while looping over it.
Thanks to Mickey Endito.
Modified Paths:
--------------
trunk/docutils/HISTORY.txt
trunk/docutils/docutils/nodes.py
Modified: trunk/docutils/HISTORY.txt
===================================================================
--- trunk/docutils/HISTORY.txt 2021-10-05 21:47:38 UTC (rev 8848)
+++ trunk/docutils/HISTORY.txt 2021-10-12 11:42:33 UTC (rev 8849)
@@ -16,6 +16,12 @@
Will be merged on release.
+* docutils/nodes.py
+
+ - Don't change a list while looping over it (in
+ document.set_name_id_map()). Thanks to Mickey Endito.
+
+
Release 0.18b1 (2021-10-05)
===========================
@@ -117,9 +123,8 @@
Use class value "backrefs" instead of "fn-backref" for a span of
back-references.
- - Do not write class values handled by the HTML writer
- ("colwidths-auto", "colwidths-given", "colwidths-grid") to the
- output.
+ - Do not write class values handled by the HTML writer ("colwidths-auto",
+ "colwidths-given", "colwidths-grid") to the output.
- Move space character between section number and heading into
"sectnum" span.
@@ -183,6 +188,7 @@
- Fix: double quotes need to be escaped on macro invocation.
Done everywhere.
+
Release 0.17.1 (2021-04-16)
===========================
@@ -857,6 +863,7 @@
- Apply [ 115 ] respect fixed 2to3 string literal conversion behavior.
+
Release 0.11 (2013-07-22)
=========================
@@ -924,6 +931,7 @@
- Fix [3607063] handle lines starting with a period.
- Fix option separating comma was bold (thanks to Bill Morris).
+
Release 0.10 (2012-12-16)
=========================
@@ -1033,6 +1041,7 @@
- class `Tee`: catch UnicodeError when writing to "ascii" stream or
file under Python 3.
+
Release 0.9 (2012-05-02)
========================
@@ -1127,6 +1136,7 @@
- Do not emit comment line with trailing blank. Problematic for VCS.
+
Release 0.8.1 (2011-08-30)
==========================
@@ -1143,6 +1153,7 @@
- Clean up Babel language setting. Restores Sphinx compatibility.
+
Release 0.8 (2011-07-07)
========================
@@ -1240,6 +1251,7 @@
- Do not close() sys.stdin, sys.stdout, or sys.stderr. Prevents
``Exception ValueError: 'I/O operation on closed file.'`` with Python 3.
+
Release 0.7 (2010-07-07)
========================
@@ -1463,6 +1475,7 @@
* docutils/tools/rst2man.py
+
Release 0.5 (2008-06-25)
========================
Modified: trunk/docutils/docutils/nodes.py
===================================================================
--- trunk/docutils/docutils/nodes.py 2021-10-05 21:47:38 UTC (rev 8848)
+++ trunk/docutils/docutils/nodes.py 2021-10-12 11:42:33 UTC (rev 8849)
@@ -1402,25 +1402,26 @@
booleans representing hyperlink type (True==explicit,
False==implicit). This method updates the mappings.
- The following state transition table shows how `self.nameids` ("ids")
- and `self.nametypes` ("types") 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):
+ 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):
==== ===== ======== ======== ======= ==== ===== =====
Old State Input Action New State Notes
----------- -------- ----------------- ----------- -----
- ids types new type sys.msg. dupname ids types
+ id type new type sys.msg. dupname id type
==== ===== ======== ======== ======= ==== ===== =====
- - explicit - - new True
- - implicit - - new False
- None False explicit - - new True
+ - False explicit - - new True
old False explicit implicit old new True
- None True explicit explicit new None True
- old True explicit explicit new,old None True [#]_
- None False implicit implicit new None False
- old False implicit implicit new,old None False
- None True implicit implicit new None 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
==== ===== ======== ======== ======= ==== ===== =====
@@ -1428,9 +1429,10 @@
both old and new targets are external and refer to identical URIs.
The new target is invalidated regardless.
"""
- for name in node['names']:
+ for name in tuple(node['names']):
if name in self.nameids:
self.set_duplicate_name_id(node, id, name, msgnode, explicit)
+ # attention: modifies node['names']
else:
self.nameids[name] = id
self.nametypes[name] = explicit
@@ -1483,7 +1485,7 @@
# "note" here is an imperative verb: "take note of".
def note_implicit_target(self, target, msgnode=None):
id = self.set_id(target, msgnode)
- self.set_name_id_map(target, id, msgnode, explicit=None)
+ self.set_name_id_map(target, id, msgnode, explicit=False)
def note_explicit_target(self, target, msgnode=None):
id = self.set_id(target, msgnode)
This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site.
|
|
From: <mi...@us...> - 2021-10-12 17:33:27
|
Revision: 8851
http://sourceforge.net/p/docutils/code/8851
Author: milde
Date: 2021-10-12 17:33:24 +0000 (Tue, 12 Oct 2021)
Log Message:
-----------
Fix bug #424 Wrong circular inclusion detection.
The current heuristic for detection of circular includes
fails with nested parsing. Line numbering differs in nested
state-machines, inclusions don't show up in the parent, if
a view is detached (e.g. for table cell content).
The new heuristic uses a "magic" comment instead of line numbers
to keep a log of recursive inclusions.
Add a test case for a false positive and a case for
too late detection in parsed includes.
Adapt tests to (irrelevant) side effects of the patch.
Modified Paths:
--------------
trunk/docutils/HISTORY.txt
trunk/docutils/docutils/parsers/rst/directives/misc.py
trunk/docutils/docutils/parsers/rst/states.py
trunk/docutils/test/test_parsers/test_rst/test_directives/include10.txt
trunk/docutils/test/test_parsers/test_rst/test_directives/test_include.py
trunk/docutils/test/test_parsers/test_rst/test_source_line.py
Modified: trunk/docutils/HISTORY.txt
===================================================================
--- trunk/docutils/HISTORY.txt 2021-10-12 11:42:40 UTC (rev 8850)
+++ trunk/docutils/HISTORY.txt 2021-10-12 17:33:24 UTC (rev 8851)
@@ -21,7 +21,17 @@
- Don't change a list while looping over it (in
document.set_name_id_map()). Thanks to Mickey Endito.
+* docutils/parsers/rst/directives/misc.py
+ - Fix bug #424 Wrong circular inclusion detection.
+ Use a "magic" comment instead of line numbers
+ to keep a log of recursive inclusions.
+
+* docutils/parsers/rst/states.py
+
+ - Use a "magic" comment to update the log of recursive inclusions.
+
+
Release 0.18b1 (2021-10-05)
===========================
Modified: trunk/docutils/docutils/parsers/rst/directives/misc.py
===================================================================
--- trunk/docutils/docutils/parsers/rst/directives/misc.py 2021-10-12 11:42:40 UTC (rev 8850)
+++ trunk/docutils/docutils/parsers/rst/directives/misc.py 2021-10-12 17:33:24 UTC (rev 8851)
@@ -52,7 +52,11 @@
'include')
def run(self):
- """Include a file as part of the content of this reST file."""
+ """Include a file as part of the content of this reST file.
+
+ Depending on the options, the file (or a clipping) is
+ converted to nodes and returned or inserted into the input stream.
+ """
if not self.state.document.settings.file_insertion_enabled:
raise self.warning('"%s" directive disabled.' % self.name)
source = self.state_machine.input_lines.source(
@@ -167,36 +171,33 @@
self.state_machine)
return codeblock.run()
+ # Prevent circular inclusion:
+ clip_options = (startline, endline, before_text, after_text)
+ include_log = self.state.document.include_log
+ # log entries are tuples (<source>, <clip-options>)
+ if not include_log: # new document
+ include_log.append((utils.relative_path(None, source),
+ (None, None, None, None)))
+ if (path, clip_options) in include_log:
+ raise self.warning('circular inclusion in "%s" directive: %s'
+ % (self.name, ' < '.join([path] + [pth for (pth, opt)
+ in include_log[::-1]])))
+
if 'parser' in self.options:
+ # parse into a dummy document and return created nodes
parser = self.options['parser']()
- # parse into a new (dummy) document
document = utils.new_document(path, self.state.document.settings)
+ document.include_log = include_log + [(path, clip_options)]
parser.parse('\n'.join(include_lines), document)
return document.children
- # include as rST source
+ # Include as rST source:
#
- # Prevent circular inclusion:
- source = utils.relative_path(None, source)
- clip_options = (startline, endline, before_text, after_text)
- include_log = self.state.document.include_log
- if not include_log: # new document:
- # log entries: (<source>, <clip-options>, <insertion end index>)
- include_log = [(source, (None,None,None,None), sys.maxsize/2)]
- # cleanup: we may have passed the last inclusion(s):
- include_log = [entry for entry in include_log
- if entry[2] >= self.lineno]
- if (path, clip_options) in [(pth, opt)
- for (pth, opt, e) in include_log]:
- raise self.warning('circular inclusion in "%s" directive: %s'
- % (self.name, ' < '.join([path] + [pth for (pth, opt, e)
- in include_log[::-1]])))
- # include as input
+ # mark end (cf. parsers.rst.states.Body.comment())
+ include_lines += ['', '.. end of inclusion from "%s"' % path]
self.state_machine.insert_input(include_lines, path)
# update include-log
- include_log.append((path, clip_options, self.lineno))
- self.state.document.include_log = [(pth, opt, e+len(include_lines)+2)
- for (pth, opt, e) in include_log]
+ include_log.append((path, clip_options))
return []
Modified: trunk/docutils/docutils/parsers/rst/states.py
===================================================================
--- trunk/docutils/docutils/parsers/rst/states.py 2021-10-12 11:42:40 UTC (rev 8850)
+++ trunk/docutils/docutils/parsers/rst/states.py 2021-10-12 17:33:24 UTC (rev 8851)
@@ -2288,9 +2288,14 @@
return [error], blank_finish
def comment(self, match):
- if not match.string[match.end():].strip() \
- and self.state_machine.is_next_line_blank(): # an empty comment?
- return [nodes.comment()], 1 # "A tiny but practical wart."
+ if self.state_machine.is_next_line_blank():
+ first_comment_line = match.string[match.end():]
+ if not first_comment_line.strip(): # empty comment
+ return [nodes.comment()], True # "A tiny but practical wart."
+ if first_comment_line.startswith('end of inclusion from "'):
+ # cf. parsers.rst.directives.misc.Include
+ self.document.include_log.pop()
+ return [], True
indented, indent, offset, blank_finish = \
self.state_machine.get_first_known_indented(match.end())
while indented and not indented[-1].strip():
@@ -2704,7 +2709,7 @@
def blank(self, match, context, next_state):
"""End of paragraph."""
- # NOTE: self.paragraph returns [ node, system_message(s) ], literalnext
+ # NOTE: self.paragraph returns [node, system_message(s)], literalnext
paragraph, literalnext = self.paragraph(
context, self.state_machine.abs_line_number() - 1)
self.parent += paragraph
Modified: trunk/docutils/test/test_parsers/test_rst/test_directives/include10.txt
===================================================================
--- trunk/docutils/test/test_parsers/test_rst/test_directives/include10.txt 2021-10-12 11:42:40 UTC (rev 8850)
+++ trunk/docutils/test/test_parsers/test_rst/test_directives/include10.txt 2021-10-12 17:33:24 UTC (rev 8851)
@@ -71,7 +71,7 @@
:PEP:`-1`
-.. unknown:: directive (info still reported with wrong line)
+.. unknown:: directive (TODO: info still reported with wrong line)
============== ======
A simple table with
Modified: trunk/docutils/test/test_parsers/test_rst/test_directives/test_include.py
===================================================================
--- trunk/docutils/test/test_parsers/test_rst/test_directives/test_include.py 2021-10-12 11:42:40 UTC (rev 8850)
+++ trunk/docutils/test/test_parsers/test_rst/test_directives/test_include.py 2021-10-12 17:33:24 UTC (rev 8851)
@@ -402,8 +402,49 @@
includes/sibling/include7.txt
"""],
["""\
+Recursive inclusion with specified parser.
+
In test data
+.. include:: %s
+ :parser: rst
+""" % include3,
+"""\
+<document source="test data">
+ <paragraph>
+ Recursive inclusion with specified parser.
+ <paragraph>
+ In test data
+ <paragraph>
+ In include3.txt
+ <paragraph>
+ In includes/include4.txt
+ <paragraph>
+ In includes/include5.txt
+ <paragraph>
+ In includes/more/include6.txt
+ <paragraph>
+ In includes/sibling/include7.txt
+ <literal_block source="test_parsers/test_rst/test_directives/includes/include5.txt" xml:space="preserve">
+ In includes/include5.txt
+ \n\
+ .. include:: more/include6.txt
+ <table>
+ <tgroup cols="2">
+ <colspec colwidth="50">
+ <colspec colwidth="50">
+ <tbody>
+ <row>
+ <entry>
+ <paragraph>
+ In
+ <entry>
+ <paragraph>
+ includes/sibling/include7.txt
+"""],
+["""\
+In test data
+
Section
=======
@@ -758,7 +799,7 @@
<paragraph>
Unknown directive type "unknown".
<literal_block xml:space="preserve">
- .. unknown:: directive (info still reported with wrong line)
+ .. unknown:: directive (TODO: info still reported with wrong line)
<system_message level="3" line="76" source="%(source)s" type="ERROR">
<paragraph>
Malformed table.
@@ -767,6 +808,8 @@
============== ======
A simple table with
no bottom border
+
+ .. end of inclusion from "test_parsers/test_rst/test_directives/include10.txt"
""" % {'source': reldir(include10), 'nonexistent': reldir(nonexistent),
'unichr_exception':
DocutilsTestSupport.exception_data(unichr, int("11111111", 16))[2]
@@ -1223,6 +1266,54 @@
File "include15.txt": example of rekursive inclusion.
""" % (reldir(include16), reldir(include15), reldir(include16),
reldir(include15), reldir(include16))],
+["""\
+Circular inclusion with specified parser.
+
+.. include:: %s
+ :parser: rst
+""" % include15,
+"""\
+<document source="test data">
+ <paragraph>
+ Circular inclusion with specified parser.
+ <paragraph>
+ File "include15.txt": example of rekursive inclusion.
+ <paragraph>
+ File "include16.txt": example of rekursive inclusion.
+ <system_message level="2" line="3" source="%s" type="WARNING">
+ <paragraph>
+ circular inclusion in "include" directive: %s < %s < %s < test data
+ <literal_block xml:space="preserve">
+ .. include:: include15.txt
+ <paragraph>
+ No loop when clipping before the "include" directive:
+ <paragraph>
+ File "include15.txt": example of rekursive inclusion.
+""" % (reldir(include16), reldir(include15),
+ reldir(include16), reldir(include15))],
+["""\
+No circular inclusion.
+
+============================= =============================
+.. include:: data/include.txt .. include:: data/include.txt
+============================= =============================
+""",
+"""\
+<document source="test data">
+ <paragraph>
+ No circular inclusion.
+ <table>
+ <tgroup cols="2">
+ <colspec colwidth="29">
+ <colspec colwidth="29">
+ <tbody>
+ <row>
+ <entry>
+ <paragraph>
+ Some include text.
+ <entry>
+ <paragraph>
+ Some include text."""],
]
if __name__ == '__main__':
Modified: trunk/docutils/test/test_parsers/test_rst/test_source_line.py
===================================================================
--- trunk/docutils/test/test_parsers/test_rst/test_source_line.py 2021-10-12 11:42:40 UTC (rev 8850)
+++ trunk/docutils/test/test_parsers/test_rst/test_source_line.py 2021-10-12 17:33:24 UTC (rev 8851)
@@ -174,7 +174,7 @@
<paragraph internal:line="10" internal:source="test_parsers/test_rst/includes/include14.txt">
second item in line 10
<enumerated_list enumtype="arabic" internal:line="12" internal:source="test_parsers/test_rst/includes/include14.txt" prefix="" suffix=".">
- <list_item internal:source="internal padding after test_parsers/test_rst/includes/include14.txt">
+ <list_item internal:source="test_parsers/test_rst/includes/include14.txt">
<paragraph internal:line="12" internal:source="test_parsers/test_rst/includes/include14.txt">
enumerated list in line 12
"""],
This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site.
|
|
From: <mi...@us...> - 2021-10-12 22:16:46
|
Revision: 8852
http://sourceforge.net/p/docutils/code/8852
Author: milde
Date: 2021-10-12 22:16:43 +0000 (Tue, 12 Oct 2021)
Log Message:
-----------
Small documentation update.
Modified Paths:
--------------
trunk/docutils/FAQ.txt
trunk/docutils/docs/dev/policies.txt
trunk/docutils/docs/dev/repository.txt
Modified: trunk/docutils/FAQ.txt
===================================================================
--- trunk/docutils/FAQ.txt 2021-10-12 17:33:24 UTC (rev 8851)
+++ trunk/docutils/FAQ.txt 2021-10-12 22:16:43 UTC (rev 8852)
@@ -108,11 +108,8 @@
Is there a GUI authoring environment for Docutils?
--------------------------------------------------
-DocFactory_ is under development. See also the links to editors_
-supporting reStructuredText.
+See the links to editors_ supporting reStructuredText.
-.. _DocFactory:
- http://docutils.sf.net/sandbox/gschwant/docfactory/doc/
.. _editors: docs/user/links.html#editors
@@ -122,9 +119,9 @@
Docutils is mainly stable, with documented APIs and architecture
subject to change after announcement and a transition period.
-We fix bugs as they are reported. So the latest code from the
-repository_ (or the snapshots_) are almost always the most stable
-as well as the most featureful.
+We fix bugs as they are reported. This means the code from the
+repository_ (or the snapshots_) is the most stable as well as the most
+featureful most of the time.
What is the Docutils project release policy?
@@ -141,6 +138,19 @@
.. _repository: docs/dev/repository.html
+How can I get a new feature into Docutils?
+------------------------------------------
+
+Present your idea at the docutils-develop_ mailing list
+or file a ticket at Docutils' `feature request tracker`_.
+
+See the `Docutils Policies`__ for a more detailled answer.
+
+.. _docutils-develop: docs/user/mailing-lists.html#docutils-develop
+.. _feature request tracker:
+ http://sourceforge.net/p/docutils/feature-requests/
+__ docs/dev/policies.html#how-to-get-a-new-feature-into-docutils
+
reStructuredText
================
Modified: trunk/docutils/docs/dev/policies.txt
===================================================================
--- trunk/docutils/docs/dev/policies.txt 2021-10-12 17:33:24 UTC (rev 8851)
+++ trunk/docutils/docs/dev/policies.txt 2021-10-12 22:16:43 UTC (rev 8852)
@@ -77,7 +77,8 @@
* Be patient, and be persistent. None of us are paid to do this,
it's all in our spare time -- which is precious and rare.
-How to make code contributions that are easily accepted:
+How to make code contributions that are easily accepted
+-------------------------------------------------------
* Have a look at the `Python coding conventions`_ and `documentation
conventions`_ below.
@@ -98,13 +99,17 @@
* If you are familiar with version control, consider creating a `feature
branch`_ in a Docutils repository_ checkout. (Working with branches is
- *much* easier with git_. You can get a git clone of the repository from
+ *much* easier with Git_. You can get a Git clone of the repository from
http://repo.or.cz/w/docutils.git or with git-svn.)
+
+* Mail your patch to the Docutils-develop_ mailing list or attach it to the
+ relevant ticket at Docutils' `feature request tracker`_.
+ We accept patches created with diff, SVN, or Git.
+
.. _docutils-develop: ../user/mailing-lists.html#docutils-develop
.. _feature request tracker:
- http://sourceforge.net/p/docutils/feature-requests/
-
+ http://sourceforge.net/p/docutils/feature-requests/
.. _git: http://git-scm.com/
.. _Docutils testing: testing.html
Modified: trunk/docutils/docs/dev/repository.txt
===================================================================
--- trunk/docutils/docs/dev/repository.txt 2021-10-12 17:33:24 UTC (rev 8851)
+++ trunk/docutils/docs/dev/repository.txt 2021-10-12 22:16:43 UTC (rev 8852)
@@ -1,5 +1,5 @@
=====================================
- The Docutils_ Subversion Repository
+ The Docutils_ Version Repository
=====================================
:Author: Lea Wiemann
@@ -34,13 +34,10 @@
TortoiseSVN_, a convenient explorer extension. The instructions apply
analogously.
-There is a git_ mirror at http://repo.or.cz/docutils.git providing
-`web access`_ and the base for `creating a local git clone`_.
+There is a Git_ mirror at http://repo.or.cz/docutils.git (and one at
+`github <https://github.com/live-clones/docutils/tree/master/docutils>`_).
+Both provide `web access`_ and the base for `creating a local Git clone`_.
-and docutils trunk is cloned hourly to github :
-
- https://github.com/live-clones/docutils/tree/master/docutils
-
For the project policy on repository use (check-in requirements,
branching, etc.), please see the `Docutils Project Policies`__.
@@ -50,7 +47,7 @@
.. _Subversion Book: http://svnbook.red-bean.com/
.. _TortoiseSVN: http://tortoisesvn.tigris.org/
.. _SourceForge.net: http://sourceforge.net/
-.. _git: http://git-scm.com/
+.. _Git: http://git-scm.com/
.. contents::
@@ -67,24 +64,35 @@
The repository can be browsed and examined via the web at
http://sourceforge.net/p/docutils/code
-Alternatively, use the web interface of the git mirror at
-http://repo.or.cz/w/docutils.git.
+Alternatively, use the web interface of the Git mirrors at
+http://repo.or.cz/docutils.git or github_.
Repository Access Methods
~~~~~~~~~~~~~~~~~~~~~~~~~
-To get a checkout of the Docutils repository, first determine the root
-of the repository depending on your preferred protocol:
+Users of Git_ can clone a mirror of the docutils repository with ::
+ git clone git://repo.or.cz/docutils.git
+
+and proceed according to the `Git documentation`_.
+Developer access (read and write) is possible with `git svn`_.
+
+.. _Git documentation: https://git.wiki.kernel.org/index.php/GitDocumentation
+.. _git svn: https://git.wiki.kernel.org/index.php/Git-svn
+
+
+To get a checkout with Subversion_, first determine
+the root of the repository depending on your preferred protocol:
+
anonymous access: (read only)
``http://svn.code.sf.net/p/docutils/code``
+
+ .. _creating a local Git clone:
`developer access`_: (read and write)
``svn+ssh://<USERNAME>@svn.code.sf.net/p/docutils/code``
-.. git clone: (read only)
- ``git clone git://repo.or.cz/docutils.git``
Checking Out the Repository
~~~~~~~~~~~~~~~~~~~~~~~~~~~
@@ -119,18 +127,7 @@
svn switch --relocate OLDROOT NEWROOT
-Creating a local git clone
-~~~~~~~~~~~~~~~~~~~~~~~~~~
-Users of git_ can clone a mirror of the docutils repository with ::
-
- git clone git://repo.or.cz/docutils.git
-
-and proceed according to the `git documentation`_.
-
-.. _git documentation: http://git-scm.com/documentation
-
-
.. _developer access:
Information for Developers
This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site.
|
|
From: <mi...@us...> - 2021-10-13 15:42:33
|
Revision: 8853
http://sourceforge.net/p/docutils/code/8853
Author: milde
Date: 2021-10-13 15:42:30 +0000 (Wed, 13 Oct 2021)
Log Message:
-----------
New option "image_loading" for HTML5.
With values "embed", "eager", "lazy", cf, feature-request #78.
Obsoletes "embed_image".
Modified Paths:
--------------
trunk/docutils/HISTORY.txt
trunk/docutils/RELEASE-NOTES.txt
trunk/docutils/docs/user/config.txt
trunk/docutils/docutils/writers/_html_base.py
trunk/docutils/docutils/writers/html5_polyglot/__init__.py
trunk/docutils/test/test_writers/test_html5_polyglot_parts.py
Modified: trunk/docutils/HISTORY.txt
===================================================================
--- trunk/docutils/HISTORY.txt 2021-10-12 22:16:43 UTC (rev 8852)
+++ trunk/docutils/HISTORY.txt 2021-10-13 15:42:30 UTC (rev 8853)
@@ -18,7 +18,7 @@
* docutils/nodes.py
- - Don't change a list while looping over it (in
+ - Don't change a list while looping over it (in
document.set_name_id_map()). Thanks to Mickey Endito.
* docutils/parsers/rst/directives/misc.py
@@ -28,10 +28,15 @@
to keep a log of recursive inclusions.
* docutils/parsers/rst/states.py
-
+
- Use a "magic" comment to update the log of recursive inclusions.
+* docutils/writers/html5_polyglot/__init__.py
+ - New option "image_loading". Support "lazy" loading of images.
+ Obsoletes "embed_images".
+
+
Release 0.18b1 (2021-10-05)
===========================
@@ -253,7 +258,7 @@
- Apply patch #165 "Fix error when copying `system_message` node"
by Takeshi KOMIYA.
- Apply version of patch #167 "Let document.set_id() register all
- existing IDs" (thanks to Takeshi KOMIYA).
+ existing IDs". Thanks to Takeshi KOMIYA.
- Fix bug #410: Use a "property" function to recursively fetch
`Node.document` value from parent node.
@@ -306,7 +311,7 @@
__ https://stackoverflow.com/questions/39547412/same-font-size-for-h1-and-h2-in-article
- Use HTML text-level tags <small>, <s>, <q>, <dfn>, <var>, <samp>, <kbd>,
- <i>, <b>, <u>, <mark>, and <bdi> if a unique matching class value
+ <i>, <b>, <u>, <mark>, and <bdi> if a unique, matching class value
is found in `inline`__ and `literal`__ elements.
Use <ins> and <del> if a unique matching class value
is found in `inline`, `literal`, or `container` elements.
@@ -537,7 +542,7 @@
* docutils/io.py
- Fix [ 348 ] Since Python 3.4, the 'U' universal newlines mode has been
- deprecated (thanks to hugovk).
+ deprecated. Thanks to hugovk.
* docutils/languages/ko.py
docutils/parsers/rst/languages/ko.py:
@@ -1242,8 +1247,8 @@
* tools/editors/emacs/rst.el:
- - Fix [ 3001100 ] does not handle spaces in filenames
- (thanks to Jakub Wilk)
+ - Fix [ 3001100 ] does not handle spaces in filenames.
+ Thanks to Jakub Wilk.
* docutils/utils.py:
Modified: trunk/docutils/RELEASE-NOTES.txt
===================================================================
--- trunk/docutils/RELEASE-NOTES.txt 2021-10-12 22:16:43 UTC (rev 8852)
+++ trunk/docutils/RELEASE-NOTES.txt 2021-10-13 15:42:30 UTC (rev 8853)
@@ -24,20 +24,22 @@
* `html5` writer:
- - Do not longer set the "footnote-reference" class value for footnote
+ - Stop setting the "footnote-reference" class value for footnote
references. Since 0.18, you can use the CSS selector
``[role="doc-noteref"]`` instead of ``.footnote-reference``
(see minimal.css for examples).
+
+ - Remove option "embed_images" (obsoleted by image_loading_).
+
+ .. _image_loading: docs/user/config.html#image-loading
- - Move attribution behind the blockquote to comply with the
- `"living standard"`__?
- (HTML5__ allows <cite> elements inside a blockquote, cf. Example 16.)
+ - Move attribution behind the blockquote to comply with the `"living
+ standard"`__. (HTML5__ allows <cite> elements inside a blockquote.)
__ https://html.spec.whatwg.org/#the-blockquote-element
- __ https://www.w3.org/TR/html52/grouping-content.html#the-blockquote-element
+ __ https://www.w3.org/TR/2014/REC-html5-20141028/grouping-content.html
+ #the-blockquote-element
-* `htm4css1` writer: Support the embed_images_ option.
-
* `latex2e` writer:
- Change default of use_latex_citations_ setting to True.
@@ -76,8 +78,8 @@
.. _use_latex_citations: docs/user/config.html#use-latex-citations
-Release 0.18b1 (2021-10-05)
-===========================
+Release 0.18
+============
.. Note::
@@ -139,17 +141,18 @@
Use STIX fonts if available.
LaTeX:
- `legacy_class_functions`_ setting default changed to "False":
+ `legacy_class_functions`_ setting default changed to "False",
admonitions are now environments.
-* New standard Docutils doctree node "meta__".
+* New standard Docutils doctree node: <meta__>.
-* New configuration setting: [latex writers] legacy_column_widths_.
+* New configuration settings:
+ [latex writers] legacy_column_widths_ and
+ [html5 writer] image_loading_.
* Removed files:
+ ``iepngfix.htc`` and ``blank.gif`` (IE 6 workaround for `s5_html`).
- - ``iepngfix.htc`` and ``blank.gif`` (IE 6 workaround for `s5_html`).
-
* Removed function: ``utils.unique_combinations``
(obsoleted by ``itertools.combinations``).
Modified: trunk/docutils/docs/user/config.txt
===================================================================
--- trunk/docutils/docs/user/config.txt 2021-10-12 22:16:43 UTC (rev 8852)
+++ trunk/docutils/docs/user/config.txt 2021-10-13 15:42:30 UTC (rev 8853)
@@ -1143,7 +1143,7 @@
Overrides also stylesheet_path_. [#override]_
-Default: None. Options: ``--stylesheet``.
+Default: None. Option: ``--stylesheet``.
.. _stylesheet_dirs [html writers]:
@@ -1212,7 +1212,7 @@
captionbelow
Place the table caption below the table
- (New in 0.17).
+ (New in Docutils 0.17).
In addition, the HTML writers support:
@@ -1315,34 +1315,49 @@
New in Docutils 0.13.
-__ https://www.w3.org/TR/html53/sections.html#the-h1-h2-h3-h4-h5-and-h6-elements
.. _HTML5 Writer: html.html#html5-polyglot
-.. _HTML5: http://www.w3.org/TR/html5/
+.. _HTML5: https://www.w3.org/TR/2014/REC-html5-20141028/
-
Writer Specific Defaults
""""""""""""""""""""""""
`initial_header_level`_
- 2 (for "<h2>", cf. the `HTML5.3 Working Draft`__)
+ 2 (for "<h2>", cf. the "`The h1, h2, h3, h4, h5, and h6 elements`__"
+ in the HTML Standard)
`stylesheet_path <stylesheet_path [html writers]_>`__:
"minimal.css, plain.css"
+__ https://html.spec.whatwg.org/multipage/sections.html
+ #the-h1,-h2,-h3,-h4,-h5,-and-h6-elements
+
embed_images
""""""""""""
-Embed images in the output HTML file. If the image can be read from
-the local file system and its MIME type can be determined, it is
-base64_ encoded and included as a `data URI`_.
+Deprecated. Obsoleted by image_loading_.
-Default: disabled (False).
-Options: ``--embed-images``, ``--link-images``.
-New in Docutils 0.17.
+image_loading
+"""""""""""""
+Suggest at which point images should be loaded.
+
+:embed: If the image can be read from the local file system, it is
+ base64_ encoded and included as a `data URI`_.
+ (In future, SVG images will be converted to inline SVG)
+
+:eager: load image immediately when opening the HTML document (default).
+
+:lazy: Specify the `lazy loading attribute`_ to defer fetching the image.
+
+Default: "eager". Option: ``--image-loading``.
+
+New in Docutils 0.18.
+
.. _base64: https://en.wikipedia.org/wiki/Base64
.. _data URI: https://en.wikipedia.org/wiki/Data_URI_scheme
+.. _lazy loading attribute: https://html.spec.whatwg.org/multipage/
+ urls-and-fetching.html#lazy-loading-attributes
section_self_link
Modified: trunk/docutils/docutils/writers/_html_base.py
===================================================================
--- trunk/docutils/docutils/writers/_html_base.py 2021-10-12 22:16:43 UTC (rev 8852)
+++ trunk/docutils/docutils/writers/_html_base.py 2021-10-13 15:42:30 UTC (rev 8853)
@@ -318,7 +318,11 @@
self.body_suffix = ['</body>\n</html>\n']
self.section_level = 0
self.initial_header_level = int(settings.initial_header_level)
-
+ # image_loading only defined for HTML5 writer
+ self.image_loading = getattr(settings, 'image_loading', 'eager')
+ if (getattr(settings, 'embed_images', False)
+ and self.image_loading == 'eager'):
+ self.image_loading = 'embed'
self.math_output = settings.math_output.split()
self.math_output_options = self.math_output[1:]
self.math_output = self.math_output[0].lower()
@@ -1041,7 +1045,7 @@
if 'align' in node:
atts['class'] = 'align-%s' % node['align']
# Embed image file (embedded SVG or data URI):
- if self.settings.embed_images or ('embed' in node):
+ if self.image_loading == 'embed':
err_msg = ''
if not mimetype:
err_msg = 'unknown MIME type'
@@ -1064,6 +1068,8 @@
# insert as <svg ....> ... </svg> # (about 1/3 less data)
data64 = base64.b64encode(imagedata).decode()
uri = u'data:%s;base64,%s' % (mimetype, data64)
+ elif self.image_loading == 'lazy':
+ atts['loading'] = 'lazy'
if mimetype == 'application/x-shockwave-flash':
atts['type'] = mimetype
# do NOT use an empty tag: incorrect rendering in browsers
Modified: trunk/docutils/docutils/writers/html5_polyglot/__init__.py
===================================================================
--- trunk/docutils/docutils/writers/html5_polyglot/__init__.py 2021-10-12 22:16:43 UTC (rev 8852)
+++ trunk/docutils/docutils/writers/html5_polyglot/__init__.py 2021-10-13 15:42:30 UTC (rev 8853)
@@ -85,14 +85,18 @@
settings_spec = settings_spec + (
'HTML5 Writer Options',
'',
- (('Embed images in the output HTML file, if the image '
- 'files are accessible during processing.',
+ (('Obsoleted by "--image-loading".',
['--embed-images'],
{'default': 0, 'action': 'store_true',
'validator': frontend.validate_boolean}),
- ('Link to images in the output HTML file. (default)',
+ ('Obsoleted by "--image-loading".',
['--link-images'],
{'dest': 'embed_images', 'action': 'store_false'}),
+ ('Suggest at which point images should be loaded: '
+ '"embed", "eager" (default), or "lazy".',
+ ['--image-loading'],
+ {'choices': ('embed', 'eager', 'lazy'),
+ 'default': 'eager'}),
('Append a self-link to section headings.',
['--section-self-link'],
{'default': 0, 'action': 'store_true'}),
@@ -281,7 +285,8 @@
if 'controls' in node['classes']:
atts['controls'] = 'controls'
atts['title'] = node.get('alt', uri)
-
+ if self.settings.image_loading == 'lazy':
+ atts['loading'] = 'lazy'
# No newline in inline context or if surrounded by <a>...</a>.
if (isinstance(node.parent, nodes.TextElement) or
(isinstance(node.parent, nodes.reference) and
Modified: trunk/docutils/test/test_writers/test_html5_polyglot_parts.py
===================================================================
--- trunk/docutils/test/test_writers/test_html5_polyglot_parts.py 2021-10-12 22:16:43 UTC (rev 8852)
+++ trunk/docutils/test/test_writers/test_html5_polyglot_parts.py 2021-10-13 15:42:30 UTC (rev 8853)
@@ -623,6 +623,40 @@
"""],
+totest['lazy loading'] = ({'image_loading': 'lazy',
+ 'stylesheet_path': '',
+ 'embed_stylesheet': 0}, [
+
+["""\
+.. image:: dummy.png
+""",
+"""\
+{'fragment': '''\
+<img alt="dummy.png" loading="lazy" src="dummy.png" />\\n''',
+ 'html_body': '''\
+<main>
+<img alt="dummy.png" loading="lazy" src="dummy.png" />
+</main>\\n''',
+ 'html_head': '''...<title><string></title>\\n'''}
+"""],
+["""\
+.. figure:: dummy.png
+""",
+"""\
+{'fragment': '''\
+<figure>
+<img alt="dummy.png" loading="lazy" src="dummy.png" />
+</figure>\\n''',
+ 'html_body': '''\
+<main>
+<figure>
+<img alt="dummy.png" loading="lazy" src="dummy.png" />
+</figure>
+</main>\\n''',
+ 'html_head': '''...<title><string></title>\\n'''}
+"""],
+])
+
if __name__ == '__main__':
import unittest
unittest.main(defaultTest='suite')
This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site.
|
|
From: <mi...@us...> - 2021-10-15 16:03:34
|
Revision: 8854
http://sourceforge.net/p/docutils/code/8854
Author: milde
Date: 2021-10-15 16:03:31 +0000 (Fri, 15 Oct 2021)
Log Message:
-----------
Config setting image_loading: use value "link" instead of "eager".
The name "eager" is too HTML5-centric. The distinction
link/embed may be supported in future also by the ODF/ODT writer.
Modified Paths:
--------------
trunk/docutils/docs/user/config.txt
trunk/docutils/docutils/writers/_html_base.py
trunk/docutils/docutils/writers/html5_polyglot/__init__.py
Modified: trunk/docutils/docs/user/config.txt
===================================================================
--- trunk/docutils/docs/user/config.txt 2021-10-13 15:42:30 UTC (rev 8853)
+++ trunk/docutils/docs/user/config.txt 2021-10-15 16:03:31 UTC (rev 8854)
@@ -1342,15 +1342,15 @@
Suggest at which point images should be loaded.
-:embed: If the image can be read from the local file system, it is
- base64_ encoded and included as a `data URI`_.
- (In future, SVG images will be converted to inline SVG)
+:embed: If the image can be read from the local file system,
+ the image data is embedded into the HTML document.
-:eager: load image immediately when opening the HTML document (default).
+:link: Link to image in the HTML document (default).
-:lazy: Specify the `lazy loading attribute`_ to defer fetching the image.
+:lazy: Link to image. Specify the `lazy loading attribute`_ to defer
+ fetching the image.
-Default: "eager". Option: ``--image-loading``.
+Default: "link". Option: ``--image-loading``.
New in Docutils 0.18.
Modified: trunk/docutils/docutils/writers/_html_base.py
===================================================================
--- trunk/docutils/docutils/writers/_html_base.py 2021-10-13 15:42:30 UTC (rev 8853)
+++ trunk/docutils/docutils/writers/_html_base.py 2021-10-15 16:03:31 UTC (rev 8854)
@@ -319,9 +319,9 @@
self.section_level = 0
self.initial_header_level = int(settings.initial_header_level)
# image_loading only defined for HTML5 writer
- self.image_loading = getattr(settings, 'image_loading', 'eager')
+ self.image_loading = getattr(settings, 'image_loading', 'link')
if (getattr(settings, 'embed_images', False)
- and self.image_loading == 'eager'):
+ and self.image_loading == 'link'):
self.image_loading = 'embed'
self.math_output = settings.math_output.split()
self.math_output_options = self.math_output[1:]
Modified: trunk/docutils/docutils/writers/html5_polyglot/__init__.py
===================================================================
--- trunk/docutils/docutils/writers/html5_polyglot/__init__.py 2021-10-13 15:42:30 UTC (rev 8853)
+++ trunk/docutils/docutils/writers/html5_polyglot/__init__.py 2021-10-15 16:03:31 UTC (rev 8854)
@@ -93,10 +93,10 @@
['--link-images'],
{'dest': 'embed_images', 'action': 'store_false'}),
('Suggest at which point images should be loaded: '
- '"embed", "eager" (default), or "lazy".',
+ '"embed", "link" (default), or "lazy".',
['--image-loading'],
- {'choices': ('embed', 'eager', 'lazy'),
- 'default': 'eager'}),
+ {'choices': ('embed', 'link', 'lazy'),
+ 'default': 'link'}),
('Append a self-link to section headings.',
['--section-self-link'],
{'default': 0, 'action': 'store_true'}),
This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site.
|
|
From: <mi...@us...> - 2021-10-16 21:07:55
|
Revision: 8857
http://sourceforge.net/p/docutils/code/8857
Author: milde
Date: 2021-10-16 21:07:52 +0000 (Sat, 16 Oct 2021)
Log Message:
-----------
Test and update recommonmark_wrapper.py to work with recommonmark 0.6.0.
Still experimental.
Unfortunately, recommonmark_ is no longer maintained
(https://github.com/readthedocs/recommonmark/issues/221).
Modified Paths:
--------------
trunk/docutils/HISTORY.txt
trunk/docutils/docutils/parsers/recommonmark_wrapper.py
trunk/docutils/test/test_parsers/test_recommonmark/test_misc.py
Modified: trunk/docutils/HISTORY.txt
===================================================================
--- trunk/docutils/HISTORY.txt 2021-10-15 16:03:47 UTC (rev 8856)
+++ trunk/docutils/HISTORY.txt 2021-10-16 21:07:52 UTC (rev 8857)
@@ -21,6 +21,15 @@
- Don't change a list while looping over it (in
document.set_name_id_map()). Thanks to Mickey Endito.
+* docutils/parsers/recommonmark_wrapper.py
+
+ - Test and update to work with recommonmark version 0.6.0.
+ Still experimental.
+
+ Unfortunately, recommonmark_ is `no longer maintained`__.
+
+ __ https://github.com/readthedocs/recommonmark/issues/221
+
* docutils/parsers/rst/directives/misc.py
- Fix bug #424 Wrong circular inclusion detection.
@@ -265,10 +274,10 @@
* docutils/parsers/recommonmark_wrapper.py
- New, **experimental** wrapper to integrate the
- `recommonmark`__ Markdown parser for use with Docutils.
+ `recommonmark`_ Markdown parser for use with Docutils.
Currently only tested with recommonmark version 0.4.0.
- __ https://pypi.org/project/recommonmark/
+ .. _recommonmark: https://pypi.org/project/recommonmark/
* docutils/parsers/rst/directives/body.py
Modified: trunk/docutils/docutils/parsers/recommonmark_wrapper.py
===================================================================
--- trunk/docutils/docutils/parsers/recommonmark_wrapper.py 2021-10-15 16:03:47 UTC (rev 8856)
+++ trunk/docutils/docutils/parsers/recommonmark_wrapper.py 2021-10-16 21:07:52 UTC (rev 8857)
@@ -23,7 +23,6 @@
try:
from recommonmark.parser import CommonMarkParser
- # from recommonmark.transform import AutoStructify
except ImportError as err:
CommonMarkParser = None
class Parser(docutils.parsers.Parser):
@@ -34,20 +33,27 @@
'"recommonmark" (https://pypi.org/project/recommonmark/).')
document.append(error)
+# recommonmark 0.5.0 introduced a hard dependency on Sphinx
+# https://github.com/readthedocs/recommonmark/issues/202
+# There is a PR to change this to an optional dependency
+# https://github.com/readthedocs/recommonmark/pull/218
+try:
+ from sphinx import addnodes
+except ImportError:
+ # create a stub
+ class addnodes(nodes.pending): pass
+
if CommonMarkParser:
class Parser(CommonMarkParser):
"""MarkDown parser based on recommonmark."""
- # TODO: settings for AutoStructify
- # settings_spec = docutils.parsers.Parser.settings_spec + (
- # see https://recommonmark.readthedocs.io/en/latest/#autostructify
-
+
supported = ('recommonmark', 'commonmark', 'markdown', 'md')
config_section = 'recommonmark parser'
config_section_dependencies = ('parsers',)
- # def get_transforms(self):
- # return Component.get_transforms(self) + [AutoStructify]
+ def get_transforms(self):
+ return Component.get_transforms(self) # + [AutoStructify]
def parse(self, inputstring, document):
"""Use the upstream parser and clean up afterwards.
@@ -112,18 +118,29 @@
# remove spurious IDs (first may be from duplicate name)
if len(node['ids']) > 1:
node['ids'].pop()
- # fix section levels
- section_level = self.get_section_level(node)
- if node['level'] != section_level:
- warning = document.reporter.warning(
- 'Title level inconsistent. Changing from %d to %d.'
- %(node['level'], section_level),
- nodes.literal_block('', node[0].astext()))
- node.insert(1, warning)
- # remove non-standard attribute "level"
- del node['level'] # TODO: store the original md level somewhere
+ # fix section levels (recommonmark 0.4.0
+ # later versions silently ignore incompatible levels)
+ if 'level' in node:
+ section_level = self.get_section_level(node)
+ if node['level'] != section_level:
+ warning = document.reporter.warning(
+ 'Title level inconsistent. Changing from %d to %d.'
+ %(node['level'], section_level),
+ nodes.literal_block('', node[0].astext()))
+ node.insert(1, warning)
+ # remove non-standard attribute "level"
+ del node['level']
+
+ # drop pending_xref (Sphinx cross reference extension)
+ for node in document.traverse(addnodes.pending_xref):
+ reference = node.children[0]
+ if 'name' not in reference:
+ reference['name'] = nodes.fully_normalize_name(
+ reference.astext())
+ node.parent.replace(node, reference)
def get_section_level(self, node):
+ """Auxiliary function for post-processing in self.parse()"""
level = 1
while True:
node = node.parent
@@ -131,3 +148,10 @@
return level
if isinstance(node, nodes.section):
level += 1
+
+ def visit_document(self, node):
+ """Dummy function to prevent spurious warnings.
+
+ cf. https://github.com/readthedocs/recommonmark/issues/177
+ """
+ pass
Modified: trunk/docutils/test/test_parsers/test_recommonmark/test_misc.py
===================================================================
--- trunk/docutils/test/test_parsers/test_recommonmark/test_misc.py 2021-10-15 16:03:47 UTC (rev 8856)
+++ trunk/docutils/test/test_parsers/test_recommonmark/test_misc.py 2021-10-16 21:07:52 UTC (rev 8857)
@@ -25,14 +25,6 @@
from docutils.core import publish_string
from docutils.parsers import recommonmark_wrapper
-sample1 = """\
-Test unexpected section titles.
-
-* Title
- =====
- Paragraph.
-"""
-
sample_with_html = """\
A paragraph:
@@ -51,14 +43,6 @@
class reCommonMarkParserTests(unittest.TestCase):
@unittest.skipUnless(recommonmark_wrapper.CommonMarkParser, skip_msg)
- def test_parsing_error(self):
- output = publish_string(sample1, parser_name='recommonmark',
- settings_overrides={'warning_stream': ''})
-
- self.assertIn(b'Parsing with "recommonmark" returned the error:',
- output)
-
- @unittest.skipUnless(recommonmark_wrapper.CommonMarkParser, skip_msg)
def test_raw_disabled(self):
output = publish_string(sample_with_html, parser_name='recommonmark',
settings_overrides={'warning_stream': '',
@@ -91,7 +75,7 @@
@unittest.skipIf(recommonmark_wrapper.CommonMarkParser,
'recommonmark_wrapper: parser found, fallback not used')
def test_fallback_parser(self):
- output = publish_string(sample1, parser_name='recommonmark',
+ output = publish_string(sample_with_html, parser_name='recommonmark',
settings_overrides={'warning_stream': ''})
self.assertIn(b'Python did not find the required module "recommonmark"',
output)
This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site.
|
|
From: <mi...@us...> - 2021-10-19 17:03:05
|
Revision: 8858
http://sourceforge.net/p/docutils/code/8858
Author: milde
Date: 2021-10-19 17:03:02 +0000 (Tue, 19 Oct 2021)
Log Message:
-----------
docutils-cli.py: Read settings from standard configuration files.
Modified Paths:
--------------
trunk/docutils/HISTORY.txt
trunk/docutils/docs/user/config.txt
trunk/docutils/docutils/frontend.py
trunk/docutils/tools/docutils-cli.py
Modified: trunk/docutils/HISTORY.txt
===================================================================
--- trunk/docutils/HISTORY.txt 2021-10-16 21:07:52 UTC (rev 8857)
+++ trunk/docutils/HISTORY.txt 2021-10-19 17:03:02 UTC (rev 8858)
@@ -45,7 +45,11 @@
- New option "image_loading". Support "lazy" loading of images.
Obsoletes "embed_images".
+* tools/docutils-cli.py
+ - Read settings from standard configuration files.
+
+
Release 0.18b1 (2021-10-05)
===========================
Modified: trunk/docutils/docs/user/config.txt
===================================================================
--- trunk/docutils/docs/user/config.txt 2021-10-16 21:07:52 UTC (rev 8857)
+++ trunk/docutils/docs/user/config.txt 2021-10-19 17:03:02 UTC (rev 8858)
@@ -2126,6 +2126,35 @@
.. _HTML writer: html.html
+[docutils-cli application]
+--------------------------
+
+New in 0.18.
+
+reader
+~~~~~~
+Reader component name. One of "standalone" or "pep".
+
+Default: "standalone".
+Option: ``--reader``
+
+parser
+~~~~~~
+Parser component name. One of "markdown", "recommonmark", or "rst"
+
+Default: "rst".
+Option: ``--parser``
+
+.. _writer [docutils-cli application]:
+
+writer
+~~~~~~
+Writer component name. One of the valid writer names or aliases.
+
+Default: "html5".
+Option: ``--writer``
+
+
Other Settings
==============
Modified: trunk/docutils/docutils/frontend.py
===================================================================
--- trunk/docutils/docutils/frontend.py 2021-10-16 21:07:52 UTC (rev 8857)
+++ trunk/docutils/docutils/frontend.py 2021-10-19 17:03:02 UTC (rev 8858)
@@ -332,7 +332,7 @@
def copy(self):
"""Return a shallow copy of `self`."""
return self.__class__(defaults=self.__dict__)
-
+
def setdefault(self, name, default):
"""V.setdefault(n[,d]) -> getattr(V,n,d), also set D.n=d if n not in D or None.
"""
@@ -683,7 +683,7 @@
parser.read(config_file, self)
self.config_files.extend(parser._files)
base_path = os.path.dirname(config_file)
- applied = {}
+ applied = set()
settings = Values()
for component in self.components:
if not component:
@@ -692,7 +692,7 @@
+ (component.config_section,)):
if section in applied:
continue
- applied[section] = 1
+ applied.add(section)
settings.update(parser.get_section(section), self)
make_paths_absolute(
settings.__dict__, self.relative_path_settings, base_path)
Modified: trunk/docutils/tools/docutils-cli.py
===================================================================
--- trunk/docutils/tools/docutils-cli.py 2021-10-16 21:07:52 UTC (rev 8857)
+++ trunk/docutils/tools/docutils-cli.py 2021-10-19 17:03:02 UTC (rev 8858)
@@ -28,31 +28,54 @@
from docutils.core import publish_cmdline, default_description
from docutils.utils import SystemMessage
+from docutils.frontend import ConfigParser, OptionParser
+config_section = 'docutils-cli application'
+
+def config_settings_from_files():
+ """Return dict with default settings for the docutils-cli front end.
+
+ Read default values for the three docutils-cli options from the
+ [docutils-cli application] section in standard configuration files.
+
+ Command-line options are defined separately, using the "argparse" module
+ to allow two-stage parsing of the command line.
+ """
+ settings = {'reader': 'standalone',
+ 'parser': 'rst',
+ 'writer': 'html5'
+ }
+ option_parser = OptionParser()
+ config_parser = ConfigParser()
+ config_files = option_parser.get_standard_config_files()
+ config_parser.read(config_files, option_parser)
+ settings.update(config_parser.get_section(config_section))
+ return settings
+
+default_settings = config_settings_from_files()
+
description = u'Generate documents from reStructuredText or Markdown sources.'
-
-epilog = (u'Currently, the component selection cannot be specified in the '
- u'configuration file. '
- u'The availability of some options depends on the selected '
+
+epilog = (u'The availability of some options depends on the selected '
u'components, the list below adapts to your selection.'
)
-parser = argparse.ArgumentParser(add_help=False,
+parser = argparse.ArgumentParser(add_help=False,
description=description, epilog=epilog,
formatter_class=argparse.ArgumentDefaultsHelpFormatter)
parser.add_argument('--reader', choices=('standalone', 'pep'),
help=u'reader name',
- default='standalone')
-parser.add_argument('--parser', choices=('markdown', 'rst'),
+ default=default_settings['reader'])
+parser.add_argument('--parser', choices=('markdown', 'recommonmark', 'rst'),
help=u'parser name',
- default='rst')
-parser.add_argument('--writer',
+ default=default_settings['parser'])
+parser.add_argument('--writer',
# choices=('html', 'html4', 'html5', 'latex', 'xelatex',
# 'odt', 'xml', 'pseudoxml', 'manpage',
# 'pep_html', 's5_html'),
help=u'writer name',
- default='html5')
+ default=default_settings['writer'])
(args, remainder) = parser.parse_known_args()
@@ -64,7 +87,8 @@
try:
publish_cmdline(reader_name=args.reader,
parser_name=args.parser,
- writer_name=args.writer,
+ writer_name=args.writer,
+ config_section=config_section,
description=default_description,
argv=remainder)
except ImportError as error:
This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site.
|
|
From: <mi...@us...> - 2021-10-21 22:59:26
|
Revision: 8859
http://sourceforge.net/p/docutils/code/8859
Author: milde
Date: 2021-10-21 22:59:24 +0000 (Thu, 21 Oct 2021)
Log Message:
-----------
Fix spelling errors.
Modified Paths:
--------------
trunk/docutils/FAQ.txt
trunk/docutils/HISTORY.txt
trunk/docutils/docs/howto/rst-roles.txt
trunk/docutils/docs/user/config.txt
trunk/docutils/docutils/nodes.py
trunk/docutils/docutils/writers/pseudoxml.py
trunk/docutils/test/test_writers/test_pseudoxml.py
Modified: trunk/docutils/FAQ.txt
===================================================================
--- trunk/docutils/FAQ.txt 2021-10-19 17:03:02 UTC (rev 8858)
+++ trunk/docutils/FAQ.txt 2021-10-21 22:59:24 UTC (rev 8859)
@@ -144,7 +144,7 @@
Present your idea at the docutils-develop_ mailing list
or file a ticket at Docutils' `feature request tracker`_.
-See the `Docutils Policies`__ for a more detailled answer.
+See the `Docutils Policies`__ for a more detailed answer.
.. _docutils-develop: docs/user/mailing-lists.html#docutils-develop
.. _feature request tracker:
Modified: trunk/docutils/HISTORY.txt
===================================================================
--- trunk/docutils/HISTORY.txt 2021-10-19 17:03:02 UTC (rev 8858)
+++ trunk/docutils/HISTORY.txt 2021-10-21 22:59:24 UTC (rev 8859)
@@ -45,6 +45,10 @@
- New option "image_loading". Support "lazy" loading of images.
Obsoletes "embed_images".
+* docutils/writers/pseudoxml.py:
+
+ - Fix spelling of option "detailed".
+
* tools/docutils-cli.py
- Read settings from standard configuration files.
@@ -91,10 +95,10 @@
docutils/tools/math/tex2unicode.py,
docutils/writers/html5/math.css
- - Fork from elyxer and remove code that is not requried
+ - Fork from elyxer and remove code that is not required
for math conversion.
- Scale variable sized operators and big delimiters with CSS
- - Support more commands, fix mapping fo commands to Unicode characters
+ - Support more commands, fix mapping of commands to Unicode characters
(cf. `LaTeX syntax for mathematics`_).
- Fix bug #244 Wrong subscript/superscript order.
- Don't use <tt> element (deprecated in HTML5).
@@ -165,7 +169,7 @@
* docutils/writers/html4css1/__init__.py:
- - Overwrite methods in _html_base.HTMLTranslator that use HTM5 tags
+ - Overwrite methods in _html_base.HTMLTranslator that use HTML5 tags
(details, aside, nav, ...) and attributes (role, aria-level).
* docutils/writers/latex2e/__init__.py
@@ -185,7 +189,7 @@
- Improve spacing and allow customization of Docutils-generated table
of contents.
- - New algorithm for table colum widths. Fixes bug #422.
+ - New algorithm for table column widths. Fixes bug #422.
New configuration setting legacy_column_widths_.
Table.set_table_style() arguments changed.
@@ -247,7 +251,7 @@
- Installing with ``setup.py`` now requires ``setuptools``.
Alternatively, install with `pip`_ (or "manually").
- - Use importlib.import_module() to programmatically import modules.
+ - Use importlib.import_module() to programatically import modules.
- Fix bug #385: Import of language modules.
.. _pip: https://pypi.org/project/pip/
@@ -411,7 +415,7 @@
- Fix #394 fix missing new line after rubric.
- Patch #168 fix crashing on empty citation (by Takeshi KOMIYA).
- Fix #126 manpage title with spaces.
- - Fix #380 commandline option problem in sphinx.
+ - Fix #380 command line option problem in sphinx.
* docutils/writers/odf_odt/__init__.py:
@@ -423,7 +427,7 @@
- New option `detailled`__.
- __ docs/user/config.html#detailled
+ __ docs/user/config.html#detailed
* test/DocutilsTestSupport.py
@@ -521,7 +525,7 @@
* test/test_writers/test_odt.py:
- - Fix [ 359 ]: Test suite failes on Python 3.8. odt xml sorting.
+ - Fix [ 359 ]: Test suite fails on Python 3.8. odt XML sorting.
Use ElementTree instead of minidom.
* tools/buildhtml.py
@@ -617,7 +621,7 @@
- Fix bug #323: spurious ``\phantomsection`` and whitespace in
``parts['title']``.
- - Fix bug #324: Invalid LaTeX for table with empty multicolumn cell.
+ - Fix bug #324: Invalid LaTeX for table with empty multi-column cell.
- Fixes to literal block handling.
@@ -724,7 +728,7 @@
* tools/rst2html4.py: New front-end.
-* tools/dev/generate_punctuation_chars.py: New skript
+* tools/dev/generate_punctuation_chars.py: New script
to test and update utils.punctuation_chars.
@@ -776,12 +780,12 @@
* docutils/utils/error_reporting.py
- - Fix [ 130 ] support streams expectiong byte-strings in ErrorOutput.
+ - Fix [ 130 ] support streams expecting byte-strings in ErrorOutput.
* docutils/utils/math/math2html.py
- Add ``\colon`` macro, fix spacing around colons. Fixes [ 246 ].
- - New upstream version (additional macros, piecewise integrals and sums).
+ - New upstream version (additional macros, piece-wise integrals and sums).
* docutils/writers/_html_base.py
@@ -877,7 +881,7 @@
* docutils/writers/latex2e/__init__.py
- Fix [ 239 ] Latex writer glues paragraphs with figure floats.
- - Apply [ 116 ] by Kirill Smelkov. Don't hardcode \large for subtitle.
+ - Apply [ 116 ] by Kirill Smelkov. Don't hard code \large for subtitle.
* docutils/writers/odf_odt/__init__.py
@@ -889,7 +893,7 @@
* test/test_nodes.py
- - Apply [ 115 ] respect fixed 2to3 string literal conversion behavior.
+ - Apply [ 115 ] respect fixed 2to3 string literal conversion behaviour.
Release 0.11 (2013-07-22)
@@ -897,7 +901,7 @@
* General
- - Apply [ 2714873 ] Fix for the overwritting of document attributes.
+ - Apply [ 2714873 ] Fix for the overwriting of document attributes.
- Support embedded aliases within hyperlink references.
- Fix [ 228 ] try local import of docutils components (reader, writer, parser,
language module) before global search.
@@ -992,8 +996,8 @@
* docutils/utils/__init__.py
- - normalize_language_tag() now returns `BCP 47`_ conformant tags
- with subtags separated by ``-``.
+ - normalize_language_tag() now returns `BCP 47`_ conforming tags
+ with sub-tags separated by ``-``.
* docutils/writers/html4css1/__init__.py
@@ -1004,7 +1008,7 @@
* docutils/writers/manpage.py
- - Apply [ 3527401 ] addmonition's don't preserve indentation
+ - Apply [ 3527401 ] admonition's don't preserve indentation
- Apply [ 3527397 ] Add indentation to literal blocks in manpage writer.
* docutils/writers/xetex/__init__.py
@@ -1014,7 +1018,7 @@
* docutils/writers/s5_html/__init__.py
- - Fix [ 3556388 ] Mathjax does not work with rst2s5.
+ - Fix [ 3556388 ] MathJax does not work with rst2s5.
* docutils/writers/s5_html/docutils_xml.py
@@ -1239,7 +1243,7 @@
No hard-coded "unicode" hyperref option (clash with xetex).
- Set language for custom roles, paragraphs, block-quotes, and
line-quotes with class argument "language-<language tag>".
- - Fix [ 3095603 ] wrong quotes output for russian and other languages.
+ - Fix [ 3095603 ] wrong quotes output for Russian and other languages.
- Convert image URI to a local file path.
- Apply [ 3148141 ] fix multicolumn support when a colspanning cell
has more than one paragraph (Wolfgang Scherer).
@@ -1304,7 +1308,7 @@
* docutils/writers/html4css1/__init__.py
- Support SVG and SWF images (thanks to Stefan Rank).
- - Generate valid XHTML for centered images with targets.
+ - Generate valid XHTML for centred images with targets.
Use CSS classes instead of "align" tags for image alignment.
* docutils/writers/latex2e/__init__.py
@@ -1342,7 +1346,7 @@
* docutils/nodes.py
- Fix: encoding ``'ascii'`` must be lowercase to prevent problems for
- turkish locale.
+ Turkish locale.
* setup.py:
@@ -1370,8 +1374,8 @@
+ Drop extras/optparse.py and extras/textwrap.py
(stdlib modules since 2.3).
- - OpenOffice export: ODT writer moved from sandbox to Doctutils core.
- - Unix man page export: manpage writer moved from sandbox to Doctutils
+ - OpenOffice export: ODT writer moved from sandbox to Docutils core.
+ - Unix man page export: manpage writer moved from sandbox to Docutils
core.
- Apply [ 1719345 ] Galician translation
@@ -1449,13 +1453,13 @@
- Apply [ 2051599 ] multi-page tables in latex writer (from pabigot).
- Change: has_key for dictionaries (not Nodes) to in-operator.
- Merge adjacent citations into one latex cite command.
- - Failsave implementation of custom roles. LaTeX compilation now ignores
+ - Fail-save implementation of custom roles. LaTeX compilation now ignores
unknown classes instead of aborting with an error.
- Support custom roles based on standard roles.
- LaTeX packages can be used as ``--stylesheet`` arguments without
restriction. (A style sheet is now referenced with the ``\usepackage``
command, if it ends with ``.sty`` or has no extension.)
- - Add ``bp`` to lenghts without unit (prevents LaTex errors).
+ - Add ``bp`` to lengths without unit (prevents LaTeX errors).
- Correctly write length unit ``pt`` as ``bp`` in LaTeX.
- Do not convert ``px`` to ``pt`` (``px`` is supported by pdfTeX since
2005-02-04 as a configurable length unit).
@@ -1491,7 +1495,7 @@
(``--figure-footnotes, --figure-citations, --link-stylesheet``,
``--use-docutils-toc, --use-docutils-docinfo, --topic-abstract``)
- New defaults:
- - font-encoding: "T1" (formerly implicitely set by 'ae').
+ - font-encoding: "T1" (formerly implicitly set by 'ae').
- use-latex-toc: true (ToC with page numbers).
- use-latex-footnotes: true (no mixup with figures).
Modified: trunk/docutils/docs/howto/rst-roles.txt
===================================================================
--- trunk/docutils/docs/howto/rst-roles.txt 2021-10-19 17:03:02 UTC (rev 8858)
+++ trunk/docutils/docs/howto/rst-roles.txt 2021-10-21 22:59:24 UTC (rev 8859)
@@ -46,7 +46,7 @@
* ``name``: The local name of the interpreted role, the role name
actually used in the document.
-* ``rawtext``: A string containing the enitre interpreted text input,
+* ``rawtext``: A string containing the entire interpreted text input,
including the role and markup. Return it as a ``problematic`` node
linked to a system message if a problem is encountered.
@@ -126,7 +126,7 @@
roles.register_canonical_role(name, role_function)
This code is normally placed immediately after the definition of
- the role funtion.
+ the role function.
2. Add an entry to the ``roles`` dictionary in
``docutils/parsers/rst/languages/en.py`` for the role, mapping the
Modified: trunk/docutils/docs/user/config.txt
===================================================================
--- trunk/docutils/docs/user/config.txt 2021-10-19 17:03:02 UTC (rev 8858)
+++ trunk/docutils/docs/user/config.txt 2021-10-21 22:59:24 UTC (rev 8859)
@@ -83,7 +83,7 @@
Configuration file entry names correspond to internal runtime
settings. Underscores ("_") and hyphens ("-") can be used
-interchangably in entry names; hyphens are automatically converted to
+interchangeably in entry names; hyphens are automatically converted to
underscores.
For on/off switch settings (_`booleans`), the following values are
@@ -312,7 +312,7 @@
expose_internals
----------------
-List_ of internal attribues to expose as external attributes (with
+List_ of internal attributes to expose as external attributes (with
"internal:" namespace prefix). To specify multiple attributes in
configuration files, use colons to separate names; on the command
line, the option may be used more than once.
@@ -433,7 +433,7 @@
Replace with the appropriate XML character reference, such as
"``†``".
backslashreplace
- Replace with backslashed escape sequences, such as "``\u2020``".
+ Replace with backslash escape sequences, such as "``\u2020``".
Acceptable values are the same as for the "error" parameter of
Python's ``encode`` string method; other values may be defined in
@@ -589,7 +589,7 @@
reports. Exceptions are allowed to propagate, instead of being
caught and reported (in a user-friendly way) by Docutils.
-Default: disabled (None) unless Docutils is run programmatically
+Default: disabled (None) unless Docutils is run programatically
using the `Publisher Interface`_.
Options: ``--traceback, --no-traceback``.
@@ -657,12 +657,12 @@
requiring whitespace or punctuation around inline markup.
Allows character level inline markup without escaped whithespace and is
-especially suited for langauges that do not use whitespace to separate words
+especially suited for languages that do not use whitespace to separate words
(e.g. Japanese, Chinese).
.. WARNING:: Potentially dangerous; use with caution.
- When changing this setting to "True", inline markup charactes in
+ When changing this setting to "True", inline markup characters in
URLs, names and formulas must be escaped to prevent recognition and
possible errors. Examples::
@@ -956,7 +956,7 @@
Remove extra vertical whitespace between items of bullet lists and
enumerated lists, when list items are all "simple" (i.e., items
-each contain one paragraph and/or one "simple" sublist only). The
+each contain one paragraph and/or one "simple" sub-list only). The
behaviour can be specified directly via "class" attributes (values
"compact" and "open") in the document.
@@ -1062,7 +1062,7 @@
installation. In that case, there is no need to install MathJax locally.
Downside: Downloads JavaScript code from a third-party site --- opens
- the door to cross-site scripting attacs!
+ the door to cross-site scripting attacks!
Example: MathJax `getting started`__ documentation uses::
@@ -1118,7 +1118,7 @@
:LaTeX:
Include literal LaTeX code.
- The failsave fallback.
+ The fail-save fallback.
Default: HTML math.css. Option: ``--math-output``.
@@ -1217,7 +1217,7 @@
In addition, the HTML writers support:
colwidths-auto
- Delegate the determination of table column widths to the backend
+ Delegate the determination of table column widths to the back-end
(leave out the ``<colgroup>`` column specification).
Overridden by the "widths" option of the `table directive`_.
@@ -1674,10 +1674,10 @@
~~~~~~~~~~~~~~~
Per default the latex-writer puts the reference title into
-hyperreferences. Specify "ref*" or "pageref*" to get the section
+hyper references. Specify "ref*" or "pageref*" to get the section
number or the page number.
-Default: "" (use hyperreferences). Option: ``--reference-label``.
+Default: "" (use hyper references). Option: ``--reference-label``.
section_enumerator_separator
~~~~~~~~~~~~~~~~~~~~~~~~~~~~
@@ -1840,7 +1840,7 @@
use_latex_toc
~~~~~~~~~~~~~
-To get pagenumbers in the `table of contents`_, it
+To get page numbers in the `table of contents`_, it
must be generated by LaTeX. Usually latex must be run twice to get
numbers correct.
@@ -2053,12 +2053,12 @@
[pseudoxml writer]
------------------
-detailled
+detailed
~~~~~~~~~
Pretty-print <#text> nodes.
-Default: False. Option: ``--detailled``.
+Default: False. Option: ``--detailed``.
[applications]
Modified: trunk/docutils/docutils/nodes.py
===================================================================
--- trunk/docutils/docutils/nodes.py 2021-10-19 17:03:02 UTC (rev 8858)
+++ trunk/docutils/docutils/nodes.py 2021-10-21 22:59:24 UTC (rev 8859)
@@ -424,7 +424,7 @@
def pformat(self, indent=' ', level=0):
try:
- if self.document.settings.detailled:
+ if self.document.settings.detailed:
lines = ['%s%s' % (indent*level, '<#text>')
] + [indent*(level+1) + repr(reprunicode(line))
for line in self.splitlines(True)]
Modified: trunk/docutils/docutils/writers/pseudoxml.py
===================================================================
--- trunk/docutils/docutils/writers/pseudoxml.py 2021-10-19 17:03:02 UTC (rev 8858)
+++ trunk/docutils/docutils/writers/pseudoxml.py 2021-10-21 22:59:24 UTC (rev 8859)
@@ -21,7 +21,7 @@
'"Docutils pseudo-XML" Writer Options',
None,
(('Pretty-print <#text> nodes.',
- ['--detailled'],
+ ['--detailed'],
{'action': 'store_true', 'validator': frontend.validate_boolean}),
))
Modified: trunk/docutils/test/test_writers/test_pseudoxml.py
===================================================================
--- trunk/docutils/test/test_writers/test_pseudoxml.py 2021-10-19 17:03:02 UTC (rev 8858)
+++ trunk/docutils/test/test_writers/test_pseudoxml.py 2021-10-21 22:59:24 UTC (rev 8859)
@@ -20,12 +20,12 @@
s = DocutilsTestSupport.PublishTestSuite('pseudoxml',
suite_settings=settings)
s.generateTests(totest)
- settings['detailled'] = True
- s.generateTests(totest_detailled)
+ settings['detailed'] = True
+ s.generateTests(totest_detailed)
return s
totest = {}
-totest_detailled = {}
+totest_detailed = {}
totest['basic'] = [
# input
@@ -59,7 +59,7 @@
"""]
]
-totest_detailled['basic'] = [
+totest_detailed['basic'] = [
# input
[totest['basic'][0][0],
# output
This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site.
|
|
From: <mi...@us...> - 2021-10-22 22:48:19
|
Revision: 8861
http://sourceforge.net/p/docutils/code/8861
Author: milde
Date: 2021-10-22 22:48:16 +0000 (Fri, 22 Oct 2021)
Log Message:
-----------
Documentation update.
Update outdated links.
Credit Dimitri Papadopoulos for the spell check.
Modified Paths:
--------------
trunk/docutils/HISTORY.txt
trunk/docutils/docs/dev/repository.txt
Modified: trunk/docutils/HISTORY.txt
===================================================================
--- trunk/docutils/HISTORY.txt 2021-10-22 16:39:59 UTC (rev 8860)
+++ trunk/docutils/HISTORY.txt 2021-10-22 22:48:16 UTC (rev 8861)
@@ -53,7 +53,10 @@
- Read settings from standard configuration files.
+Fix spelling errors in documentation and docstrings.
+Thanks to Dimitri Papadopoulos.
+
Release 0.18b1 (2021-10-05)
===========================
Modified: trunk/docutils/docs/dev/repository.txt
===================================================================
--- trunk/docutils/docs/dev/repository.txt 2021-10-22 16:39:59 UTC (rev 8860)
+++ trunk/docutils/docs/dev/repository.txt 2021-10-22 22:48:16 UTC (rev 8861)
@@ -13,21 +13,20 @@
.. admonition:: Quick Instructions
To get a checkout of the Docutils source tree (with the
- sandboxes), type ::
+ sandboxes) with SVN_, type ::
svn checkout http://svn.code.sf.net/p/docutils/code/trunk docutils-code
+ Users of Git_ can clone a mirror of the docutils repository with ::
+ git clone git://repo.or.cz/docutils.git
+
If you are going to commit changes to the repository, please read
the **whole document**, especially the section "`Information for
Developers`_"!
-.. important::
- As of 2013-03-13 the subversion urls have changed.
-
-Docutils uses a Subversion_ repository located at
+Docutils uses a Subversion_ (SVN) repository located at
``docutils.svn.sourceforge.net``.
-Subversion is exhaustively documented in the `Subversion Book`_ (svnbook).
While Unix and Mac OS X users will probably prefer the standard
Subversion command line interface, Windows user may want to try
@@ -34,9 +33,10 @@
TortoiseSVN_, a convenient explorer extension. The instructions apply
analogously.
-There is a Git_ mirror at http://repo.or.cz/docutils.git (and one at
-`github <https://github.com/live-clones/docutils/tree/master/docutils>`_).
-Both provide `web access`_ and the base for `creating a local Git clone`_.
+There is a _`Git mirror` at http://repo.or.cz/docutils.git providing
+`web access`_ and the base for `creating a local Git clone`_.
+(Another mirror is available at
+https://github.com/live-clones/docutils/tree/master/docutils.)
For the project policy on repository use (check-in requirements,
branching, etc.), please see the `Docutils Project Policies`__.
@@ -43,9 +43,9 @@
__ policies.html#subversion-repository
-.. _Subversion: http://subversion.tigris.org/
-.. _Subversion Book: http://svnbook.red-bean.com/
-.. _TortoiseSVN: http://tortoisesvn.tigris.org/
+.. _SVN:
+.. _Subversion: https://subversion.apache.org/
+.. _TortoiseSVN: https://tortoisesvn.net/
.. _SourceForge.net: http://sourceforge.net/
.. _Git: http://git-scm.com/
@@ -64,13 +64,14 @@
The repository can be browsed and examined via the web at
http://sourceforge.net/p/docutils/code
-Alternatively, use the web interface of the Git mirrors at
-http://repo.or.cz/docutils.git or github_.
+Alternatively, use the web interface of a `Git mirror`_.
Repository Access Methods
~~~~~~~~~~~~~~~~~~~~~~~~~
+.. _creating a local Git clone:
+
Users of Git_ can clone a mirror of the docutils repository with ::
git clone git://repo.or.cz/docutils.git
@@ -87,8 +88,6 @@
anonymous access: (read only)
``http://svn.code.sf.net/p/docutils/code``
-
- .. _creating a local Git clone:
`developer access`_: (read and write)
``svn+ssh://<USERNAME>@svn.code.sf.net/p/docutils/code``
@@ -139,7 +138,7 @@
(Note that there may be a delay of several hours until you can commit
changes to the repository.)
-Sourceforge subversion access is documented `here`__
+Sourceforge SVN access is documented `here`__
__ http://sourceforge.net/p/forge/documentation/svn/
This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site.
|
|
From: <gr...@us...> - 2021-10-26 11:53:29
|
Revision: 8865
http://sourceforge.net/p/docutils/code/8865
Author: grubert
Date: 2021-10-26 11:53:26 +0000 (Tue, 26 Oct 2021)
Log Message:
-----------
release 0.18 (HISTORY and RELEASE-NOTES.txt)
Modified Paths:
--------------
trunk/docutils/HISTORY.txt
trunk/docutils/RELEASE-NOTES.txt
Modified: trunk/docutils/HISTORY.txt
===================================================================
--- trunk/docutils/HISTORY.txt 2021-10-26 11:46:55 UTC (rev 8864)
+++ trunk/docutils/HISTORY.txt 2021-10-26 11:53:26 UTC (rev 8865)
@@ -11,11 +11,9 @@
.. contents::
-Changes Since 0.18b1
-====================
+Release 0.18 (2021-10-26)
+=========================
-Will be merged on release.
-
* docutils/nodes.py
- Don't change a list while looping over it (in
Modified: trunk/docutils/RELEASE-NOTES.txt
===================================================================
--- trunk/docutils/RELEASE-NOTES.txt 2021-10-26 11:46:55 UTC (rev 8864)
+++ trunk/docutils/RELEASE-NOTES.txt 2021-10-26 11:53:26 UTC (rev 8865)
@@ -78,8 +78,8 @@
.. _use_latex_citations: docs/user/config.html#use-latex-citations
-Release 0.18 (unpublished)
-==========================
+Release 0.18 (2021-10-26)
+=========================
.. Note::
@@ -168,6 +168,9 @@
* Various bugfixes and improvements (see HISTORY_).
+ Fix spelling errors in documentation and docstrings.
+ Thanks to Dimitri Papadopoulos.
+
__ docs/ref/doctree.html#meta
.. _identifier normalization:
docs/ref/rst/directives.html#identifier-normalization
This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site.
|
|
From: <gr...@us...> - 2021-10-26 12:42:54
|
Revision: 8867
http://sourceforge.net/p/docutils/code/8867
Author: grubert
Date: 2021-10-26 12:42:51 +0000 (Tue, 26 Oct 2021)
Log Message:
-----------
release 0.18.1b.dev
Modified Paths:
--------------
trunk/docutils/HISTORY.txt
trunk/docutils/README.txt
trunk/docutils/docutils/__init__.py
trunk/docutils/setup.py
trunk/docutils/test/functional/expected/compact_lists.html
trunk/docutils/test/functional/expected/dangerous.html
trunk/docutils/test/functional/expected/embed_images_html5.html
trunk/docutils/test/functional/expected/field_name_limit.html
trunk/docutils/test/functional/expected/footnotes_html5.html
trunk/docutils/test/functional/expected/math_output_html.html
trunk/docutils/test/functional/expected/math_output_latex.html
trunk/docutils/test/functional/expected/math_output_mathjax.html
trunk/docutils/test/functional/expected/math_output_mathml.html
trunk/docutils/test/functional/expected/misc_rst_html4css1.html
trunk/docutils/test/functional/expected/misc_rst_html5.html
trunk/docutils/test/functional/expected/pep_html.html
trunk/docutils/test/functional/expected/standalone_rst_docutils_xml.xml
trunk/docutils/test/functional/expected/standalone_rst_html4css1.html
trunk/docutils/test/functional/expected/standalone_rst_html5.html
trunk/docutils/test/functional/expected/standalone_rst_s5_html_1.html
trunk/docutils/test/functional/expected/standalone_rst_s5_html_2.html
Modified: trunk/docutils/HISTORY.txt
===================================================================
--- trunk/docutils/HISTORY.txt 2021-10-26 12:06:43 UTC (rev 8866)
+++ trunk/docutils/HISTORY.txt 2021-10-26 12:42:51 UTC (rev 8867)
@@ -11,6 +11,11 @@
.. contents::
+Changes Since 0.18
+==================
+
+.
+
Release 0.18 (2021-10-26)
=========================
Modified: trunk/docutils/README.txt
===================================================================
--- trunk/docutils/README.txt 2021-10-26 12:06:43 UTC (rev 8866)
+++ trunk/docutils/README.txt 2021-10-26 12:42:51 UTC (rev 8867)
@@ -1,6 +1,6 @@
-=======================
- README: Docutils 0.18
-=======================
+==============================
+ README: Docutils 0.18.1b.dev
+==============================
:Author: David Goodger
:Contact: go...@py...
Modified: trunk/docutils/docutils/__init__.py
===================================================================
--- trunk/docutils/docutils/__init__.py 2021-10-26 12:06:43 UTC (rev 8866)
+++ trunk/docutils/docutils/__init__.py 2021-10-26 12:42:51 UTC (rev 8867)
@@ -56,7 +56,7 @@
__docformat__ = 'reStructuredText'
-__version__ = '0.18'
+__version__ = '0.18.1b.dev'
"""Docutils version identifier (complies with PEP 440)::
major.minor[.micro][releaselevel[serial]][.dev]
@@ -112,11 +112,11 @@
__version_info__ = VersionInfo(
major=0,
minor=18,
- micro=0,
- releaselevel='final', # one of 'alpha', 'beta', 'candidate', 'final'
+ micro=1,
+ releaselevel='beta', # one of 'alpha', 'beta', 'candidate', 'final'
# pre-release serial number (0 for final releases and active development):
serial=0,
- release=True # True for official releases and pre-releases
+ release=False # True for official releases and pre-releases
)
"""Comprehensive version information tuple. See 'Version Numbering' in
docs/dev/policies.txt."""
Modified: trunk/docutils/setup.py
===================================================================
--- trunk/docutils/setup.py 2021-10-26 12:06:43 UTC (rev 8866)
+++ trunk/docutils/setup.py 2021-10-26 12:42:51 UTC (rev 8867)
@@ -31,7 +31,7 @@
input Docutils supports reStructuredText, an easy-to-read,
what-you-see-is-what-you-get plaintext markup syntax.""", # wrap at col 60
'url': 'http://docutils.sourceforge.net/',
- 'version': '0.18',
+ 'version': '0.18.1b.dev',
'author': 'David Goodger',
'author_email': 'go...@py...',
'maintainer': 'docutils-develop list',
Modified: trunk/docutils/test/functional/expected/compact_lists.html
===================================================================
--- trunk/docutils/test/functional/expected/compact_lists.html 2021-10-26 12:06:43 UTC (rev 8866)
+++ trunk/docutils/test/functional/expected/compact_lists.html 2021-10-26 12:42:51 UTC (rev 8867)
@@ -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.18: http://docutils.sourceforge.net/" />
+<meta name="generator" content="Docutils 0.18.1b.dev: http://docutils.sourceforge.net/" />
<title>compact_lists.txt</title>
<link rel="stylesheet" href="../input/data/html4css1.css" type="text/css" />
</head>
Modified: trunk/docutils/test/functional/expected/dangerous.html
===================================================================
--- trunk/docutils/test/functional/expected/dangerous.html 2021-10-26 12:06:43 UTC (rev 8866)
+++ trunk/docutils/test/functional/expected/dangerous.html 2021-10-26 12:42:51 UTC (rev 8867)
@@ -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.18: http://docutils.sourceforge.net/" />
+<meta name="generator" content="Docutils 0.18.1b.dev: http://docutils.sourceforge.net/" />
<title>dangerous.txt</title>
<link rel="stylesheet" href="../input/data/html4css1.css" type="text/css" />
</head>
Modified: trunk/docutils/test/functional/expected/embed_images_html5.html
===================================================================
--- trunk/docutils/test/functional/expected/embed_images_html5.html 2021-10-26 12:06:43 UTC (rev 8866)
+++ trunk/docutils/test/functional/expected/embed_images_html5.html 2021-10-26 12:42:51 UTC (rev 8867)
@@ -3,7 +3,7 @@
<head>
<meta charset="utf-8"/>
<meta name="viewport" content="width=device-width, initial-scale=1" />
-<meta name="generator" content="Docutils 0.18: http://docutils.sourceforge.net/" />
+<meta name="generator" content="Docutils 0.18.1b.dev: http://docutils.sourceforge.net/" />
<title>Embedded Images</title>
<link rel="stylesheet" href="../input/data/minimal.css" type="text/css" />
<link rel="stylesheet" href="../input/data/plain.css" type="text/css" />
Modified: trunk/docutils/test/functional/expected/field_name_limit.html
===================================================================
--- trunk/docutils/test/functional/expected/field_name_limit.html 2021-10-26 12:06:43 UTC (rev 8866)
+++ trunk/docutils/test/functional/expected/field_name_limit.html 2021-10-26 12:42:51 UTC (rev 8867)
@@ -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.18: http://docutils.sourceforge.net/" />
+<meta name="generator" content="Docutils 0.18.1b.dev: http://docutils.sourceforge.net/" />
<title>field_list.txt</title>
<link rel="stylesheet" href="../input/data/html4css1.css" type="text/css" />
</head>
Modified: trunk/docutils/test/functional/expected/footnotes_html5.html
===================================================================
--- trunk/docutils/test/functional/expected/footnotes_html5.html 2021-10-26 12:06:43 UTC (rev 8866)
+++ trunk/docutils/test/functional/expected/footnotes_html5.html 2021-10-26 12:42:51 UTC (rev 8867)
@@ -3,7 +3,7 @@
<head>
<meta charset="utf-8"/>
<meta name="viewport" content="width=device-width, initial-scale=1" />
-<meta name="generator" content="Docutils 0.18: http://docutils.sourceforge.net/" />
+<meta name="generator" content="Docutils 0.18.1b.dev: http://docutils.sourceforge.net/" />
<title>Test footnote and citation rendering</title>
<link rel="stylesheet" href="../input/data/minimal.css" type="text/css" />
<link rel="stylesheet" href="../input/data/responsive.css" type="text/css" />
Modified: trunk/docutils/test/functional/expected/math_output_html.html
===================================================================
--- trunk/docutils/test/functional/expected/math_output_html.html 2021-10-26 12:06:43 UTC (rev 8866)
+++ trunk/docutils/test/functional/expected/math_output_html.html 2021-10-26 12:42:51 UTC (rev 8867)
@@ -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.18: http://docutils.sourceforge.net/" />
+<meta name="generator" content="Docutils 0.18.1b.dev: http://docutils.sourceforge.net/" />
<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 2021-10-26 12:06:43 UTC (rev 8866)
+++ trunk/docutils/test/functional/expected/math_output_latex.html 2021-10-26 12:42:51 UTC (rev 8867)
@@ -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.18: http://docutils.sourceforge.net/" />
+<meta name="generator" content="Docutils 0.18.1b.dev: http://docutils.sourceforge.net/" />
<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 2021-10-26 12:06:43 UTC (rev 8866)
+++ trunk/docutils/test/functional/expected/math_output_mathjax.html 2021-10-26 12:42:51 UTC (rev 8867)
@@ -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.18: http://docutils.sourceforge.net/" />
+<meta name="generator" content="Docutils 0.18.1b.dev: http://docutils.sourceforge.net/" />
<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 2021-10-26 12:06:43 UTC (rev 8866)
+++ trunk/docutils/test/functional/expected/math_output_mathml.html 2021-10-26 12:42:51 UTC (rev 8867)
@@ -3,7 +3,7 @@
<head>
<meta charset="utf-8"/>
<meta name="viewport" content="width=device-width, initial-scale=1" />
-<meta name="generator" content="Docutils 0.18: http://docutils.sourceforge.net/" />
+<meta name="generator" content="Docutils 0.18.1b.dev: http://docutils.sourceforge.net/" />
<title>Mathematics</title>
<link rel="stylesheet" href="../input/data/minimal.css" type="text/css" />
<link rel="stylesheet" href="../input/data/plain.css" type="text/css" />
Modified: trunk/docutils/test/functional/expected/misc_rst_html4css1.html
===================================================================
--- trunk/docutils/test/functional/expected/misc_rst_html4css1.html 2021-10-26 12:06:43 UTC (rev 8866)
+++ trunk/docutils/test/functional/expected/misc_rst_html4css1.html 2021-10-26 12:42:51 UTC (rev 8867)
@@ -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.18: http://docutils.sourceforge.net/" />
+<meta name="generator" content="Docutils 0.18.1b.dev: http://docutils.sourceforge.net/" />
<title>Additional tests with html4css1</title>
<link rel="stylesheet" href="foo&bar.css" type="text/css" />
<link rel="stylesheet" href="functional/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 2021-10-26 12:06:43 UTC (rev 8866)
+++ trunk/docutils/test/functional/expected/misc_rst_html5.html 2021-10-26 12:42:51 UTC (rev 8867)
@@ -3,7 +3,7 @@
<head>
<meta charset="utf-8"/>
<meta name="viewport" content="width=device-width, initial-scale=1" />
-<meta name="generator" content="Docutils 0.18: http://docutils.sourceforge.net/" />
+<meta name="generator" content="Docutils 0.18.1b.dev: http://docutils.sourceforge.net/" />
<title>Additional tests with HTML 5</title>
<link rel="stylesheet" href="../input/data/minimal.css" type="text/css" />
<link rel="stylesheet" href="../input/data/responsive.css" type="text/css" />
Modified: trunk/docutils/test/functional/expected/pep_html.html
===================================================================
--- trunk/docutils/test/functional/expected/pep_html.html 2021-10-26 12:06:43 UTC (rev 8866)
+++ trunk/docutils/test/functional/expected/pep_html.html 2021-10-26 12:42:51 UTC (rev 8867)
@@ -8,7 +8,7 @@
-->
<head>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
- <meta name="generator" content="Docutils 0.18: http://docutils.sourceforge.net/" />
+ <meta name="generator" content="Docutils 0.18.1b.dev: http://docutils.sourceforge.net/" />
<title>PEP 100 -- Test PEP</title>
<link rel="stylesheet" href="../input/data/html4css1.css" type="text/css" />
</head>
Modified: trunk/docutils/test/functional/expected/standalone_rst_docutils_xml.xml
===================================================================
--- trunk/docutils/test/functional/expected/standalone_rst_docutils_xml.xml 2021-10-26 12:06:43 UTC (rev 8866)
+++ trunk/docutils/test/functional/expected/standalone_rst_docutils_xml.xml 2021-10-26 12:42:51 UTC (rev 8867)
@@ -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.18 -->
+<!-- Generated by Docutils 0.18.1b.dev -->
<document ids="restructuredtext-test-document doctitle" names="restructuredtext\ test\ document doctitle" source="functional/input/standalone_rst_docutils_xml.txt" title="reStructuredText Test Document">
<title>reStructuredText Test Document</title>
<subtitle ids="examples-of-syntax-constructs subtitle" names="examples\ of\ syntax\ constructs subtitle">Examples of Syntax Constructs</subtitle>
Modified: trunk/docutils/test/functional/expected/standalone_rst_html4css1.html
===================================================================
--- trunk/docutils/test/functional/expected/standalone_rst_html4css1.html 2021-10-26 12:06:43 UTC (rev 8866)
+++ trunk/docutils/test/functional/expected/standalone_rst_html4css1.html 2021-10-26 12:42:51 UTC (rev 8867)
@@ -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.18: http://docutils.sourceforge.net/" />
+<meta name="generator" content="Docutils 0.18.1b.dev: http://docutils.sourceforge.net/" />
<title>reStructuredText Test Document</title>
<meta content="reStructuredText, test, parser" name="keywords" />
<meta content="A test document, containing at least one example of each reStructuredText construct." lang="en" name="description" />
Modified: trunk/docutils/test/functional/expected/standalone_rst_html5.html
===================================================================
--- trunk/docutils/test/functional/expected/standalone_rst_html5.html 2021-10-26 12:06:43 UTC (rev 8866)
+++ trunk/docutils/test/functional/expected/standalone_rst_html5.html 2021-10-26 12:42:51 UTC (rev 8867)
@@ -3,7 +3,7 @@
<head>
<meta charset="utf-8"/>
<meta name="viewport" content="width=device-width, initial-scale=1" />
-<meta name="generator" content="Docutils 0.18: http://docutils.sourceforge.net/" />
+<meta name="generator" content="Docutils 0.18.1b.dev: http://docutils.sourceforge.net/" />
<title>reStructuredText Test Document</title>
<meta content="reStructuredText, test, parser" name="keywords" />
<meta content="A test document, containing at least one example of each reStructuredText construct." lang="en" name="description" xml:lang="en" />
Modified: trunk/docutils/test/functional/expected/standalone_rst_s5_html_1.html
===================================================================
--- trunk/docutils/test/functional/expected/standalone_rst_s5_html_1.html 2021-10-26 12:06:43 UTC (rev 8866)
+++ trunk/docutils/test/functional/expected/standalone_rst_s5_html_1.html 2021-10-26 12:42:51 UTC (rev 8867)
@@ -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.18: http://docutils.sourceforge.net/" />
+<meta name="generator" content="Docutils 0.18.1b.dev: http://docutils.sourceforge.net/" />
<meta name="version" content="S5 1.1" />
<title>Slide Shows</title>
<meta name="author" content="David Goodger" />
Modified: trunk/docutils/test/functional/expected/standalone_rst_s5_html_2.html
===================================================================
--- trunk/docutils/test/functional/expected/standalone_rst_s5_html_2.html 2021-10-26 12:06:43 UTC (rev 8866)
+++ trunk/docutils/test/functional/expected/standalone_rst_s5_html_2.html 2021-10-26 12:42:51 UTC (rev 8867)
@@ -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.18: http://docutils.sourceforge.net/" />
+<meta name="generator" content="Docutils 0.18.1b.dev: http://docutils.sourceforge.net/" />
<meta name="version" content="S5 1.1" />
<title>Slide Shows</title>
<meta name="author" content="David Goodger" />
This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site.
|
|
From: <mi...@us...> - 2021-10-30 22:59:24
|
Revision: 8871
http://sourceforge.net/p/docutils/code/8871
Author: milde
Date: 2021-10-30 22:59:21 +0000 (Sat, 30 Oct 2021)
Log Message:
-----------
Small fixes for 0.18.1.
Modified Paths:
--------------
trunk/docutils/HISTORY.txt
trunk/docutils/RELEASE-NOTES.txt
trunk/docutils/docutils/writers/_html_base.py
trunk/docutils/docutils/writers/html5_polyglot/math.css
trunk/docutils/test/test_writers/test_html5_polyglot_parts.py
Modified: trunk/docutils/HISTORY.txt
===================================================================
--- trunk/docutils/HISTORY.txt 2021-10-29 09:39:37 UTC (rev 8870)
+++ trunk/docutils/HISTORY.txt 2021-10-30 22:59:21 UTC (rev 8871)
@@ -14,8 +14,14 @@
Changes Since 0.18
==================
-.
+* docutils/writers/_html_base.py
+ - fixed handling of ``footnote_backlinks==False`` (report Alan G Isaac).
+
+* docutils/writers/html5_polyglot/math.css
+
+ - fixed typo (bug #432).
+
Release 0.18 (2021-10-26)
=========================
Modified: trunk/docutils/RELEASE-NOTES.txt
===================================================================
--- trunk/docutils/RELEASE-NOTES.txt 2021-10-29 09:39:37 UTC (rev 8870)
+++ trunk/docutils/RELEASE-NOTES.txt 2021-10-30 22:59:21 UTC (rev 8871)
@@ -153,6 +153,10 @@
* Removed files:
``iepngfix.htc`` and ``blank.gif`` (IE 6 workaround for `s5_html`).
+* Removed sub-module:
+ ``parsers.rst.directives.html``
+ (Meta directive moved to ``parsers.rst.directives.misc``.)
+
* Removed function: ``utils.unique_combinations``
(obsoleted by ``itertools.combinations``).
Modified: trunk/docutils/docutils/writers/_html_base.py
===================================================================
--- trunk/docutils/docutils/writers/_html_base.py 2021-10-29 09:39:37 UTC (rev 8870)
+++ trunk/docutils/docutils/writers/_html_base.py 2021-10-30 22:59:21 UTC (rev 8871)
@@ -1101,7 +1101,9 @@
' href="#%s">' % backrefs[0])
def depart_label(self, node):
- backrefs = node.parent.get('backrefs', [])
+ backrefs = []
+ if self.settings.footnote_backlinks:
+ backrefs = node.parent.get('backrefs', backrefs)
if len(backrefs) == 1:
self.body.append('</a>')
self.body.append('<span class="fn-bracket">]</span></span>\n')
Modified: trunk/docutils/docutils/writers/html5_polyglot/math.css
===================================================================
--- trunk/docutils/docutils/writers/html5_polyglot/math.css 2021-10-29 09:39:37 UTC (rev 8870)
+++ trunk/docutils/docutils/writers/html5_polyglot/math.css 2021-10-30 22:59:21 UTC (rev 8871)
@@ -312,7 +312,7 @@
font-variant: small-caps;
}
span.textsl {
- font-style: obligue;
+ font-style: oblique;
}
/* Colors */
Modified: trunk/docutils/test/test_writers/test_html5_polyglot_parts.py
===================================================================
--- trunk/docutils/test/test_writers/test_html5_polyglot_parts.py 2021-10-29 09:39:37 UTC (rev 8870)
+++ trunk/docutils/test/test_writers/test_html5_polyglot_parts.py 2021-10-30 22:59:21 UTC (rev 8871)
@@ -657,6 +657,71 @@
"""],
])
+
+totest['no backlinks'] = ({'footnote_backlinks': False,
+ 'stylesheet_path': '',
+ 'embed_stylesheet': 0}, [
+
+["""\
+Two footnotes [#f1]_ [#f2]_ and two citations [once]_ [twice]_.
+
+The latter are referenced a second time [#f2]_ [twice]_.
+
+.. [#f1] referenced once
+.. [#f2] referenced twice
+.. [once] citation referenced once
+.. [twice] citation referenced twice
+""",
+"""\
+{'fragment': '''\
+<p>Two footnotes <a class="footnote-reference brackets" href="#f1" id="footnote-reference-1" role="doc-noteref"><span class="fn-bracket">[</span>1<span class="fn-bracket">]</span></a> <a class="footnote-reference brackets" href="#f2" id="footnote-reference-2" role="doc-noteref"><span class="fn-bracket">[</span>2<span class="fn-bracket">]</span></a> and two citations <a class="citation-reference" href="#once" id="citation-reference-1" role="doc-biblioref">[once]</a> <a class="citation-reference" href="#twice" id="citation-reference-2" role="doc-biblioref">[twice]</a>.</p>
+<p>The latter are referenced a second time <a class="footnote-reference brackets" href="#f2" id="footnote-reference-3" role="doc-noteref"><span class="fn-bracket">[</span>2<span class="fn-bracket">]</span></a> <a class="citation-reference" href="#twice" id="citation-reference-3" role="doc-biblioref">[twice]</a>.</p>
+<aside class="footnote brackets" id="f1" role="note">
+<span class="label"><span class="fn-bracket">[</span>1<span class="fn-bracket">]</span></span>
+<p>referenced once</p>
+</aside>
+<aside class="footnote brackets" id="f2" role="note">
+<span class="label"><span class="fn-bracket">[</span>2<span class="fn-bracket">]</span></span>
+<p>referenced twice</p>
+</aside>
+<div role="list" class="citation-list">
+<div class="citation" id="once" role="doc-biblioentry">
+<span class="label"><span class="fn-bracket">[</span>once<span class="fn-bracket">]</span></span>
+<p>citation referenced once</p>
+</div>
+<div class="citation" id="twice" role="doc-biblioentry">
+<span class="label"><span class="fn-bracket">[</span>twice<span class="fn-bracket">]</span></span>
+<p>citation referenced twice</p>
+</div>
+</div>\\n''',
+ 'html_body': '''\
+<main>
+<p>Two footnotes <a class="footnote-reference brackets" href="#f1" id="footnote-reference-1" role="doc-noteref"><span class="fn-bracket">[</span>1<span class="fn-bracket">]</span></a> <a class="footnote-reference brackets" href="#f2" id="footnote-reference-2" role="doc-noteref"><span class="fn-bracket">[</span>2<span class="fn-bracket">]</span></a> and two citations <a class="citation-reference" href="#once" id="citation-reference-1" role="doc-biblioref">[once]</a> <a class="citation-reference" href="#twice" id="citation-reference-2" role="doc-biblioref">[twice]</a>.</p>
+<p>The latter are referenced a second time <a class="footnote-reference brackets" href="#f2" id="footnote-reference-3" role="doc-noteref"><span class="fn-bracket">[</span>2<span class="fn-bracket">]</span></a> <a class="citation-reference" href="#twice" id="citation-reference-3" role="doc-biblioref">[twice]</a>.</p>
+<aside class="footnote brackets" id="f1" role="note">
+<span class="label"><span class="fn-bracket">[</span>1<span class="fn-bracket">]</span></span>
+<p>referenced once</p>
+</aside>
+<aside class="footnote brackets" id="f2" role="note">
+<span class="label"><span class="fn-bracket">[</span>2<span class="fn-bracket">]</span></span>
+<p>referenced twice</p>
+</aside>
+<div role="list" class="citation-list">
+<div class="citation" id="once" role="doc-biblioentry">
+<span class="label"><span class="fn-bracket">[</span>once<span class="fn-bracket">]</span></span>
+<p>citation referenced once</p>
+</div>
+<div class="citation" id="twice" role="doc-biblioentry">
+<span class="label"><span class="fn-bracket">[</span>twice<span class="fn-bracket">]</span></span>
+<p>citation referenced twice</p>
+</div>
+</div>
+</main>\\n''',
+ 'html_head': '''...<title><string></title>\\n'''}
+"""],
+])
+
+
if __name__ == '__main__':
import unittest
unittest.main(defaultTest='suite')
This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site.
|
|
From: <mi...@us...> - 2021-11-01 21:50:45
|
Revision: 8874
http://sourceforge.net/p/docutils/code/8874
Author: milde
Date: 2021-11-01 21:50:42 +0000 (Mon, 01 Nov 2021)
Log Message:
-----------
Documentation update/additions.
Remove implemented TODO item.
Add entry for rst2man.py tool.
Modified Paths:
--------------
trunk/docutils/HISTORY.txt
trunk/docutils/docs/dev/todo.txt
trunk/docutils/docs/user/tools.txt
Modified: trunk/docutils/HISTORY.txt
===================================================================
--- trunk/docutils/HISTORY.txt 2021-11-01 21:50:32 UTC (rev 8873)
+++ trunk/docutils/HISTORY.txt 2021-11-01 21:50:42 UTC (rev 8874)
@@ -16,11 +16,11 @@
* docutils/writers/_html_base.py
- - fixed handling of ``footnote_backlinks==False`` (report Alan G Isaac).
+ - Fix handling of ``footnote_backlinks==False`` (report Alan G Isaac).
* docutils/writers/html5_polyglot/math.css
- - fixed typo (bug #432).
+ - Fix typo (bug #432).
Release 0.18 (2021-10-26)
=========================
Modified: trunk/docutils/docs/dev/todo.txt
===================================================================
--- trunk/docutils/docs/dev/todo.txt 2021-11-01 21:50:32 UTC (rev 8873)
+++ trunk/docutils/docs/dev/todo.txt 2021-11-01 21:50:42 UTC (rev 8874)
@@ -68,6 +68,39 @@
.. _Sphinx: http://sphinx.pocoo.org/
+Repository
+==========
+
+Move to a Git repository.
+
+* This is a long standing `feature request`__
+ (with pointers to Sphinx issues and discussion).
+
+ __ https://sourceforge.net/p/docutils/feature-requests/58/
+
+* From a `post by David Goodger`__
+
+ An absolute requirement, for me, is that such a change be complete.
+ We can't lose any data or have to refer to the old system as an
+ "archive". So all the SVN history, all branches, and the full sandbox
+ need to be converted at the same time.
+
+ __ https://sourceforge.net/p/docutils/mailman/message/31878077/
+
+Convert with reposurgeon_?
+
+ If you are doing a full import rather than gatewaying, reposurgeon is
+ probably what you want. It has been tested against a lot of large, old,
+ nasty repositories and is thus known to be robust in the presence of
+ repository malformations (a property regularly checked by a test suite
+ that is a rogue's gallery of Subversion botches).
+
+ -- `Git Wiki`__
+
+.. _reposurgeon: http://www.catb.org/esr/reposurgeon/
+__ https://git.wiki.kernel.org/index.php/
+ Interfaces,_frontends,_and_tools#Subversion
+
General
=======
@@ -2269,22 +2302,6 @@
HTML Writer
===========
-* Make it easier to find out fragment names (#foo-bar) of ``_`inline
- targets```. Currently you have to either look at the source or
- guess the fragment.
-
- For example, we could add support for self-referencing targets
- (i.e. inline targets would [unobtrusively] link to themselves, so
- that you can just click them and then copy the address). Or we
- could add support for titles that display the fragment name (as in
- <http://subversion.tigris.org/mailing-list-guidelines.html>; just
- hover the paragraphs).
-
- Either way it should be optional and deactivated by default.
-
- This would be useful for documents like Docutils' bug list or to-do
- list.
-
* Make the _`list compacting` logic more generic: For example, allow
for literal blocks or line blocks inside of compact list items.
Modified: trunk/docutils/docs/user/tools.txt
===================================================================
--- trunk/docutils/docs/user/tools.txt 2021-11-01 21:50:32 UTC (rev 8873)
+++ trunk/docutils/docs/user/tools.txt 2021-11-01 21:50:42 UTC (rev 8874)
@@ -46,6 +46,9 @@
First, try the "``--help``" option each front-end tool has.
+Command line options and their corresponding configuration file entries
+are detailed in `Docutils Configuration`_.
+
Users who have questions or need assistance with Docutils or
reStructuredText should post a message to the Docutils-users_ mailing
list.
@@ -65,13 +68,22 @@
:Readers: Standalone, PEP
:Parser: reStructuredText, Markdown (reCommonMark)
-:Writers: html_, html4css1_, html5_, pep_html_, s5_html_,
- latex__, xelatex_, xml_, odt_, Pseudo-XML_
+:Writers: html_, html4css1_, html5_, latex__, manpage_,
+ odt_, pep_html_, pseudo-xml_, s5_html_, xelatex_, xml_,
+The ``docutils-cli.py`` front allows combining reader, parser, and
+writer components.
+
+For example, to process a Markdown_ file "``test.md``" into
+Pseudo-XML_ ::
+
+ docutils_.py --parser=markdown --writer=pseudoxml test.md test.txt
+
__ `Generating LaTeX with Docutils`_
.. _Generating LaTeX with Docutils: latex.html
+.. _manpage: manpage.html
+.. _Markdown: https://www.markdownguide.org/
-
HTML-Generating Tools
=====================
@@ -111,7 +123,9 @@
automatically). Command-line options may be used to override config
file settings or replace them altogether.
+.. _configuration file: configuration files
+
rst2html.py
-----------
@@ -371,22 +385,20 @@
.. _LuaTeX: https://en.wikipedia.org/wiki/LuaTeX
-XML-Generating Tools
-====================
+Man-Page-Generating Tools
+=========================
-rst2xml.py
+rst2man.py
----------
:Reader: Standalone
:Parser: reStructuredText
-:Writer: _`XML` (Docutils native)
+:Writer: manpage_
-The ``rst2xml.py`` front end produces Docutils-native XML output.
-This can be transformed with standard XML tools such as XSLT
-processors into arbitrary final forms. An example is the xml2rst_ processor
-in the Docutils sandbox.
+The ``rst2man.py`` front end reads standalone reStructuredText source
+files and produces troff_ sources for Unix man pages.
-.. _xml2rst: ../../../sandbox/xml2rst
+.. _troff: https://troff.org/
ODF/OpenOffice-Generating Tools
@@ -411,6 +423,7 @@
.. _Odt Writer for Docutils:
.. _odt: odt.html
+
reStructuredText-Generating Tools
=================================
@@ -421,6 +434,24 @@
the XML (Docutils native) writer and the xml2rst_ processor.
+XML-Generating Tools
+====================
+
+rst2xml.py
+----------
+
+:Reader: Standalone
+:Parser: reStructuredText
+:Writer: _`XML` (Docutils native)
+
+The ``rst2xml.py`` front end produces Docutils-native XML output.
+This can be transformed with standard XML tools such as XSLT
+processors into arbitrary final forms. An example is the xml2rst_ processor
+in the Docutils sandbox.
+
+.. _xml2rst: ../../../sandbox/xml2rst
+
+
Testing/Debugging Tools
=======================
@@ -458,7 +489,6 @@
- Raw native XML (with or without a stylesheet reference)
-
---------------
Customization
---------------
@@ -470,11 +500,9 @@
They take priority over configuration file settings.
Use the "--help" option on each of the front ends to list the
-command-line options it supports.
+command-line options it supports.
-.. _configuration file:
-
Configuration Files
===================
@@ -482,9 +510,9 @@
set once and take effect every time you use a front-end tool.
Command-line options and their corresponding configuration file entry
-names are listed in the `Docutils Configuration Files`_ document.
+names are listed in the `Docutils Configuration`_ document.
-.. _Docutils Configuration Files: config.html
+.. _Docutils Configuration: config.html
..
This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site.
|
|
From: <mi...@us...> - 2021-11-05 11:10:58
|
Revision: 8879
http://sourceforge.net/p/docutils/code/8879
Author: milde
Date: 2021-11-05 11:10:55 +0000 (Fri, 05 Nov 2021)
Log Message:
-----------
Deprecation warning updates.
- Make `frontend.ConfigDeprecationWarning` a subclass of `FutureWarning`
as it is also intended for end users.
https://docs.python.org/3/library/warnings.html#warning-categories
- Update deprecation warning tests.
Modified Paths:
--------------
trunk/docutils/RELEASE-NOTES.txt
trunk/docutils/docutils/frontend.py
trunk/docutils/test/test_io.py
trunk/docutils/test/test_settings.py
Modified: trunk/docutils/RELEASE-NOTES.txt
===================================================================
--- trunk/docutils/RELEASE-NOTES.txt 2021-11-05 11:10:44 UTC (rev 8878)
+++ trunk/docutils/RELEASE-NOTES.txt 2021-11-05 11:10:55 UTC (rev 8879)
@@ -22,6 +22,8 @@
Drop support for Python 2.7, 3.5, and 3.6.
+Drop support for `old-format configuration files`_.
+
* `html5` writer:
- Stop setting the "footnote-reference" class value for footnote
@@ -71,9 +73,12 @@
* Remove the "html_writer" option of the ``buildhtml.py`` application
(obsoleted by "writer__").
+ __ docs/user/config.html#writer
+
+.. _old-format configuration files:
+ docs/user/config.html#old-format-configuration-files
.. _rst2html.py: docs/user/tools.html#rst2html-py
.. _reference name: docs/ref/rst/restructuredtext.html#reference-names
-__ docs/user/config.html#writer
.. _literal_block_env: docs/user/config.html#literal-block-env
.. _use_latex_citations: docs/user/config.html#use-latex-citations
Modified: trunk/docutils/docutils/frontend.py
===================================================================
--- trunk/docutils/docutils/frontend.py 2021-11-05 11:10:44 UTC (rev 8878)
+++ trunk/docutils/docutils/frontend.py 2021-11-05 11:10:55 UTC (rev 8879)
@@ -866,5 +866,5 @@
return section_dict
-class ConfigDeprecationWarning(DeprecationWarning):
+class ConfigDeprecationWarning(FutureWarning):
"""Warning for deprecated configuration file features."""
Modified: trunk/docutils/test/test_io.py
===================================================================
--- trunk/docutils/test/test_io.py 2021-11-05 11:10:44 UTC (rev 8878)
+++ trunk/docutils/test/test_io.py 2021-11-05 11:10:55 UTC (rev 8879)
@@ -133,25 +133,7 @@
# raise AssertionError if data is not an unicode string
self.assertRaises(AssertionError, uniinput.decode, b'ja')
- def test_deprecation_warning(self):
- # Test deprecation warning of 'U' universal newlines mode.
- # TODO remove with 3.4 support end
- # Arrange
- import warnings
- with warnings.catch_warnings(record=True) as w:
- # Cause all warnings to always be triggered
- warnings.simplefilter("always", DeprecationWarning)
-
- # Act
- # Trigger a warning?
- io.FileInput(source_path='data/include.txt').close()
-
- # Assert
- self.assertEqual(len(w), 0, "Expected no warnings, got %s" %
- list(v.category for v in w))
-
-
class OutputTests(unittest.TestCase):
bdata = b'\xfc'
Modified: trunk/docutils/test/test_settings.py
===================================================================
--- trunk/docutils/test/test_settings.py 2021-11-05 11:10:44 UTC (rev 8878)
+++ trunk/docutils/test/test_settings.py 2021-11-05 11:10:55 UTC (rev 8879)
@@ -22,10 +22,6 @@
from docutils.parsers import rst
-warnings.filterwarnings(action='ignore',
- category=frontend.ConfigDeprecationWarning)
-
-
def fixpath(path):
return os.path.abspath(os.path.join(*(path.split('/'))))
@@ -85,6 +81,8 @@
"""Comparison method shared by all tests."""
def setUp(self):
+ warnings.filterwarnings(action='ignore',
+ category=frontend.ConfigDeprecationWarning)
self.option_parser = frontend.OptionParser(
components=(pep_html.Writer, rst.Parser), read_config_files=None)
@@ -123,8 +121,12 @@
self.expected_settings())
def test_old(self):
- self.compare_output(self.files_settings('old'),
- self.expected_settings('old'))
+ with warnings.catch_warnings(record=True) as wng:
+ warnings.simplefilter("always") # check also for deprecation warning
+ self.compare_output(self.files_settings('old'),
+ self.expected_settings('old'))
+ self.assertEqual(len(wng), 1, "Expected a FutureWarning.")
+ assert issubclass(wng[-1].category, FutureWarning)
def test_one(self):
self.compare_output(self.files_settings('one'),
@@ -283,6 +285,13 @@
frontend.validate_smartquotes_locales(None, t[0], None),
t[1])
+ def test_set_conditions_deprecation_warning(self):
+ reporter = utils.Reporter('test', 1, 4)
+ with warnings.catch_warnings(record=True) as wng:
+ warnings.simplefilter("always")
+ reporter.set_conditions('foo', 1, 4) # trigger warning
+ self.assertEqual(len(wng), 1, "Expected a DeprecationWarning.")
+ assert issubclass(wng[-1].category, DeprecationWarning)
if __name__ == '__main__':
This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site.
|
|
From: <mi...@us...> - 2021-11-09 23:54:57
|
Revision: 8883
http://sourceforge.net/p/docutils/code/8883
Author: milde
Date: 2021-11-09 23:54:54 +0000 (Tue, 09 Nov 2021)
Log Message:
-----------
Document image formats, small documentation fixes and updates.
Modified Paths:
--------------
trunk/docutils/HISTORY.txt
trunk/docutils/docs/index.txt
trunk/docutils/docs/ref/rst/directives.txt
trunk/docutils/docs/user/config.txt
trunk/docutils/docutils/parsers/recommonmark_wrapper.py
trunk/docutils/docutils/utils/math/tex2mathml_extern.py
Modified: trunk/docutils/HISTORY.txt
===================================================================
--- trunk/docutils/HISTORY.txt 2021-11-09 23:54:42 UTC (rev 8882)
+++ trunk/docutils/HISTORY.txt 2021-11-09 23:54:54 UTC (rev 8883)
@@ -33,7 +33,7 @@
* docutils/parsers/recommonmark_wrapper.py
- Test and update to work with recommonmark version 0.6.0.
- Still experimental.
+ Still provisional.
Unfortunately, recommonmark_ is `no longer maintained`__.
@@ -62,7 +62,7 @@
- Read settings from standard configuration files.
-Fix spelling errors in documentation and docstrings.
+Fix spelling errors in documentation and docstrings.
Thanks to Dimitri Papadopoulos.
Modified: trunk/docutils/docs/index.txt
===================================================================
--- trunk/docutils/docs/index.txt 2021-11-09 23:54:42 UTC (rev 8882)
+++ trunk/docutils/docs/index.txt 2021-11-09 23:54:54 UTC (rev 8883)
@@ -221,7 +221,7 @@
* `Docutils Testing <dev/testing.html>`__
* `Docstring Semantics <dev/semantics.html>`__ (incomplete)
* `Python Source Reader <dev/pysource.html>`_ (incomplete)
-* `Docutils Python DTD <dev/pysource.dtd>`_ (experimental)
+* `Docutils Python DTD <dev/pysource.dtd>`_
* `Plan for Enthought API Documentation Tool <dev/enthought-plan.html>`_
* `Enthought API Documentation Tool RFP <dev/enthought-rfp.html>`_
Modified: trunk/docutils/docs/ref/rst/directives.txt
===================================================================
--- trunk/docutils/docs/ref/rst/directives.txt 2021-11-09 23:54:42 UTC (rev 8882)
+++ trunk/docutils/docs/ref/rst/directives.txt 2021-11-09 23:54:54 UTC (rev 8883)
@@ -164,7 +164,40 @@
There are two image directives: "image" and "figure".
+It is up to the author to ensure compatibility of the image data format
+with the output format or user agent (LaTeX__ engine, `HTML browser`__,
+ODT, ...). The following, non exhaustive table provides an overview
+========== ====== ====== ===== ===== ===== ===== ===== ===== ===== =====
+.. vector image raster image moving image [#]_
+---------- ------------- ----------------------------- -----------------
+.. SVG PDF PNG JPG GIF APNG AVIF WebM MP4 OGG
+========== ====== ====== ===== ===== ===== ===== ===== ===== ===== =====
+HTML4 ✓ [#]_ ✓ ✓ ✓ (✓) (✓)
+
+HTML5 ✓ ✓ ✓ ✓ ✓ ✓ ✓ ✓ ✓
+
+LaTeX [#]_ ✓ ✓ ✓
+
+ODT ✓ ✓ ✓ ✓ ✓
+========== ====== ====== ===== ===== ===== ===== ===== ===== ===== =====
+
+.. [#] The html5 writer uses the ``<video>`` tag if the image URI points
+ to a file with an extension matching one of the listed video formats
+ (since Docutils 0.17).
+
+.. [#] The html4 writer uses an ``<object>`` tag for SVG images for better
+ compatibility with older browsers.
+
+.. [#] When compiling with ``pdflatex``, ``xelatex``, or ``lualatex``.
+ The original ``latex`` engine supports only the EPS image format.
+ Some build systems, e.g. rubber_ support additional formats via
+ on-the-fly image conversion.
+
+__ ../../user/latex.html#image-inclusion
+__ https://developer.mozilla.org/en-US/docs/Web/Media/Formats/Image_types
+.. _rubber: https://github.com/petrhosek/rubber
+
Image
=====
@@ -222,7 +255,7 @@
no scaling.
If no "height" or "width" options are specified, the `Python
- Imaging Library`_ (PIL/Pillow_) may be used to determine them, if
+ Imaging Library` (PIL/Pillow_) may be used to determine them, if
it is installed and the image file is available.
``align`` : "top", "middle", "bottom", "left", "center", or "right"
@@ -329,7 +362,6 @@
class_ directive below.
.. _Python Imaging Library:
- https://en.wikipedia.org/wiki/Python_Imaging_Library
.. _Pillow: https://pypi.org/project/Pillow/
@@ -768,7 +800,7 @@
Sets the width of the table to the specified length or percentage
of the line width. If omitted, the renderer determines the width
of the table based on its contents or the column ``widths``.
-
+
.. _column-widths:
``widths`` : "auto", "grid", or a list of integers
@@ -953,7 +985,7 @@
``align`` : "left", "center", or "right"
The horizontal alignment of the table.
(New in Docutils 0.13)
-
+
``header-rows`` : integer
The number of rows of list data to use in the table header.
Defaults to 0.
@@ -968,7 +1000,7 @@
Sets the width of the table to the specified length or percentage
of the line width. If omitted, the renderer determines the width
of the table based on its contents or the column ``widths``.
-
+
.. _column widths:
``widths`` : integer [integer...] or "auto"
@@ -1040,7 +1072,7 @@
``backlinks`` : "entry" or "top" or "none"
Generate links from section headers back to the table of contents
- entries, the table of contents itself, or generate no backlinks.
+ entries, the table of contents itself, or generate no back-links.
``class`` : text
Set a `"classes"`_ attribute value on the topic element. See the
Modified: trunk/docutils/docs/user/config.txt
===================================================================
--- trunk/docutils/docs/user/config.txt 2021-11-09 23:54:42 UTC (rev 8882)
+++ trunk/docutils/docs/user/config.txt 2021-11-09 23:54:54 UTC (rev 8883)
@@ -717,7 +717,7 @@
smart_quotes
~~~~~~~~~~~~
-Activate the experimental SmartQuotes_ transform to
+Activate the SmartQuotes_ transform to
change straight quotation marks to typographic form. `Quote characters`_
are selected according to the language of the current block element (see
language_code_, smartquotes_locales_, and the `pre-defined quote sets`__).
Modified: trunk/docutils/docutils/parsers/recommonmark_wrapper.py
===================================================================
--- trunk/docutils/docutils/parsers/recommonmark_wrapper.py 2021-11-09 23:54:42 UTC (rev 8882)
+++ trunk/docutils/docutils/parsers/recommonmark_wrapper.py 2021-11-09 23:54:54 UTC (rev 8883)
@@ -16,6 +16,9 @@
A parser for CommonMark MarkDown text using `recommonmark`__.
__ https://pypi.org/project/recommonmark/
+
+This module is provisional:
+the API is not settled and may change with any minor Docutils version.
"""
import docutils.parsers
@@ -46,8 +49,11 @@
if CommonMarkParser:
class Parser(CommonMarkParser):
- """MarkDown parser based on recommonmark."""
+ """MarkDown parser based on recommonmark.
+ This parser is provisional:
+ the API is not settled and may change with any minor Docutils version.
+ """
supported = ('recommonmark', 'commonmark', 'markdown', 'md')
config_section = 'recommonmark parser'
config_section_dependencies = ('parsers',)
Modified: trunk/docutils/docutils/utils/math/tex2mathml_extern.py
===================================================================
--- trunk/docutils/docutils/utils/math/tex2mathml_extern.py 2021-11-09 23:54:42 UTC (rev 8882)
+++ trunk/docutils/docutils/utils/math/tex2mathml_extern.py 2021-11-09 23:54:54 UTC (rev 8883)
@@ -12,9 +12,12 @@
#
# .. _2-Clause BSD license: https://opensource.org/licenses/BSD-2-Clause
-# Wrappers for TeX->MathML conversion by external tools
-# =====================================================
+"""Wrappers for TeX->MathML conversion by external tools
+This module is provisional:
+the API is not settled and may change with any minor Docutils version.
+"""
+
from __future__ import print_function
import subprocess
This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site.
|
|
From: <mi...@us...> - 2021-11-11 16:29:19
|
Revision: 8885
http://sourceforge.net/p/docutils/code/8885
Author: milde
Date: 2021-11-11 16:29:16 +0000 (Thu, 11 Nov 2021)
Log Message:
-----------
Node.traverse() returns a list again to restore backwards compatibility.
Although the documented API only promised an "iterable" as return
value, the implementation returned a list.
Because Sphinx < 4.0.0 relies on this and Sphinx < 3.5.4 places no upper
limit to the Docutils dependency, this led to many errors "in the wild".
Fixes bug #431.
New method Node.findall(): like Node.traverse() but returns an iterator.
Modified Paths:
--------------
trunk/docutils/HISTORY.txt
trunk/docutils/RELEASE-NOTES.txt
trunk/docutils/docutils/nodes.py
trunk/docutils/docutils/parsers/recommonmark_wrapper.py
trunk/docutils/docutils/parsers/rst/states.py
trunk/docutils/docutils/transforms/frontmatter.py
trunk/docutils/docutils/transforms/misc.py
trunk/docutils/docutils/transforms/references.py
trunk/docutils/docutils/transforms/universal.py
trunk/docutils/docutils/transforms/writer_aux.py
Modified: trunk/docutils/HISTORY.txt
===================================================================
--- trunk/docutils/HISTORY.txt 2021-11-09 23:55:06 UTC (rev 8884)
+++ trunk/docutils/HISTORY.txt 2021-11-11 16:29:16 UTC (rev 8885)
@@ -14,6 +14,13 @@
Changes Since 0.18
==================
+* docutils/nodes.py
+
+ - Node.traverse() returns a list again to restore backwards
+ compatibility. Fixes bug #431.
+
+ - New method Node.findall(): like Node.traverse() but returns an iterator.
+
* docutils/writers/_html_base.py
- Fix handling of ``footnote_backlinks==False`` (report Alan G Isaac).
@@ -84,7 +91,7 @@
- document.make_id(): Do not strip leading number and hyphen characters
from `name` if the id_prefix setting is non-empty.
- - ``Node.traverse()`` returns an iterator instead of a list.
+ - Node.traverse() returns an iterator instead of a list.
* docutils/parsers/rst/directives/html.py
@@ -460,9 +467,9 @@
- Docutils now supports Python 2.7 and Python 3.5+ natively
(without conversion by ``2to3``).
- Keep `backslash escapes`__ in the document tree. Backslash characters in
- text are be represented by NULL characters in the ``text`` attribute of
+ text are be represented by NULL characters in the `text` attribute of
Doctree nodes and removed in the writing stage by the node's
- ``astext()`` method.
+ astext() method.
__ http://docutils.sourceforge.net/docs/ref/rst/restructuredtext.html#escaping-mechanism
@@ -669,7 +676,7 @@
* docutils/parsers/rst/directives/tables.py:
- - Rework patch [ 120 ] (revert change to ``Table.get_column_widths()``
+ - Rework patch [ 120 ] (revert change to Table.get_column_widths()
that led to problems in an application with a custom table directive).
* docutils/transforms/frontmatter.py:
Modified: trunk/docutils/RELEASE-NOTES.txt
===================================================================
--- trunk/docutils/RELEASE-NOTES.txt 2021-11-09 23:55:06 UTC (rev 8884)
+++ trunk/docutils/RELEASE-NOTES.txt 2021-11-11 16:29:16 UTC (rev 8885)
@@ -83,14 +83,23 @@
.. _use_latex_citations: docs/user/config.html#use-latex-citations
-Release 0.18 (2021-10-26)
-=========================
+Release 0.18.1.dev
+==================
.. Note::
Docutils 0.18.x is the last version supporting Python 2.7, 3.5, and 3.6.
+* nodes.Node.traverse() returns a list again to restore
+ backwards compatibility (fixes bug #431).
+ It is deprecated in favour of the new method nodes.Node.findall().
+* Small bugfixes (see HISTORY_).
+
+
+Release 0.18 (2021-10-26)
+=========================
+
* Output changes:
Identifiers:
@@ -159,11 +168,11 @@
``iepngfix.htc`` and ``blank.gif`` (IE 6 workaround for `s5_html`).
* Removed sub-module:
- ``parsers.rst.directives.html``
+ ``parsers.rst.directives.html``
(Meta directive moved to ``parsers.rst.directives.misc``.)
-* Removed function: ``utils.unique_combinations``
- (obsoleted by ``itertools.combinations``).
+* Removed function: utils.unique_combinations()
+ (obsoleted by itertools.combinations()).
* Removed attribute: ``HTMLTranslator.topic_classes``
(check node.parent.classes instead).
@@ -173,11 +182,11 @@
``docutils/utils/math/latex2mathml.py``
(mathematical notation in HTML, cf. `LaTeX syntax for mathematics`_).
-* ``nodes.Node.traverse()`` returns an iterator instead of a list.
+* nodes.Node.traverse() returns an iterator instead of a list.
* Various bugfixes and improvements (see HISTORY_).
- Fix spelling errors in documentation and docstrings.
+ Fix spelling errors in documentation and docstrings.
Thanks to Dimitri Papadopoulos.
__ docs/ref/doctree.html#meta
Modified: trunk/docutils/docutils/nodes.py
===================================================================
--- trunk/docutils/docutils/nodes.py 2021-11-09 23:55:06 UTC (rev 8884)
+++ trunk/docutils/docutils/nodes.py 2021-11-11 16:29:16 UTC (rev 8885)
@@ -212,40 +212,58 @@
visitor.dispatch_departure(self)
return stop
- def _fast_traverse(self, cls):
+ def _fast_findall(self, cls):
"""Return iterator that only supports instance checks."""
if isinstance(self, cls):
yield self
for child in self.children:
- for subnode in child._fast_traverse(cls):
+ for subnode in child._fast_findall(cls):
yield subnode
- def _all_traverse(self):
+ def _superfast_findall(self):
"""Return iterator that doesn't check for a condition."""
+ # This is different from ``iter(self)`` implemented via
+ # __getitem__() and __len__() in the Element subclass,
+ # which yields only the direct children.
yield self
for child in self.children:
- for subnode in child._all_traverse():
+ for subnode in child._superfast_findall():
yield subnode
def traverse(self, condition=None, include_self=True, descend=True,
siblings=False, ascend=False):
+ """Return list of nodes following `self`.
+
+ For looping, Node.findall() is faster and more memory efficient.
"""
- Return an iterator yielding
+ # traverse() may be eventually removed:
+ warnings.warn('nodes.Node.traverse() is obsoleted by Node.findall().',
+ PendingDeprecationWarning, stacklevel=2)
+ return list(self.findall(condition, include_self, descend,
+ siblings, ascend))
- * self (if include_self is true)
- * all descendants in tree traversal order (if descend is true)
- * all siblings (if siblings is true) and their descendants (if
- also descend is true)
- * the siblings of the parent (if ascend is true) and their
- descendants (if also descend is true), and so on
+ def findall(self, condition=None, include_self=True, descend=True,
+ siblings=False, ascend=False):
+ """
+ Return an iterator yielding nodes following `self`.
+ * self (if `include_self` is true)
+ * all descendants in tree traversal order (if `descend` is true)
+ * all siblings (if `siblings` is true) and their descendants (if
+ also `descend` is true)
+ * the siblings of the parent (if `ascend` is true) and their
+ descendants (if also `descend` is true), and so on
+
If `condition` is not None, the iterator yields only nodes
for which ``condition(node)`` is true. If `condition` is a
node class ``cls``, it is equivalent to a function consisting
of ``return isinstance(node, cls)``.
- If ascend is true, assume siblings to be true as well.
+ If `ascend` is true, assume `siblings` to be true as well.
+ To allow processing of the return value or modification while
+ iterating, wrap calls to findall() in a ``tuple()`` or ``list()``.
+
For example, given the following tree::
<paragraph>
@@ -256,15 +274,14 @@
<reference name="Baz" refid="baz">
Baz
- Then list(emphasis.traverse()) equals ::
+ Then tuple(emphasis.traverse()) equals ::
- [<emphasis>, <strong>, <#text: Foo>, <#text: Bar>]
+ (<emphasis>, <strong>, <#text: Foo>, <#text: Bar>)
- and list(strong.traverse(ascend=True)) equals ::
+ and list(strong.traverse(ascend=True) equals ::
[<strong>, <#text: Foo>, <#text: Bar>, <reference>, <#text: Baz>]
"""
-
if ascend:
siblings=True
# Check for special argument combinations that allow using an
@@ -271,11 +288,11 @@
# optimized version of traverse()
if include_self and descend and not siblings:
if condition is None:
- for subnode in self._all_traverse():
+ for subnode in self._superfast_findall():
yield subnode
return
elif isinstance(condition, type):
- for subnode in self._fast_traverse(condition):
+ for subnode in self._fast_findall(condition):
yield subnode
return
# Check if `condition` is a class (check for TypeType for Python
@@ -290,7 +307,7 @@
yield self
if descend and len(self.children):
for child in self:
- for subnode in child.traverse(condition=condition,
+ for subnode in child.findall(condition=condition,
include_self=True, descend=True,
siblings=False, ascend=False):
yield subnode
@@ -299,7 +316,7 @@
while node.parent:
index = node.parent.index(node)
for sibling in node.parent[index+1:]:
- for subnode in sibling.traverse(condition=condition,
+ for subnode in sibling.findall(condition=condition,
include_self=True, descend=descend,
siblings=False, ascend=False):
yield subnode
@@ -311,16 +328,15 @@
def next_node(self, condition=None, include_self=False, descend=True,
siblings=False, ascend=False):
"""
- Return the first node in the iterator returned by traverse(),
+ Return the first node in the iterator returned by findall(),
or None if the iterable is empty.
- Parameter list is the same as of traverse. Note that
- include_self defaults to False, though.
+ Parameter list is the same as of traverse. Note that `include_self`
+ defaults to False, though.
"""
- node_iterator = self.traverse(condition, include_self,
- descend, siblings, ascend)
try:
- return next(node_iterator)
+ return next(self.findall(condition, include_self,
+ descend, siblings, ascend))
except StopIteration:
return None
@@ -473,6 +489,11 @@
element[0]
+ to iterate over the child nodes (without descending), use::
+
+ for child in element:
+ ...
+
Elements may be constructed using the ``+=`` operator. To add one new
child node to element, do::
Modified: trunk/docutils/docutils/parsers/recommonmark_wrapper.py
===================================================================
--- trunk/docutils/docutils/parsers/recommonmark_wrapper.py 2021-11-09 23:55:06 UTC (rev 8884)
+++ trunk/docutils/docutils/parsers/recommonmark_wrapper.py 2021-11-11 16:29:16 UTC (rev 8885)
@@ -84,7 +84,7 @@
# ---------------
# merge adjoining Text nodes:
- for node in document.traverse(nodes.TextElement):
+ for node in document.findall(nodes.TextElement):
children = node.children
i = 0
while i+1 < len(children):
@@ -95,18 +95,18 @@
else:
i += 1
- # add "code" class argument to inline literal (code spans)
- for node in document.traverse(lambda n: isinstance(n,
+ # add "code" class argument to literal elements (inline and block)
+ for node in document.findall(lambda n: isinstance(n,
(nodes.literal, nodes.literal_block))):
node['classes'].append('code')
# move "language" argument to classes
- for node in document.traverse(nodes.literal_block):
+ for node in document.findall(nodes.literal_block):
if 'language' in node.attributes:
node['classes'].append(node['language'])
del node['language']
# remove empty target nodes
- for node in list(document.traverse(nodes.target)):
+ for node in list(document.findall(nodes.target)):
# remove empty name
node['names'] = [v for v in node['names'] if v]
if node.children or [v for v in node.attributes.values() if v]:
@@ -115,12 +115,12 @@
# replace raw nodes if raw is not allowed
if not document.settings.raw_enabled:
- for node in document.traverse(nodes.raw):
+ for node in document.findall(nodes.raw):
warning = document.reporter.warning('Raw content disabled.')
node.parent.replace(node, warning)
# fix section nodes
- for node in document.traverse(nodes.section):
+ for node in document.findall(nodes.section):
# remove spurious IDs (first may be from duplicate name)
if len(node['ids']) > 1:
node['ids'].pop()
@@ -138,7 +138,7 @@
del node['level']
# drop pending_xref (Sphinx cross reference extension)
- for node in document.traverse(addnodes.pending_xref):
+ for node in document.findall(addnodes.pending_xref):
reference = node.children[0]
if 'name' not in reference:
reference['name'] = nodes.fully_normalize_name(
Modified: trunk/docutils/docutils/parsers/rst/states.py
===================================================================
--- trunk/docutils/docutils/parsers/rst/states.py 2021-11-09 23:55:06 UTC (rev 8884)
+++ trunk/docutils/docutils/parsers/rst/states.py 2021-11-11 16:29:16 UTC (rev 8885)
@@ -2064,7 +2064,7 @@
del substitution_node[i]
else:
i += 1
- for node in substitution_node.traverse(nodes.Element):
+ for node in substitution_node.findall(nodes.Element):
if self.disallowed_inside_substitution_definitions(node):
pformat = nodes.literal_block('', node.pformat().rstrip())
msg = self.reporter.error(
Modified: trunk/docutils/docutils/transforms/frontmatter.py
===================================================================
--- trunk/docutils/docutils/transforms/frontmatter.py 2021-11-09 23:55:06 UTC (rev 8884)
+++ trunk/docutils/docutils/transforms/frontmatter.py 2021-11-11 16:29:16 UTC (rev 8885)
@@ -281,10 +281,10 @@
def apply(self):
if not self.document.settings.setdefault('sectsubtitle_xform', True):
return
- for section in self.document.traverse(nodes.section):
+ for section in self.document.findall(nodes.section):
# On our way through the node tree, we are modifying it
# but only the not-yet-visited part, so that the iterator
- # returned by traverse() is not corrupted.
+ # returned by findall() is not corrupted.
self.promote_subtitle(section)
@@ -513,7 +513,7 @@
"""
# @@ keep original formatting? (e.g. ``:authors: A. Test, *et-al*``)
text = ''.join(unicode(node)
- for node in field[1].traverse(nodes.Text))
+ for node in field[1].findall(nodes.Text))
if not text:
raise TransformError
for authorsep in self.language.author_separators:
Modified: trunk/docutils/docutils/transforms/misc.py
===================================================================
--- trunk/docutils/docutils/transforms/misc.py 2021-11-09 23:55:06 UTC (rev 8884)
+++ trunk/docutils/docutils/transforms/misc.py 2021-11-11 16:29:16 UTC (rev 8885)
@@ -94,7 +94,7 @@
default_priority = 830
def apply(self):
- for node in self.document.traverse(nodes.transition):
+ for node in self.document.findall(nodes.transition):
self.visit_transition(node)
def visit_transition(self, node):
Modified: trunk/docutils/docutils/transforms/references.py
===================================================================
--- trunk/docutils/docutils/transforms/references.py 2021-11-09 23:55:06 UTC (rev 8884)
+++ trunk/docutils/docutils/transforms/references.py 2021-11-11 16:29:16 UTC (rev 8885)
@@ -41,7 +41,7 @@
default_priority = 260
def apply(self):
- for target in self.document.traverse(nodes.target):
+ for target in self.document.findall(nodes.target):
# Only block-level targets without reference (like ".. _target:"):
if (isinstance(target.parent, nodes.TextElement) or
(target.hasattr('refid') or target.hasattr('refuri') or
@@ -118,10 +118,10 @@
def apply(self):
anonymous_refs = []
anonymous_targets = []
- for node in self.document.traverse(nodes.reference):
+ for node in self.document.findall(nodes.reference):
if node.get('anonymous'):
anonymous_refs.append(node)
- for node in self.document.traverse(nodes.target):
+ for node in self.document.findall(nodes.target):
if node.get('anonymous'):
anonymous_targets.append(node)
if len(anonymous_refs) \
@@ -354,7 +354,7 @@
default_priority = 640
def apply(self):
- for target in self.document.traverse(nodes.target):
+ for target in self.document.findall(nodes.target):
if target.hasattr('refuri'):
refuri = target['refuri']
for name in target['names']:
@@ -374,7 +374,7 @@
default_priority = 660
def apply(self):
- for target in self.document.traverse(nodes.target):
+ for target in self.document.findall(nodes.target):
if not target.hasattr('refuri') and not target.hasattr('refid'):
self.resolve_reference_ids(target)
@@ -671,7 +671,7 @@
line_length_limit = getattr(self.document.settings,
"line_length_limit", 10000)
- subreflist = list(self.document.traverse(nodes.substitution_reference))
+ subreflist = list(self.document.findall(nodes.substitution_reference))
for ref in subreflist:
msg = ''
refname = ref['refname']
@@ -714,7 +714,7 @@
subdef_copy = subdef.deepcopy()
try:
# Take care of nested substitution references:
- for nested_ref in subdef_copy.traverse(
+ for nested_ref in subdef_copy.findall(
nodes.substitution_reference):
nested_name = normed[nested_ref['refname'].lower()]
if nested_name in nested.setdefault(nested_name, []):
@@ -777,7 +777,7 @@
def apply(self):
notes = {}
nodelist = []
- for target in self.document.traverse(nodes.target):
+ for target in self.document.findall(nodes.target):
# Only external targets.
if not target.hasattr('refuri'):
continue
@@ -793,7 +793,7 @@
notes[target['refuri']] = footnote
nodelist.append(footnote)
# Take care of anonymous references.
- for ref in self.document.traverse(nodes.reference):
+ for ref in self.document.findall(nodes.reference):
if not ref.get('anonymous'):
continue
if ref.hasattr('refuri'):
@@ -856,7 +856,7 @@
self.document.walk(visitor)
# *After* resolving all references, check for unreferenced
# targets:
- for target in self.document.traverse(nodes.target):
+ for target in self.document.findall(nodes.target):
if not target.referenced:
if target.get('anonymous'):
# If we have unreferenced anonymous targets, there
Modified: trunk/docutils/docutils/transforms/universal.py
===================================================================
--- trunk/docutils/docutils/transforms/universal.py 2021-11-09 23:55:06 UTC (rev 8884)
+++ trunk/docutils/docutils/transforms/universal.py 2021-11-11 16:29:16 UTC (rev 8885)
@@ -108,7 +108,7 @@
def apply(self):
if self.document.settings.expose_internals:
- for node in self.document.traverse(self.not_Text):
+ for node in self.document.findall(self.not_Text):
for att in self.document.settings.expose_internals:
value = getattr(node, att, None)
if value is not None:
@@ -149,7 +149,7 @@
default_priority = 870
def apply(self):
- for node in tuple(self.document.traverse(nodes.system_message)):
+ for node in tuple(self.document.findall(nodes.system_message)):
if node['level'] < self.document.reporter.report_level:
node.parent.remove(node)
@@ -181,7 +181,7 @@
def apply(self):
if self.document.settings.strip_comments:
- for node in tuple(self.document.traverse(nodes.comment)):
+ for node in tuple(self.document.findall(nodes.comment)):
node.parent.remove(node)
@@ -200,14 +200,14 @@
self.strip_elements = set(
self.document.settings.strip_elements_with_classes)
# Iterate over a tuple as removing the current node
- # corrupts the iterator returned by `traverse`:
- for node in tuple(self.document.traverse(self.check_classes)):
+ # corrupts the iterator returned by `iter`:
+ for node in tuple(self.document.findall(self.check_classes)):
node.parent.remove(node)
if not self.document.settings.strip_classes:
return
strip_classes = self.document.settings.strip_classes
- for node in self.document.traverse(nodes.Element):
+ for node in self.document.findall(nodes.Element):
for class_value in strip_classes:
try:
node['classes'].remove(class_value)
@@ -282,7 +282,7 @@
# "Educate" quotes in normal text. Handle each block of text
# (TextElement node) as a unit to keep context around inline nodes:
- for node in self.document.traverse(nodes.TextElement):
+ for node in self.document.findall(nodes.TextElement):
# skip preformatted text blocks and special elements:
if isinstance(node, self.nodes_to_skip):
continue
@@ -291,7 +291,7 @@
continue
# list of text nodes in the "text block":
- txtnodes = [txtnode for txtnode in node.traverse(nodes.Text)
+ txtnodes = [txtnode for txtnode in node.findall(nodes.Text)
if not isinstance(txtnode.parent,
nodes.option_string)]
Modified: trunk/docutils/docutils/transforms/writer_aux.py
===================================================================
--- trunk/docutils/docutils/transforms/writer_aux.py 2021-11-09 23:55:06 UTC (rev 8884)
+++ trunk/docutils/docutils/transforms/writer_aux.py 2021-11-11 16:29:16 UTC (rev 8885)
@@ -38,7 +38,7 @@
default_priority = 910
def apply(self):
- for compound in self.document.traverse(nodes.compound):
+ for compound in self.document.findall(nodes.compound):
first_child = True
for child in compound:
if first_child:
@@ -75,7 +75,7 @@
def apply(self):
language = languages.get_language(self.document.settings.language_code,
self.document.reporter)
- for node in self.document.traverse(nodes.Admonition):
+ for node in self.document.findall(nodes.Admonition):
node_name = node.__class__.__name__
# Set class, so that we know what node this admonition came from.
node['classes'].append(node_name)
This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site.
|
|
From: <mi...@us...> - 2021-11-14 22:00:53
|
Revision: 8886
http://sourceforge.net/p/docutils/code/8886
Author: milde
Date: 2021-11-14 22:00:50 +0000 (Sun, 14 Nov 2021)
Log Message:
-----------
Update documentation and handling of (east-asian) wide characters.
Explain the special casing for combinging and wide characters in
section titles.
cf. bug #433
Simplify import (we don't need to care for missing
`unicodedata.east_asian_width` in Python < 2.4 any longer).
Modified Paths:
--------------
trunk/docutils/docs/ref/rst/restructuredtext.txt
trunk/docutils/docutils/statemachine.py
trunk/docutils/docutils/utils/__init__.py
trunk/docutils/test/test_parsers/test_rst/test_east_asian_text.py
Modified: trunk/docutils/docs/ref/rst/restructuredtext.txt
===================================================================
--- trunk/docutils/docs/ref/rst/restructuredtext.txt 2021-11-11 16:29:16 UTC (rev 8885)
+++ trunk/docutils/docs/ref/rst/restructuredtext.txt 2021-11-14 22:00:50 UTC (rev 8886)
@@ -495,7 +495,7 @@
matching "overlines" above the title. An underline/overline is a
single repeated punctuation character that begins in column 1 and
forms a line extending at least as far as the right edge of the title
-text. Specifically, an underline/overline character may be any
+text. [#]_ Specifically, an underline/overline character may be any
non-alphanumeric printable 7-bit ASCII character [#]_. When an
overline is used, the length and character used must match the
underline. Underline-only adornment styles are distinct from
@@ -503,6 +503,10 @@
be any number of levels of section titles, although some output
formats may have limits (HTML has 6 levels).
+.. [#] The key is the visual length of the title in a mono-spaced font.
+ The adornment may need more or less characters than title, if the
+ title contains wide__ or combining__ characters.
+
.. [#] The following are all valid section title adornment
characters::
@@ -513,6 +517,9 @@
= - ` : . ' " ~ ^ _ * + #
+__ https://en.wikipedia.org/wiki/Halfwidth_and_fullwidth_forms#In_Unicode
+__ https://en.wikipedia.org/wiki/Combining_character
+
Rather than imposing a fixed number and order of section title
adornment styles, the order enforced will be the order as encountered.
The first style encountered will be an outermost title (like HTML H1),
@@ -1020,8 +1027,8 @@
Doctree elements: option_list_, option_list_item_, option_group_, option_,
option_string_, option_argument_, description_.
-Option lists are two-column lists of command-line options and
-descriptions, documenting a program's options. For example::
+Option lists map a program's command-line options to descriptions
+documenting them. For example::
-a Output all.
-b Output both (this description is
Modified: trunk/docutils/docutils/statemachine.py
===================================================================
--- trunk/docutils/docutils/statemachine.py 2021-11-11 16:29:16 UTC (rev 8885)
+++ trunk/docutils/docutils/statemachine.py 2021-11-14 22:00:50 UTC (rev 8886)
@@ -109,7 +109,8 @@
import sys
import re
-import unicodedata
+from unicodedata import east_asian_width
+
from docutils import utils
from docutils.utils.error_reporting import ErrorOutput
@@ -1446,7 +1447,6 @@
Pad all double-width characters in self by appending `pad_char` to each.
For East Asian language support.
"""
- east_asian_width = unicodedata.east_asian_width
for i in range(len(self.data)):
line = self.data[i]
if isinstance(line, unicode):
Modified: trunk/docutils/docutils/utils/__init__.py
===================================================================
--- trunk/docutils/docutils/utils/__init__.py 2021-11-11 16:29:16 UTC (rev 8885)
+++ trunk/docutils/docutils/utils/__init__.py 2021-11-14 22:00:50 UTC (rev 8886)
@@ -641,7 +641,7 @@
Correct ``len(text)`` for wide East Asian and combining Unicode chars.
"""
if isinstance(text, str) and sys.version_info < (3, 0):
- return len(text)
+ return len(text) # shortcut for binary strings
width = sum([east_asian_widths[unicodedata.east_asian_width(c)]
for c in text])
# correction for combining chars:
Modified: trunk/docutils/test/test_parsers/test_rst/test_east_asian_text.py
===================================================================
--- trunk/docutils/test/test_parsers/test_rst/test_east_asian_text.py 2021-11-11 16:29:16 UTC (rev 8885)
+++ trunk/docutils/test/test_parsers/test_rst/test_east_asian_text.py 2021-11-14 22:00:50 UTC (rev 8886)
@@ -14,14 +14,9 @@
import __init__
from test_parsers import DocutilsTestSupport
-import unicodedata
+from unicodedata import east_asian_width
-try:
- east_asian_width = unicodedata.east_asian_width
-except AttributeError:
- east_asian_width = None
-
def suite():
s = DocutilsTestSupport.ParserTestSuite()
s.generateTests(totest)
This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site.
|