doc: build branch versioned docs

pull/23395/head
Timothy J Fontaine 2014-10-13 13:09:17 -07:00
parent 2b7c8a2f02
commit 641cea0926
2 changed files with 12 additions and 3 deletions

View File

@ -146,6 +146,9 @@ website_files = \
doc: $(apidoc_dirs) $(website_files) $(apiassets) $(apidocs) tools/doc/ out/doc/changelog.html node
doc-branch: NODE_DOC_VERSION = v$(shell $(PYTHON) tools/getnodeversion.py | cut -f1,2 -d.)
doc-branch: doc
$(apidoc_dirs):
mkdir -p $@
@ -159,10 +162,10 @@ out/doc/%: doc/%
cp -r $< $@
out/doc/api/%.json: doc/api/%.markdown node
out/Release/node tools/doc/generate.js --format=json $< > $@
NODE_DOC_VERSION=$(NODE_DOC_VERSION) out/Release/node tools/doc/generate.js --format=json $< > $@
out/doc/api/%.html: doc/api/%.markdown node
out/Release/node tools/doc/generate.js --format=html --template=doc/template.html $< > $@
NODE_DOC_VERSION=$(NODE_DOC_VERSION) out/Release/node 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' > $@
@ -181,6 +184,11 @@ website-upload: doc
rm -f ~/web/nodejs.org/dist/node-latest.tar.gz &&\
ln -s $(VERSION)/node-$(VERSION).tar.gz ~/web/nodejs.org/dist/node-latest.tar.gz'
doc-branch-upload: NODE_DOC_VERSION = v$(shell $(PYTHON) tools/getnodeversion.py | cut -f1,2 -d.)
doc-branch-upload: doc-branch
echo $(NODE_DOC_VERSION)
rsync -r out/doc/api/ node@nodejs.org:~/web/nodejs.org/api/$(NODE_DOC_VERSION)
docopen: out/doc/api/all.html
-google-chrome out/doc/api/all.html
@ -189,6 +197,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)

View File

@ -48,7 +48,7 @@ function render(lexed, filename, template, cb) {
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);
// content has to be the last thing we do with