Skip to content

Commit 2a57a68

Browse files
committed
build, doc: generate node.1 with doc-kit
1 parent b9e2346 commit 2a57a68

8 files changed

Lines changed: 37 additions & 2438 deletions

File tree

BUILDING.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -558,7 +558,7 @@ NODE=/path/to/node make doc-only
558558
To read the man page:
559559

560560
```bash
561-
man doc/node.1
561+
man out/doc/node.1
562562
```
563563

564564
If you prefer to read the full documentation in a browser, run the following.

Makefile

Lines changed: 17 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -196,7 +196,7 @@ config.gypi: configure configure.py src/node_version.h
196196
fi
197197

198198
.PHONY: install
199-
install: all ## Install node into $PREFIX (default=/usr/local).
199+
install: all out/doc/node.1 ## Install node into $PREFIX (default=/usr/local).
200200
$(PYTHON) tools/install.py $@ --dest-dir '$(DESTDIR)' --prefix '$(PREFIX)'
201201

202202
.PHONY: uninstall
@@ -856,7 +856,7 @@ VERSION=v$(RAWVER)
856856

857857
.PHONY: doc-only
858858
.NOTPARALLEL: doc-only
859-
doc-only: $(apidoc_dirs) $(apidocs_html) $(apidocs_json) out/doc/api/all.html out/doc/api/all.json out/doc/llms.txt out/doc/apilinks.json ## Builds the docs with the local or the global Node.js binary.
859+
doc-only: $(apidoc_dirs) $(apidocs_html) $(apidocs_json) out/doc/node.1 out/doc/api/all.html out/doc/api/all.json out/doc/llms.txt out/doc/apilinks.json ## Builds the docs with the local or the global Node.js binary.
860860

861861
.PHONY: doc
862862
doc: $(NODE_EXE) doc-only ## Build Node.js, and then build the documentation with the new binary.
@@ -932,6 +932,20 @@ out/doc/apilinks.json: $(wildcard lib/*.js) tools/doc/node_modules | out/doc
932932
) \
933933
fi
934934

935+
out/doc/node.1: doc/api/cli.md tools/doc/node_modules | out/doc
936+
@if [ "$(shell $(node_use_openssl_and_icu))" != "true" ]; then \
937+
echo "Skipping $@ (no crypto and/or no ICU)"; \
938+
else \
939+
$(call available-node, \
940+
$(DOC_KIT) generate \
941+
-t man-page \
942+
-i $< \
943+
-o $(@D) \
944+
-v $(VERSION) \
945+
) \
946+
fi
947+
948+
935949
.PHONY: docopen
936950
docopen: doc-only ## Open the documentation in a web browser.
937951
@$(PYTHON) -mwebbrowser file://$(abspath $<)
@@ -1269,7 +1283,7 @@ $(TARBALL): $(TARBALL_DEPS)
12691283
git checkout-index -a -f --prefix=$(TARNAME)/
12701284
ifneq ($(SKIP_SHARED_DEPS), 1)
12711285
mkdir -p $(TARNAME)/doc/api
1272-
cp doc/node.1 $(TARNAME)/doc/node.1
1286+
cp out/doc/node.1 $(TARNAME)/doc/node.1
12731287
cp -r out/doc/api/* $(TARNAME)/doc/api/
12741288
endif
12751289
sed 's/fileset = fileset.intersection (fileset.gitTracked root)/fileset =/' tools/nix/v8.nix > $(TARNAME)/tools/nix/v8.nix

0 commit comments

Comments
 (0)