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

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

Closed
wants to merge 3 commits into from

Conversation

foxxyz
Copy link
Contributor

@foxxyz foxxyz commented Oct 18, 2021

Backport of #39304

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

guybedford and 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-bot nodejs-github-bot added doc Issues and PRs related to the documentations. v14.x labels Oct 18, 2021
Copy link
Member

@targos targos left a comment

Choose a reason for hiding this comment

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

Thanks a lot!

@Mesteery Mesteery 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
Contributor

aduh95 commented Oct 18, 2021

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
Member

targos commented Oct 18, 2021

#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
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
Contributor Author

foxxyz commented Nov 30, 2021

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

@richardlau richardlau force-pushed the v14.x-staging branch 2 times, most recently from 30ba86c to 7f2825b Compare March 17, 2022 23:36
@targos targos 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
@targos targos closed this Apr 10, 2022
@targos
Copy link
Member

targos commented Apr 10, 2022

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

@foxxyz
Copy link
Contributor Author

foxxyz commented Apr 11, 2022

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 free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
doc Issues and PRs related to the documentations. wontfix Issues that will not be fixed.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

7 participants