[go: up one dir, main page]

Menu

Commit [r9967]  Maximize  Restore  History

Start reconciling "colwidth" attribute definition and use.

First, backwards compatible changes get the handling of the
`<colspec>` element's "colwidth" attribute in line with the
definition in the Exchange Table Model.

The "colwidth" attribute is defined in the "Exchange Table Model"
as either a *proportional measure* or a *fixed measure*.
Currently, Docutils supports only unitless values and interpets them
as proportional measures while the Exchange Table Model interprets
unitless values as fixed measures with default unit “pt”!

The new optional argument "unit_pattern" for `nodes.parse_measure()`
allows configuring what is recognized as a unit.

The new validation function `nodes.validate_proportional()`
for the "colwidth" attribute also accepts conformant values like
"5.2*" (for 5.2 times the "unit proportion").
For backwards compatibility reasons, the attribute is still stored
as numerical value in Python doctree element instances.

New auxiliary method `nodes.colspec.propwith()`:
returns the "colwidth" attribute as number if it is a
proportional measure.

Announce future changes in the RELEASE_NOTES

Add/modify test cases.

milde 2024-10-24

changed /trunk/docutils/RELEASE-NOTES.rst
changed /trunk/docutils/docutils/nodes.py
changed /trunk/docutils/docutils/writers/_html_base.py
changed /trunk/docutils/docutils/writers/html4css1/__init__.py
changed /trunk/docutils/docutils/writers/latex2e/__init__.py
changed /trunk/docutils/docutils/writers/odf_odt/__init__.py
changed /trunk/docutils/test/test_nodes.py
changed /trunk/docutils/test/test_parsers/test_docutils_xml/test_parse_element.py