You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
Use footnotes for numbered notes in tables #137742
In a few places, the docs include tables with numbered notes, similar to this:
Cheese
In Stock
Red Leicester
no
Camembert
yes (1) (2)
(1) it's a bit runny
(2) the cat's eaten it
Often the notes are written using simple numbered lists, which notably don't create links between the note references and their definitions. This can make viewing the notes somewhat tedious, particularly when the table is very long or when the same notes are shared by multiple tables.
Another way to format these notes is using Sphinx footnotes. Footnotes have the benefit of creating bi-directional links between the note entries and their references, which makes viewing a note and then navigating back to where you were much easier. The footnote definitions can be placed anywhere in the docs, so in particular they can be placed immediately after the table that references them. This is already done for a few tables in the current docs, e.g. in collections.abc.
I propose migrating some of the existing table notes to footnotes in cases where having the extra navigation links would be helpful. In particular, I think this would be useful for the format code tables in the datetime docs.
The formatting of the footnotes and links above is a bit different than it would be in the docs. See collections.abc link above. In the note list, number is backlinks, unless there are multiple backlinks. In the latter case, the note # is followed by backlinked number, as in [1](1,2,3,4,5,6,7,8,9,10,11,12,13,14,15) These ABCs override ... in the example.
2 A slight downside given multiple tables with footnote is that footnotes are numbered 1,2,3,... throughout the whole file instead of restarting with 1 for each table. The example file does not have another table. The preview for the PR file has 3. I think people can adjust.
(My comment is specifically for the datetime case)
little identifier-like mnemonics
I don't think these are the best here. Mnemonics have a similar issue as the footnotes for the whole file, although rather than changing the numbering (which I would like to preserve) we remove it entirely. I also think it is quite hard to come up with a single word to match some of the notes. And, lastly, the format code table is already quite width constricted, and with some rows having two notes, words would take up space we don't have.
The other tables in the file are shorter than the format code one, what if we only add the footnotes for the last table (which I would assume is most-read), preserving the numbering? We could then use Petr's mnemonics idea for the shorter (and wider, as we have less columns) tables.
Activity
terryjreedy commentedon Aug 14, 2025
[1](1,2,3,4,5,6,7,8,9,10,11,12,13,14,15) These ABCs override ...in the example.2 A slight downside given multiple tables with footnote is that footnotes are numbered 1,2,3,... throughout the whole file instead of restarting with 1 for each table. The example file does not have another table. The preview for the PR file has 3. I think people can adjust.
encukou commentedon Feb 5, 2026
I wonder if we should use named notes instead, with little identifier-like mnemonics; something like:
That would certainly help me match the entries with the content when reading :)
Regular links don't have the backlinks, but I guess that's OK?
Sphinx citations render a like this, but aren't the correct element to use.
StanFromIreland commentedon Feb 6, 2026
(My comment is specifically for the datetime case)
I don't think these are the best here. Mnemonics have a similar issue as the footnotes for the whole file, although rather than changing the numbering (which I would like to preserve) we remove it entirely. I also think it is quite hard to come up with a single word to match some of the notes. And, lastly, the format code table is already quite width constricted, and with some rows having two notes, words would take up space we don't have.
The other tables in the file are shorter than the format code one, what if we only add the footnotes for the last table (which I would assume is most-read), preserving the numbering? We could then use Petr's mnemonics idea for the shorter (and wider, as we have less columns) tables.
encukou commentedon Feb 9, 2026
Other tables are two-column “operation” & “its result” tables; these might be better presented as definition lists or
.. describe::entries.