Skip to content
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

Create stable URLs to changelogs #46

Closed
maxking opened this issue Mar 14, 2022 · 2 comments · Fixed by #47
Closed

Create stable URLs to changelogs #46

maxking opened this issue Mar 14, 2022 · 2 comments · Fixed by #47

Comments

@maxking
Copy link
Contributor

maxking commented Mar 14, 2022

Currently, scriv will generate rst sections for each version like

0.13.0 — 2022-01-23
-------------------

^ for an example from Scriv's docs. The URL for this is https://scriv.readthedocs.io/en/latest/changelog.html#id1, which is auto-generated by sphinx. The next time a new version is added, #id1 will be assigned to the first section in the page, which will make the URL point to different version.

In order to keep the anchors/urls consistent, scriv could add a simple anchor above the section

.. _changelog-0.13.0:

0.13.0 — 2022-01-23
-------------------

Also, url for each section within a single version is also changing continuously on version updates, https://scriv.readthedocs.io/en/latest/changelog.html#added for example points to the latest version's 'Added' section. The latter sections just using #id<N>

This can perhaps be fixed by adding an anchor something like:

.. _0.13.0-Added:

I realize that it is possible to do at least the former by updating the config_entry_title_template (although, it'd be nice if it was a part of the default template), but the latter requires some changes since it is added scriv.format_rst.RstTools.format_sections and doesn't currently have a template.

I can open a PR with an implementation if you are open to it.

@maxking maxking changed the title Create predictable URLs to changelogs Create stable URLs to changelogs Mar 14, 2022
@nedbat
Copy link
Owner

nedbat commented Mar 14, 2022

I like the idea of stable URLs to each version section. I haven't needed URLs within the sections, and that seems more involved, so would it be OK to skip that part?

@maxking
Copy link
Contributor Author

maxking commented Mar 14, 2022

Yeah, ofcourse. It isn't needed as much as for the section header itself. I've had frequent asks for stable section level urls from users.
I have opened #47 for that.

nedbat added a commit that referenced this issue Mar 18, 2022
* Add stable anchors for sections with versions.

Fixes #46

* Use single line string with newlines

* Update src/scriv/format_rst.py

Co-authored-by: Ned Batchelder <ned@nedbatchelder.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants