Update AutoNumbering transform.#14400
Open
gmilde wants to merge 5 commits intosphinx-doc:masterfrom
Open
Conversation
a) Ensure that enumerable elements (tables, figures and literal_blocks) have an ID. (In Docutils > 0.22, `nodes.document.note_implicit_target()` does not genereate an ID if `legacy_ids`_ is False.) b) Title-derived IDs for enumerable elements: "Enumerable elements" get an auto-ID in the `AutoNumbering` SphinxTransform and a self-link (¶) after the caption/title in the HTML document. Currently, the ID is made of the "auto-id-prefix" + a running number (id1, id2, ...). The generated IDs are not stable -- inserting/removing an enuerable element, footnote, or section with non-Lating heading will change the running number! Base the generated IDs on the caption or title text instead (similar to sections). To avoid changed IDs when documents are re-compiled, this only happens if `legacy_ids`_ is False. .. _legacy_ids: https://docutils.sf.net/docs/user/config.html#legacy-ids
Break long code line. Delete whitespace around `:` binary operator.
This is the style expected by flake8 but fails upstream...
Again, this differs from flake8...
Contributor
Author
|
See PR #14399 for a fix for the failing Python 3.15 tests. |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Purpose
a) Ensure that enumerable elements (tables, figures and literal_blocks)
have an ID. (In Docutils > 0.22,
nodes.document.note_implicit_target()does not genereate an ID if
legacy_ids_ is False.)b) Title-derived IDs for enumerable elements:
"Enumerable elements" get an auto-ID in the
AutoNumberingSphinxTransformand a self-link (¶) after the caption/title in the HTML document.
Currently, the ID is made of the "auto-id-prefix" + a running number
(id1, id2, ...). The generated IDs are not stable -- inserting/removing
an enuerable element, footnote, or section with non-Latin heading will
change the running number!
Base the generated IDs on the caption or title text instead (similar to
sections). To avoid changed IDs when documents are re-compiled, this
only happens if
legacy_ids_ is False.CHANGES.rst is still the 9.1.0-final version so I'll postpone this step.
References
.. _legacy_ids: https://docutils.sf.net/docs/user/config.html#legacy-ids
This is part of ongoing work in Docutils around better IDs:
https://sourceforge.net/p/docutils/bugs/207/
#8709