Skip to content
Open
Show file tree
Hide file tree
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
33 changes: 32 additions & 1 deletion Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -932,6 +932,19 @@ out/doc/apilinks.json: $(wildcard lib/*.js) tools/doc/node_modules | out/doc
) \
fi

.PHONY: doc/node.1
doc/node.1: doc/api/cli.md tools/doc/node_modules
@if [ "$(shell $(node_use_openssl_and_icu))" != "true" ]; then \
Comment thread
avivkeller marked this conversation as resolved.
echo "Skipping $@ (no crypto and/or no ICU)"; \
else \
$(call available-node, \
$(DOC_KIT) generate \
-v $(VERSION) \
--config-file tools/doc/man-page.doc-kit.config.mjs \
-o $(@D) \
) \
fi

.PHONY: docopen
docopen: doc-only ## Open the documentation in a web browser.
@$(PYTHON) -mwebbrowser file://$(abspath $<)
Expand Down Expand Up @@ -1480,8 +1493,26 @@ tools/.mdlintstamp: tools/lint-md/node_modules/remark-parse/package.json $(LINT_
@$(call available-node,$(run-lint-md))
@touch $@

tools/.manpagelintstamp: doc/api/cli.md tools/doc/node_modules
$(info Verifying that doc/node.1 is up to date...)
@if [ "$(shell $(node_use_openssl_and_icu))" != "true" ]; then \
echo "Skipping doc/node.1 verification (no crypto and/or no ICU)"; \
else \
$(RM) -r out/doc/.manpagecheck && \
$(call available-node, \
$(DOC_KIT) generate \
-v $(VERSION) \
--config-file tools/doc/man-page.doc-kit.config.mjs \
) \
if ! diff -u doc/node.1 out/doc/.manpagecheck/node.1; then \
echo 'doc/node.1 is out of date; run `make doc/node.1` to regenerate it.'; \
exit 1; \
fi; \
fi
@touch $@

.PHONY: lint-md
lint-md: lint-js-doc | tools/.mdlintstamp ## Lint the markdown documents maintained by us in the codebase.
lint-md: lint-js-doc | tools/.mdlintstamp tools/.manpagelintstamp ## Lint the markdown documents maintained by us in the codebase.

run-format-md = tools/lint-md/lint-md.mjs --format $(LINT_MD_FILES)
.PHONY: format-md
Expand Down
3 changes: 2 additions & 1 deletion doc/node.1
Original file line number Diff line number Diff line change
Expand Up @@ -746,7 +746,8 @@ passing a second \fBparentURL\fR argument for contextual resolution.
Previously gated the entire \fBimport.meta.resolve\fR feature.
.
.It Fl -experimental-import-text
Enable experimental support for importing modules with \fBwith { type: 'text' }\fR.
Enable experimental support for importing modules with
\fBwith { type: 'text' }\fR.
.
.It Fl -experimental-inspector-network-resource
Enable experimental support for inspector network resources.
Expand Down
21 changes: 21 additions & 0 deletions tools/doc/man-page.doc-kit.config.mjs
Original file line number Diff line number Diff line change
@@ -0,0 +1,21 @@
// @node-core/doc-kit configuration for generating and linting the Node.js
// man-page (doc/node.1).

import { fileURLToPath } from 'node:url';

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

const fromRoot = (path) => fileURLToPath(new URL(path, root));

export default {
target: ['man-page'],

global: {
input: [fromRoot('doc/api/cli.md')],
output: fromRoot('out/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'),
},
};
Loading