Skip to content

Commit

Permalink
doc: build branch versioned docs
Browse files Browse the repository at this point in the history
Cherry-picked-from: nodejs/node-v0.x-archive@641cea0

Conflicts:
	Makefile
  • Loading branch information
tjfontaine authored and piscisaureus committed Jan 13, 2015
1 parent 57dea9e commit 64086a9
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 3 deletions.
9 changes: 7 additions & 2 deletions Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -191,6 +191,9 @@ website_files = \

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

doc-branch: NODE_DOC_VERSION = v$(shell $(PYTHON) tools/getnodeversion.py | cut -f1,2 -d.)
doc-branch: doc

$(apidoc_dirs):
mkdir -p $@

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

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

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

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


docopen: out/doc/api/all.html
-google-chrome out/doc/api/all.html

Expand All @@ -224,6 +228,7 @@ docclean:

RAWVER=$(shell $(PYTHON) tools/getnodeversion.py)
VERSION=v$(RAWVER)
NODE_DOC_VERSION=$(VERSION)
RELEASE=$(shell $(PYTHON) tools/getnodeisrelease.py)
PLATFORM=$(shell uname | tr '[:upper:]' '[:lower:]')
ifeq ($(findstring x86_64,$(shell uname -m)),x86_64)
Expand Down
2 changes: 1 addition & 1 deletion tools/doc/html.js
Original file line number Diff line number Diff line change
Expand Up @@ -76,7 +76,7 @@ function render(lexed, filename, template, cb) {
template = template.replace(/__ID__/g, id);
template = template.replace(/__FILENAME__/g, filename);
template = template.replace(/__SECTION__/g, section);
template = template.replace(/__VERSION__/g, process.version);
template = template.replace(/__VERSION__/g, process.env.NODE_DOC_VERSION);
template = template.replace(/__TOC__/g, toc);
template = template.replace(
/__GTOC__/g,
Expand Down

0 comments on commit 64086a9

Please sign in to comment.