Skip to content

[v14.x-backport] doc: anchor link parity between markdown and html-generated docs - #40495

Closed
foxxyz wants to merge 3 commits into
nodejs:v14.x-stagingfrom
foxxyz:14-consistent-doc-anchors
Closed

[v14.x-backport] doc: anchor link parity between markdown and html-generated docs#40495
foxxyz wants to merge 3 commits into
nodejs:v14.x-stagingfrom
foxxyz:14-consistent-doc-anchors

Conversation

@foxxyz

Copy link
Copy Markdown
Contributor

Backport of #39304

(hope this is not too late for a 14.x merge. If it is, feel free to close.)

guybedfordand others added 3 commits October 12, 2021 10:30
PR-URL: nodejs#39635
Reviewed-By: Bradley Farias <bradley.meck@gmail.com>
PR-URL: nodejs#40041
Reviewed-By: James M Snell <jasnell@gmail.com>
Reviewed-By: Geoffrey Booth <webmaster@geoffreybooth.com>
Main changes:
- Replace current HTML anchor generation to match
header anchor generation in Github markdown.
- Remove unnecessary double namespacing on generated anchors/links (E.G.
`esm.md#loaders` instead of `esm.md#esm_loaders`).
- Anchors/links are automatically prefixed with their respective modules
when concatenated for usage in `all.html`.
Benefits:
- All anchor links within and between markdown API docs actually work.
- Adding new anchor links no longer requires contributors to generate
the HTML docs first to look up the correct anchors.
- Anchors are much shorter.
- All previous anchor links are preserved by generating hidden legacy
anchors.
PR-URL: nodejs#39304
Reviewed-By: Antoine du Hamel <duhamelantoine1995@gmail.com>
@nodejs-github-botnodejs-github-bot added doc Issues and PRs related to the documentations. v14.x labels Oct 18, 2021

@targostargos left a comment

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks a lot!

@MesteeryMesteery added the author ready PRs that have at least one approval, no pending requests for changes, and a CI started. label Oct 18, 2021
@aduh95

Copy link
Copy Markdown
Contributor

Note this will conflict with #40479, before merging this PR we should probably make sure that everything that landed on master before this is either on v14.x-staging or won't be backported.

@targos

Copy link
Copy Markdown
Member

#40479 is semver-minor and there is currently no more semver-minor release scheduled for v14.x. I don't think it should block this.

@richardlau

Copy link
Copy Markdown
Member

This didn't make it in time for the maintenance transition -- I'm leaning towards closing this as "won't fix" on v14.x. That may result in merge conflicts when cherry-picking fixes but those should be infrequent now 14 is in maintenance.

cc @nodejs/lts

@foxxyz

Copy link
Copy Markdown
ContributorAuthor

No problem - if there's anything I can do let me know!

@richardlau
richardlauforce-pushed the v14.x-staging branch 2 times, most recently from 30ba86c to 7f2825bCompareMarch 17, 2022 23:36
@targostargos added wontfix Issues that will not be fixed. and removed author ready PRs that have at least one approval, no pending requests for changes, and a CI started. labels Apr 10, 2022
@targostargos closed this Apr 10, 2022
@targos

Copy link
Copy Markdown
Member

@foxxyz Thanks again! Sorry we couldn't merge this in time.

@foxxyz

Copy link
Copy Markdown
ContributorAuthor

All good! Hope to contribute more in the future - thank you 🙏🏽 ❗

@foxxyz
foxxyz deleted the 14-consistent-doc-anchors branch April 11, 2022 01:52
Sign up for freeto join this conversation on GitHub. Already have an account? Sign in to comment

Labels

docIssues and PRs related to the documentations.wontfixIssues that will not be fixed.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

7 participants

@foxxyz@aduh95@targos@richardlau@nodejs-github-bot@Mesteery@guybedford