Repository navigation
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...
This comment was marked as outdated.
This comment was marked as outdated.
Hi @gmilde, CHANGES.rst has since been updated, can you add an entry to it? |
Fix typo and formatting issue (found by Jared Dillard). Shorten CHANGES entry (keep changes list compact, without emtpy lines). Try to solve the CI test failure with Python 3.12 and Docutils 0.21.
|
@jdillard Thank you for the feedback. |
| self.document.settings, 'legacy_ids', True | ||
| ): | ||
| # cf. https://docutils.sf.net/docs/user/config.html#legacy-ids | ||
| node['names'].append(nodes.fully_normalize_name(refname)) |
There was a problem hiding this comment.
I may be missing some context, but I reproduced a conflict with Docutils 0.23 and legacy_ids=False when a section title and table caption have the same text (Shared):
Shared
======
This reference should point to the section: `Shared`_.
.. table:: Shared
=== ===
A B
=== ===With the same Docutils settings on the current master branch, `Shared`_ resolves to the section. With the updated AutoNumbering transform, Docutils reports the following error:
ERROR: Duplicate target name, cannot be used as a unique reference: "shared".
Is this behavior expected?
There was a problem hiding this comment.
This is the expected behaviour if we want "numbered captions" to become
Implicit Hyperlink Targets (i.e. behave like section titles).
IMV, the behaviour change is acceptable as it only happens after explicit user interaction (specifying the Docutils configuration setting legacy_ids which is new in Docutils 0.23) .
If the behaviour change is not wanted at this stage, we can drop it or decouple it from the fix for Docutils >= 0.23.
How would you link to the table caption in your example text with current Sphinx?
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.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