Skip to content

Commit 383904c

Browse files
committed
build, doc: generate node.1 with doc-kit
1 parent 6964b53 commit 383904c

File tree

8 files changed

+37
-2360
lines changed

8 files changed

+37
-2360
lines changed

BUILDING.md

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

556556
```bash
557-
man doc/node.1
557+
man out/doc/node.1
558558
```
559559

560560
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
@@ -819,7 +819,7 @@ VERSION=v$(RAWVER)
819819

820820
.PHONY: doc-only
821821
.NOTPARALLEL: doc-only
822-
doc-only: $(apidoc_dirs) $(apidocs_html) $(apidocs_json) out/doc/api/all.html out/doc/api/all.json out/doc/apilinks.json ## Builds the docs with the local or the global Node.js binary.
822+
doc-only: $(apidoc_dirs) $(apidocs_html) $(apidocs_json) out/doc/node.1 out/doc/api/all.html out/doc/api/all.json out/doc/apilinks.json ## Builds the docs with the local or the global Node.js binary.
823823

824824
.PHONY: doc
825825
doc: $(NODE_EXE) doc-only ## Build Node.js, and then build the documentation with the new binary.
@@ -875,6 +875,20 @@ out/doc/apilinks.json: $(wildcard lib/*.js) tools/doc/node_modules | out/doc
875875
) \
876876
fi
877877

878+
out/doc/node.1: doc/api/cli.md tools/doc/node_modules | out/doc
879+
@if [ "$(shell $(node_use_openssl_and_icu))" != "true" ]; then \
880+
echo "Skipping $@ (no crypto and/or no ICU)"; \
881+
else \
882+
$(call available-node, \
883+
$(DOC_KIT) generate \
884+
-t man-page \
885+
-i $< \
886+
-o $(@D) \
887+
-v $(VERSION) \
888+
) \
889+
fi
890+
891+
878892
.PHONY: docopen
879893
docopen: doc-only ## Open the documentation in a web browser.
880894
@$(PYTHON) -mwebbrowser file://$(abspath $<)
@@ -1206,7 +1220,7 @@ pkg-upload: pkg
12061220
$(TARBALL): release-only doc-only
12071221
git checkout-index -a -f --prefix=$(TARNAME)/
12081222
mkdir -p $(TARNAME)/doc/api
1209-
cp doc/node.1 $(TARNAME)/doc/node.1
1223+
cp out/doc/node.1 $(TARNAME)/doc/node.1
12101224
cp -r out/doc/api/* $(TARNAME)/doc/api/
12111225
$(RM) -r $(TARNAME)/.editorconfig
12121226
$(RM) -r $(TARNAME)/.git*

0 commit comments

Comments
 (0)