GV

GeezerVison

The World Wide Web, restored to 800 pixels of glory.

Home|About|Gaming cabinet|Archives|How it works|Starter sites

On this site

  • Sign in
  • ActionsCI/CD and automation
  • CodespacesCloud development environments
  • All Features
  • Documentation
  • Training
  • Certifications
  • Build with Copilot
  • Customize Copilot
  • Integrations
  • Trending repos
  • GitHub Sponsors
  • Developer articles
  • Enterprises

This view

  • Original page
  • New address

GeezerVison is showing github.com — doc: fix broken links in modules.md by Trott · Pull Request #35182 · nodejs/node

Conversation

@Trott

@Trott Trott commented Sep 14, 2020

Copy link
Copy Markdown
Member
Checklist
  • documentation is changed or added
  • commit message follows commit guidelines

Sorry, something went wrong.

Uh oh!

There was an error while loading. Please reload this page.

aduh95 reacted with thumbs up emoji
All reactions
  • 👍 1 reaction
@nodejs-github-bot

nodejs-github-bot commented Sep 14, 2020

Copy link
Copy Markdown
Collaborator

Review requested:

  • @nodejs/modules
All reactions

Sorry, something went wrong.

Uh oh!

There was an error while loading. Please reload this page.

@nodejs-github-bot nodejs-github-bot added doc Issues and PRs related to Node.js documentation. module Issues and PRs related to the module subsystem. labels Sep 14, 2020
guybedford
guybedford approved these changes Sep 14, 2020
View reviewed changes
GeoffreyBooth
GeoffreyBooth approved these changes Sep 14, 2020
View reviewed changes
@GeoffreyBooth GeoffreyBooth added the fast-track PRs proposed for a shorter-than-standard waiting period before landing. label Sep 14, 2020
DerekNonGeneric
DerekNonGeneric approved these changes Sep 14, 2020
View reviewed changes

@DerekNonGeneric DerekNonGeneric left a comment

Copy link
Copy Markdown
Contributor

There was a problem hiding this comment.

Choose a reason for hiding this comment

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

This probably should have been caught by tools/doc/checkLinks.js. I haven't looked into it yet, but perhaps it's broken? There are literally pages of PRs fixing broken links (some of which are very recent). 😕

Sorry, something went wrong.

Uh oh!

There was an error while loading. Please reload this page.

All reactions
@lpinca

lpinca commented Sep 14, 2020 •
edited
Loading

Uh oh!

There was an error while loading. Please reload this page.

Copy link
Copy Markdown
Member

This probably should have been caught by tools/doc/checkLinks.js

I think it skips api dirs.

All reactions

Sorry, something went wrong.

Uh oh!

There was an error while loading. Please reload this page.

crypt096
crypt096 approved these changes Sep 14, 2020
View reviewed changes
himself65
himself65 approved these changes Sep 14, 2020
View reviewed changes
@richardlau

richardlau commented Sep 14, 2020

Copy link
Copy Markdown
Member

This probably should have been caught by tools/doc/checkLinks.js. I haven't looked into it yet, but perhaps it's broken? There are literally pages of PRs fixing broken links (some of which are very recent). 😕

I haven't dug into why but it looks like the api docs are deliberately excluded:

node/tools/doc/checkLinks.js

Line 29 in 9d12c14

entry.name !== 'api' &&

All reactions

Sorry, something went wrong.

Uh oh!

There was an error while loading. Please reload this page.

@aduh95

aduh95 commented Sep 14, 2020 •
edited
Loading

Uh oh!

There was an error while loading. Please reload this page.

Copy link
Copy Markdown
Contributor

This should be tested when building the HTML, but apparently it only tests links internal to all.html page:

node/tools/doc/allhtml.js

Lines 85 to 88 in 9d12c14

const hrefRe = / href="#(\w+)"/g;
while (match = hrefRe.exec(all)) {
if (!ids.has(match[1])) throw new Error(`link not found: ${match[1]}`);
}

Usually that would cover all links internal to the docs, as all links to doc pages are stripped from the filename to keep only the hash part:

node/tools/doc/allhtml.js

Lines 39 to 45 in 9d12c14

apicontent += data.slice(match.index + match[0].length)
.replace(/<!-- API END -->[\s\S]*/, '')
.replace(/<a href="(\w[^#"]*)#/g, (match, href) => {
return htmlFiles.includes(href) ? '<a href="#' : match;
})
.trim() + '\n';

But in this case, because modules_module.html doesn't exist, it's treated as an external page and the broken links slip through the test…

I haven't dug into why but it looks like the api docs are deliberately excluded

Yes indeed. The reason checkLinks.js does not cover api is because we are using .html extension to reference other doc pages, while checkLinks.js would expect .md. One way of fixing it would be to use .md extensions in the Markdown files, and use checkLinks.js to test said links – it would also improve the experience of navigating the docs through GitHub web UI. Another way would be to tweak the current test to make sure this doesn't reproduce.

All reactions

Sorry, something went wrong.

Uh oh!

There was an error while loading. Please reload this page.

@DerekNonGeneric

DerekNonGeneric commented Sep 14, 2020

Copy link
Copy Markdown
Contributor

Thanks for looking into this @aduh95; I've opened a separate issue @ #35189 so as not to derail.

Seeing as how others have already taken interest in tackling it themselves (see #35186), this should probably be fast-tracked.

Please 👍 this comment to approve fast-tracking

lpinca reacted with thumbs up emoji
All reactions
  • 👍 1 reaction

Sorry, something went wrong.

Uh oh!

There was an error while loading. Please reload this page.

@aduh95 aduh95 mentioned this pull request Sep 14, 2020
doc: use .md extension for internal links #35191
Merged
4 tasks done
lpinca
lpinca approved these changes Sep 14, 2020
View reviewed changes
@Trott
Trott force-pushed the moved branch from 14b0172 to fb1ab19 Compare September 14, 2020 19:40
@Trott
Trott merged commit fb1ab19 into nodejs:master Sep 14, 2020
@Trott

Trott commented Sep 14, 2020

Copy link
Copy Markdown
Member Author

Landed in fb1ab19

All reactions

Sorry, something went wrong.

Uh oh!

There was an error while loading. Please reload this page.

@Trott
Trott deleted the moved branch September 14, 2020 19:40
@Trott
doc: fix broken links in modules.md
fb1ab19
PR-URL: nodejs#35182
Reviewed-By: Guy Bedford <[email protected]>
Reviewed-By: Geoffrey Booth <[email protected]>
Reviewed-By: Derek Lewis <[email protected]>
Reviewed-By: Zeyu Yang <[email protected]>
Reviewed-By: Luigi Pinca <[email protected]>
ruyadorno pushed a commit that referenced this pull request Sep 17, 2020
@Trott @ruyadorno
doc: fix broken links in modules.md
176e9e4
PR-URL: #35182
Reviewed-By: Guy Bedford <[email protected]>
Reviewed-By: Geoffrey Booth <[email protected]>
Reviewed-By: Derek Lewis <[email protected]>
Reviewed-By: Zeyu Yang <[email protected]>
Reviewed-By: Luigi Pinca <[email protected]>
@ruyadorno ruyadorno mentioned this pull request Sep 21, 2020
V14.12.0 proposal #35285
Merged
4 tasks done
MylesBorins pushed a commit that referenced this pull request Nov 3, 2020
@Trott @MylesBorins
doc: fix broken links in modules.md
a573e0b
PR-URL: #35182
Reviewed-By: Guy Bedford <[email protected]>
Reviewed-By: Geoffrey Booth <[email protected]>
Reviewed-By: Derek Lewis <[email protected]>
Reviewed-By: Zeyu Yang <[email protected]>
Reviewed-By: Luigi Pinca <[email protected]>
@MylesBorins MylesBorins mentioned this pull request Nov 3, 2020
v12.20.0 proposal #35950
Merged
MylesBorins pushed a commit that referenced this pull request Nov 4, 2020
@Trott @MylesBorins
doc: fix broken links in modules.md
d12a6f3
PR-URL: #35182
Reviewed-By: Guy Bedford <[email protected]>
Reviewed-By: Geoffrey Booth <[email protected]>
Reviewed-By: Derek Lewis <[email protected]>
Reviewed-By: Zeyu Yang <[email protected]>
Reviewed-By: Luigi Pinca <[email protected]>
MylesBorins pushed a commit that referenced this pull request Nov 16, 2020
@Trott @MylesBorins
doc: fix broken links in modules.md
79f3c32
PR-URL: #35182
Reviewed-By: Guy Bedford <[email protected]>
Reviewed-By: Geoffrey Booth <[email protected]>
Reviewed-By: Derek Lewis <[email protected]>
Reviewed-By: Zeyu Yang <[email protected]>
Reviewed-By: Luigi Pinca <[email protected]>
joesepi pushed a commit to joesepi/node that referenced this pull request Jan 8, 2021
@Trott @joesepi
doc: fix broken links in modules.md
4ab9cbb
PR-URL: nodejs#35182
Reviewed-By: Guy Bedford <[email protected]>
Reviewed-By: Geoffrey Booth <[email protected]>
Reviewed-By: Derek Lewis <[email protected]>
Reviewed-By: Zeyu Yang <[email protected]>
Reviewed-By: Luigi Pinca <[email protected]>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Reviewers

@GeoffreyBooth GeoffreyBooth GeoffreyBooth approved these changes
@guybedford guybedford guybedford approved these changes
@lpinca lpinca lpinca approved these changes
@himself65 himself65 himself65 approved these changes
+2 more reviewers
@DerekNonGeneric DerekNonGeneric DerekNonGeneric approved these changes
@crypt096 crypt096 crypt096 approved these changes
Reviewers whose approvals may not affect merge requirements

Uh oh!

There was an error while loading. Please reload this page.

Assignees

No one assigned

Labels

doc Issues and PRs related to Node.js documentation. fast-track PRs proposed for a shorter-than-standard waiting period before landing. module Issues and PRs related to the module subsystem.

Projects

None yet

Milestone

No milestone

Development

Successfully merging this pull request may close these issues.

Uh oh!

There was an error while loading. Please reload this page.

10 participants

@Trott @nodejs-github-bot @lpinca @richardlau @aduh95 @DerekNonGeneric @GeoffreyBooth @guybedford @himself65 @crypt096
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
You are visitor 01402503 — GeezerVison does not store the pages you look up.
Best viewed with Netscape Navigator 4.7 or Internet Explorer 6 at 800×600. No cookies required.