Repository navigation
doc: Broken (404ing) links in Docs #26074
Copy link
Copy link
Closed
Labels
docIssues and PRs related to Node.js documentation.Issues and PRs related to Node.js documentation.
Description
Activity
- addeddocIssues and PRs related to Node.js documentation.Issues and PRs related to Node.js documentation.
on Feb 14, 2019 http://man7.org/linux/man-pages/man1/curl.1.htmlthis link is in this page https://nodejs.org/api/repl.html, The link is not in therepl.md, maybe we have a bug in generating the html.

The generation takes place here:
Lines 125 to 142 in 6f64cda
// Handle references to man pages, eg "open(2)" or "lchmod(2)". // Returns modified text, with such refs replaced with HTML links, for example // '<a href="http://man7.org/linux/man-pages/man2/open.2.html">open(2)</a>'. function linkManPages(text) { return text.replace( MAN_PAGE, (match, beginning, name, number, optionalCharacter) => { // Name consists of lowercase letters, // number is a single digit with an optional lowercase letter. const displayAs = `<code>${name}(${number}${optionalCharacter})</code>`; if (BSD_ONLY_SYSCALLS.has(name)) { return `${beginning}<a href="https://www.freebsd.org/cgi/man.cgi` + `?query=${name}&sektion=${number}">${displayAs}</a>`; } return `${beginning}<a href="http://man7.org/linux/man-pages/man${number}` + `/${name}.${number}${optionalCharacter}.html">${displayAs}</a>`; }); } Looks like a bug. Filter
curlandunamefor now ?https://linux.die.net/man/3/uname this link is for the https://github.com/nodejs/node/blob/master/doc/api/os.md generated by that snippet too.
I think that maybe we have to do something like this following the snippet logic:
const BSD_ONLY_SYSCALLS = new Set(['lchmod']); const LINUX_DIE_ONLY_SYSCALLS = new Set(['uname']); const HAXX_ONLY_SYSCALLS = new Set(['curl']); const MAN_PAGE = /(^|\s)([a-z.]+)\((\d)([a-z]?)\)/gm; // Handle references to man pages, eg "open(2)" or "lchmod(2)". // Returns modified text, with such refs replaced with HTML links, for example // '<a href="http://man7.org/linux/man-pages/man2/open.2.html">open(2)</a>'. function linkManPages(text) { return text.replace( MAN_PAGE, (match, beginning, name, number, optionalCharacter) => { // Name consists of lowercase letters, // number is a single digit with an optional lowercase letter. const displayAs = `<code>${name}(${number}${optionalCharacter})</code>`; if (BSD_ONLY_SYSCALLS.has(name)) { return `${beginning}<a href="https://www.freebsd.org/cgi/man.cgi` + `?query=${name}&sektion=${number}">${displayAs}</a>`; } else if (LINUX_DIE_ONLY_SYSCALLS.has(name)) { return `${beginning}<a href="https://linux.die.net/man/` + `${number}/${name}">${displayAs}</a>`; } else if (HAXX_ONLY_SYSCALLS.has(name)) { return `${beginning}<a href="https://${name}.haxx.se/docs/manpage.html">${displayAs}</a>`; } else { return `${beginning}<a href="http://man7.org/linux/man-pages/man${number}` + `/${name}.${number}${optionalCharacter}.html">${displayAs}</a>`; } }); }
If everything is ok here, Can I send a PR for this?
- added a commit that references this issue
on Apr 10, 2019 - added a commit that references this issue
on Jul 27, 2026
Metadata
Metadata
Assignees
Labels
docIssues and PRs related to Node.js documentation.Issues and PRs related to Node.js documentation.

Thanks to @JustinBeckwith's linkinator tool, I was able to pretty easily check our docs to see if any of the links were 404ing. Turns out we currently have 2 404s somewhere in the docs. Here are the links that are 404ing:
At a bare minimum, you could view source on
docs/api/all.htmland search for these links to identify where they are in the docs.The tool currently falsely reports all DevTools protocol links as 404ing when they are not actually 404ing. I'll open up an issue on the linkinator repo for that.