Skip to content
This repository was archived by the owner on Apr 22, 2023. It is now read-only.

Commit 641cea0

Browse files
committed
doc: build branch versioned docs
1 parent 2b7c8a2 commit 641cea0

File tree

2 files changed

+12
-3
lines changed

2 files changed

+12
-3
lines changed

Makefile

Lines changed: 11 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -146,6 +146,9 @@ website_files = \
146146

147147
doc: $(apidoc_dirs) $(website_files) $(apiassets) $(apidocs) tools/doc/ out/doc/changelog.html node
148148

149+
doc-branch: NODE_DOC_VERSION = v$(shell $(PYTHON) tools/getnodeversion.py | cut -f1,2 -d.)
150+
doc-branch: doc
151+
149152
$(apidoc_dirs):
150153
mkdir -p $@
151154

@@ -159,10 +162,10 @@ out/doc/%: doc/%
159162
cp -r $< $@
160163

161164
out/doc/api/%.json: doc/api/%.markdown node
162-
out/Release/node tools/doc/generate.js --format=json $< > $@
165+
NODE_DOC_VERSION=$(NODE_DOC_VERSION) out/Release/node tools/doc/generate.js --format=json $< > $@
163166

164167
out/doc/api/%.html: doc/api/%.markdown node
165-
out/Release/node tools/doc/generate.js --format=html --template=doc/template.html $< > $@
168+
NODE_DOC_VERSION=$(NODE_DOC_VERSION) out/Release/node tools/doc/generate.js --format=html --template=doc/template.html $< > $@
166169

167170
email.md: ChangeLog tools/email-footer.md
168171
bash tools/changelog-head.sh | sed 's|^\* #|* \\#|g' > $@
@@ -181,6 +184,11 @@ website-upload: doc
181184
rm -f ~/web/nodejs.org/dist/node-latest.tar.gz &&\
182185
ln -s $(VERSION)/node-$(VERSION).tar.gz ~/web/nodejs.org/dist/node-latest.tar.gz'
183186

187+
doc-branch-upload: NODE_DOC_VERSION = v$(shell $(PYTHON) tools/getnodeversion.py | cut -f1,2 -d.)
188+
doc-branch-upload: doc-branch
189+
echo $(NODE_DOC_VERSION)
190+
rsync -r out/doc/api/ node@nodejs.org:~/web/nodejs.org/api/$(NODE_DOC_VERSION)
191+
184192
docopen: out/doc/api/all.html
185193
-google-chrome out/doc/api/all.html
186194

@@ -189,6 +197,7 @@ docclean:
189197

190198
RAWVER=$(shell $(PYTHON) tools/getnodeversion.py)
191199
VERSION=v$(RAWVER)
200+
NODE_DOC_VERSION=$(VERSION)
192201
RELEASE=$(shell $(PYTHON) tools/getnodeisrelease.py)
193202
PLATFORM=$(shell uname | tr '[:upper:]' '[:lower:]')
194203
ifeq ($(findstring x86_64,$(shell uname -m)),x86_64)

tools/doc/html.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -48,7 +48,7 @@ function render(lexed, filename, template, cb) {
4848

4949
template = template.replace(/__FILENAME__/g, filename);
5050
template = template.replace(/__SECTION__/g, section);
51-
template = template.replace(/__VERSION__/g, process.version);
51+
template = template.replace(/__VERSION__/g, process.env.NODE_DOC_VERSION);
5252
template = template.replace(/__TOC__/g, toc);
5353

5454
// content has to be the last thing we do with

0 commit comments

Comments
 (0)