Skip to content

Conversation

@pnkfelix
Copy link
Contributor

@pnkfelix pnkfelix commented Nov 3, 2022

Add version-stable anchors to the release notes template.

The current template embeds anchors from subheadings like "Compiler" that have the same section subheading name; thus, the generated html ends up with id attributes that have been uniquified (by adding a incremented suffix, e.g. #compiler-2) but those id attributes will change (e.g. to #compiler-3) as new releases come out.

The change in this PR enables one to write urls that end with e.g. #1.66.0-Compiler and have that url remain usable (in terms of pointing to the compiler subsection for that release), even in face of future releases.

FYI: in my local experimentation, it appears that in the context of hackmd, visiting an anchor tag with no contents will end up scrolling to a point where the hackmd toolbar obscures the subsection heading. This is unfortunate (though still an improvement on the current state of affairs where one has no option to link directly to these subsections in a version-stable manner). I am hoping that there is not a similar problem for the RELEASES.md file when viewed on github itself.

The current template embeds anchors from subheadings like "Compiler" that have
the same section subheading name; thus, the generated html ends up with `id`
attributes that have been uniquified (by adding a incremented suffix, e.g.
`#compiler-2`) but those `id` attributes will change (e.g. to `#compiler-3`) as
new releases come out.

The change in this PR enables one to write urls that end with e.g.
`rust-lang#1.66.0-Compiler` and have that url remain usable (in terms of pointing to the
compiler subsection *for that release*), even in face of future releases.

FYI: in my local experimentation, it appears that in the context of hackmd,
visiting an anchor tag with no contents will end up scrolling to a point where
the hackmd toolbar obscures the subsection heading. This is unfortunate (though
still an improvement on the current state of affairs where one has *no option*
to link directly to these subsections in a version-stable manner). I am hoping
that there is not a similar problem for the RELEASES.md file when viewed on
github itself.
@pnkfelix
Copy link
Contributor Author

pnkfelix commented Nov 3, 2022

r? @Mark-Simulacrum

@Mark-Simulacrum Mark-Simulacrum merged commit 444f5b4 into rust-lang:master Nov 14, 2022
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 this pull request may close these issues.

2 participants