Skip to content
Closed
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Next Next commit
tools,doc: fix 404 broken links in docs
Change the linkManPages function to catch the uname and curl
correct websites on the docs page.

Fixes: #26074
  • Loading branch information
07Gond committed Apr 10, 2019
commit eecc04cc24207120035baa26cc93b8cb3b2d8279
12 changes: 10 additions & 2 deletions tools/doc/html.js
Original file line number Diff line number Diff line change
Expand Up @@ -120,6 +120,8 @@ function preprocessText() {

// Syscalls which appear in the docs, but which only exist in BSD / macOS.
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)".
Expand All @@ -135,9 +137,15 @@ function linkManPages(text) {
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)) {
Comment thread
07Gond marked this conversation as resolved.
Outdated
return `${beginning}<a href="https://${name}.haxx.se/docs/manpage.html">${displayAs}</a>`;
} else {
Comment thread
07Gond marked this conversation as resolved.
Outdated
return `${beginning}<a href="http://man7.org/linux/man-pages/man${number}` +
`/${name}.${number}${optionalCharacter}.html">${displayAs}</a>`;
}
return `${beginning}<a href="http://man7.org/linux/man-pages/man${number}` +
`/${name}.${number}${optionalCharacter}.html">${displayAs}</a>`;
});
}

Expand Down