-
-
Notifications
You must be signed in to change notification settings - Fork 17
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
add autosectionlabel #63
base: main
Are you sure you want to change the base?
Conversation
Is this fully backward compatible? |
Signed-off-by: nstarman <nstarman@users.noreply.github.com>
7049fff
to
711a4a0
Compare
My bad. Meant to add this to v2, not v1. |
How do you intend to use this over at astropy? There is no test for this, so we cannot really be sure this new addition will work for all the Sphinx versions the CI claims to support. |
It would be nice not to have to write explicit link targets. In Astropy we seem to have a somewhat analogous, but ad-hoc system. E.g. labelling something
Sphinx Astropy seems not to have a large test suite... https://www.sphinx-doc.org/en/master/usage/extensions/autosectionlabel.html claims it should work for Sphinx v1.4+ |
But this method breaks if you decide to reword the section title, right? Or move pages around? The explicit way, it does not matter as long as you keep the label there. |
Yes, this method breaks if you change the section title or page arrangement, like how the explicit way breaks if the label is changed. Different things are kept constant: with explicit labels it's the label itself; with implicit labels it's the structural similarity to the topic. You can still make explicit labels if you want to. This just means you don't have to. |
Sure, but I am also not sure if I should be encouraging |
https://docs.readthedocs.io/en/stable/guides/cross-referencing-with-sphinx.html#automatically-label-sections