FazBrowse GitHub Viewer | Trending |
URL:
| Home
Tools: [Download Repo ZIP]   [Original HTTPS Page]

tools: fix man-page generation on Windows · nodejs/node@7c09bd5 · GitHub

/ node Public

Commit 7c09bd5

Browse files
authored andcommitted
tools: fix man-page generation on Windows
Signed-off-by: James Ross <james@jross.me> PR-URL: #64886 Reviewed-By: Aviv Keller <me@aviv.sh> Reviewed-By: Stefan Stojanovic <stefan.stojanovic@janeasystems.com> Reviewed-By: Ulises Gascón <ulisesgascongonzalez@gmail.com>
1 parent 1a20d27 commit 7c09bd5

1 file changed

Lines changed: 10 additions & 3 deletions

File tree

‎tools/doc/man-page.doc-kit.config.mjs‎

Lines changed: 10 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,14 @@ import { fileURLToPath } from 'node:url';
55

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

8-
const fromRoot = (path) => fileURLToPath(new URL(path, root));
8+
// POSIX separators, because `input` is a glob pattern and a backslash reads as
9+
// an escape character, which would mangle Windows paths into non-matches.
10+
const fromRoot = (path) =>
11+
fileURLToPath(new URL(path, root)).replaceAll('\\', '/');
12+
13+
// doc-kit only treats a value as local when it parses as a `file:` URL, and a
14+
// Windows drive letter parses as a URL scheme, so these must stay URLs.
15+
const urlFromRoot = (path) => new URL(path, root).href;
916

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

1724
// Point every loadable URL at its local file so no network request is made.
18-
changelog: fromRoot('CHANGELOG.md'),
19-
index: fromRoot('doc/api/index.md'),
25+
changelog: urlFromRoot('CHANGELOG.md'),
26+
index: urlFromRoot('doc/api/index.md'),
2027
},
2128
};

0 commit comments

Comments
 (0)

Back | FazBrowse Home | New Git URL