Skip to content

Commit 64086a9

Browse files
tjfontainepiscisaureus
authored andcommitted
doc: build branch versioned docs
Cherry-picked-from: nodejs/node-v0.x-archive@641cea0 Conflicts: Makefile
1 parent 57dea9e commit 64086a9

File tree

2 files changed

+8
-3
lines changed

2 files changed

+8
-3
lines changed

Makefile

Lines changed: 7 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -191,6 +191,9 @@ website_files = \
191191

192192
doc: $(apidoc_dirs) $(website_files) $(apiassets) $(apidocs) tools/doc/ $(NODE_EXE)
193193

194+
doc-branch: NODE_DOC_VERSION = v$(shell $(PYTHON) tools/getnodeversion.py | cut -f1,2 -d.)
195+
doc-branch: doc
196+
194197
$(apidoc_dirs):
195198
mkdir -p $@
196199

@@ -204,10 +207,10 @@ out/doc/%: doc/%
204207
cp -r $< $@
205208

206209
out/doc/api/%.json: doc/api/%.markdown $(NODE_EXE)
207-
out/Release/$(NODE_EXE) tools/doc/generate.js --format=json $< > $@
210+
NODE_DOC_VERSION=$(NODE_DOC_VERSION) out/Release/$(NODE_EXE) tools/doc/generate.js --format=json $< > $@
208211

209212
out/doc/api/%.html: doc/api/%.markdown $(NODE_EXE)
210-
out/Release/$(NODE_EXE) tools/doc/generate.js --format=html --template=doc/template.html $< > $@
213+
NODE_DOC_VERSION=$(NODE_DOC_VERSION) out/Release/$(NODE_EXE) tools/doc/generate.js --format=html --template=doc/template.html $< > $@
211214

212215
email.md: ChangeLog tools/email-footer.md
213216
bash tools/changelog-head.sh | sed 's|^\* #|* \\#|g' > $@
@@ -216,6 +219,7 @@ email.md: ChangeLog tools/email-footer.md
216219
blog.html: email.md
217220
cat $< | ./$(NODE_EXE) tools/doc/node_modules/.bin/marked > $@
218221

222+
219223
docopen: out/doc/api/all.html
220224
-google-chrome out/doc/api/all.html
221225

@@ -224,6 +228,7 @@ docclean:
224228

225229
RAWVER=$(shell $(PYTHON) tools/getnodeversion.py)
226230
VERSION=v$(RAWVER)
231+
NODE_DOC_VERSION=$(VERSION)
227232
RELEASE=$(shell $(PYTHON) tools/getnodeisrelease.py)
228233
PLATFORM=$(shell uname | tr '[:upper:]' '[:lower:]')
229234
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
@@ -76,7 +76,7 @@ function render(lexed, filename, template, cb) {
7676
template = template.replace(/__ID__/g, id);
7777
template = template.replace(/__FILENAME__/g, filename);
7878
template = template.replace(/__SECTION__/g, section);
79-
template = template.replace(/__VERSION__/g, process.version);
79+
template = template.replace(/__VERSION__/g, process.env.NODE_DOC_VERSION);
8080
template = template.replace(/__TOC__/g, toc);
8181
template = template.replace(
8282
/__GTOC__/g,

0 commit comments

Comments
 (0)