Skip to content
Open
Changes from all commits
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
13 changes: 10 additions & 3 deletions tools/doc/man-page.doc-kit.config.mjs
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,14 @@ import { fileURLToPath } from 'node:url';

const root = new URL('../../', import.meta.url);

const fromRoot = (path) => fileURLToPath(new URL(path, root));
// POSIX separators, because `input` is a glob pattern and a backslash reads as
// an escape character, which would mangle Windows paths into non-matches.
const fromRoot = (path) =>
fileURLToPath(new URL(path, root)).replaceAll('\\', '/');

// doc-kit only treats a value as local when it parses as a `file:` URL, and a
// Windows drive letter parses as a URL scheme, so these must stay URLs.
const urlFromRoot = (path) => new URL(path, root).href;

export default {
target: ['man-page'],
Expand All @@ -15,7 +22,7 @@ export default {
output: fromRoot('tools/doc/.manpagecheck'),

// Point every loadable URL at its local file so no network request is made.
changelog: fromRoot('CHANGELOG.md'),
index: fromRoot('doc/api/index.md'),
changelog: urlFromRoot('CHANGELOG.md'),
index: urlFromRoot('doc/api/index.md'),
},
};
Loading