Commit 234ac59
committed
Update AutoNumbering transform.
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-ids1 parent cc7c6f4 commit 234ac59
2 files changed
+12
-6
lines changed| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
206 | 206 | | |
207 | 207 | | |
208 | 208 | | |
209 | | - | |
210 | | - | |
211 | | - | |
212 | | - | |
213 | | - | |
| 209 | + | |
| 210 | + | |
| 211 | + | |
| 212 | + | |
| 213 | + | |
| 214 | + | |
| 215 | + | |
214 | 216 | | |
| 217 | + | |
| 218 | + | |
| 219 | + | |
| 220 | + | |
215 | 221 | | |
216 | 222 | | |
217 | 223 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
452 | 452 | | |
453 | 453 | | |
454 | 454 | | |
455 | | - | |
| 455 | + | |
456 | 456 | | |
457 | 457 | | |
458 | 458 | | |
| |||
0 commit comments