tools,doc: fix 404 broken links in docs
Change the `linkManPages()` function to catch the `uname` and `curl` correct websites on the docs page. PR-URL: https://github.com/nodejs/node/pull/27168 Fixes: https://github.com/nodejs/node/issues/26074 Reviewed-By: James M Snell <jasnell@gmail.com> Reviewed-By: Ruben Bridgewater <ruben@bridgewater.de>
This commit is contained in:
parent
8d901bb44e
commit
964174e339
@ -120,6 +120,8 @@ function preprocessText() {
|
|||||||
|
|
||||||
// Syscalls which appear in the docs, but which only exist in BSD / macOS.
|
// Syscalls which appear in the docs, but which only exist in BSD / macOS.
|
||||||
const BSD_ONLY_SYSCALLS = new Set(['lchmod']);
|
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;
|
const MAN_PAGE = /(^|\s)([a-z.]+)\((\d)([a-z]?)\)/gm;
|
||||||
|
|
||||||
// Handle references to man pages, eg "open(2)" or "lchmod(2)".
|
// Handle references to man pages, eg "open(2)" or "lchmod(2)".
|
||||||
@ -136,6 +138,14 @@ function linkManPages(text) {
|
|||||||
return `${beginning}<a href="https://www.freebsd.org/cgi/man.cgi` +
|
return `${beginning}<a href="https://www.freebsd.org/cgi/man.cgi` +
|
||||||
`?query=${name}&sektion=${number}">${displayAs}</a>`;
|
`?query=${name}&sektion=${number}">${displayAs}</a>`;
|
||||||
}
|
}
|
||||||
|
if (LINUX_DIE_ONLY_SYSCALLS.has(name)) {
|
||||||
|
return `${beginning}<a href="https://linux.die.net/man/` +
|
||||||
|
`${number}/${name}">${displayAs}</a>`;
|
||||||
|
}
|
||||||
|
if (HAXX_ONLY_SYSCALLS.has(name)) {
|
||||||
|
return `${beginning}<a href="https://${name}.haxx.se/docs/manpage.html">${displayAs}</a>`;
|
||||||
|
}
|
||||||
|
|
||||||
return `${beginning}<a href="http://man7.org/linux/man-pages/man${number}` +
|
return `${beginning}<a href="http://man7.org/linux/man-pages/man${number}` +
|
||||||
`/${name}.${number}${optionalCharacter}.html">${displayAs}</a>`;
|
`/${name}.${number}${optionalCharacter}.html">${displayAs}</a>`;
|
||||||
});
|
});
|
||||||
|
Loading…
x
Reference in New Issue
Block a user