Skip to content

Commit b7dcc0a

Browse files
committed
build, doc: generate node.1 with doc-kit
1 parent 511a57a commit b7dcc0a

File tree

8 files changed

+37
-2385
lines changed

8 files changed

+37
-2385
lines changed

BUILDING.md

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

554554
```bash
555-
man doc/node.1
555+
man out/doc/node.1
556556
```
557557

558558
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.
@@ -879,6 +879,20 @@ out/doc/apilinks.json: $(wildcard lib/*.js) tools/doc/node_modules | out/doc
879879
) \
880880
fi
881881

882+
out/doc/node.1: doc/api/cli.md tools/doc/node_modules | out/doc
883+
@if [ "$(shell $(node_use_openssl_and_icu))" != "true" ]; then \
884+
echo "Skipping $@ (no crypto and/or no ICU)"; \
885+
else \
886+
$(call available-node, \
887+
$(DOC_KIT) generate \
888+
-t man-page \
889+
-i $< \
890+
-o $(@D) \
891+
-v $(VERSION) \
892+
) \
893+
fi
894+
895+
882896
.PHONY: docopen
883897
docopen: doc-only ## Open the documentation in a web browser.
884898
@$(PYTHON) -mwebbrowser file://$(abspath $<)
@@ -1210,7 +1224,7 @@ pkg-upload: pkg
12101224
$(TARBALL): release-only doc-only
12111225
git checkout-index -a -f --prefix=$(TARNAME)/
12121226
mkdir -p $(TARNAME)/doc/api
1213-
cp doc/node.1 $(TARNAME)/doc/node.1
1227+
cp out/doc/node.1 $(TARNAME)/doc/node.1
12141228
cp -r out/doc/api/* $(TARNAME)/doc/api/
12151229
$(RM) -r $(TARNAME)/.editorconfig
12161230
$(RM) -r $(TARNAME)/.git*

0 commit comments

Comments
 (0)