diff options
author | isaacs <i@izs.me> | 2015-08-07 07:48:41 +0300 |
---|---|---|
committer | Rebecca Turner <me@re-becca.org> | 2015-08-21 04:58:22 +0300 |
commit | d73cdba9784a6ee9e228cd77ff123a9f3abc9719 (patch) | |
tree | b24a687aa6f44bcd9fccffb417e6dcbd66a3b25b | |
parent | de7c872d75e4e77afe4ad612fac387ce31b0d7db (diff) |
doc: stop building HTML partials
This reverts commit 8b58ad09b719295461167a34f666c5aa4d6e26f2.
As it turned out, those partial docs aren't actually used by the
http://docs.npmjs.com site, so there's no sense slowing down the build.
PR-URL: https://github.com/npm/npm/pull/9201
-rw-r--r-- | .gitignore | 1 | ||||
-rw-r--r-- | Makefile | 84 | ||||
-rwxr-xr-x | scripts/doc-build.sh | 11 |
3 files changed, 17 insertions, 79 deletions
diff --git a/.gitignore b/.gitignore index 3f8913ac0..0793bf14f 100644 --- a/.gitignore +++ b/.gitignore @@ -8,7 +8,6 @@ npm-debug.log /test/root /node_modules/.bin /html/api/ -/html/partial/ /html/doc/ /man/ /doc/*/npm-index.md @@ -31,28 +31,6 @@ misc_mandocs = $(shell find doc/misc -name '*.md' \ |sed 's|doc/misc/|man/man7/|g' ) \ man/man7/npm-index.7 - -cli_partdocs = $(shell find doc/cli -name '*.md' \ - |sed 's|.md|.html|g' \ - |sed 's|doc/cli/|html/partial/doc/cli/|g' ) \ - html/partial/doc/README.html - -api_partdocs = $(shell find doc/api -name '*.md' \ - |sed 's|.md|.html|g' \ - |sed 's|doc/api/|html/partial/doc/api/|g' ) - -files_partdocs = $(shell find doc/files -name '*.md' \ - |sed 's|.md|.html|g' \ - |sed 's|doc/files/|html/partial/doc/files/|g' ) \ - html/partial/doc/files/npm-json.html \ - html/partial/doc/files/npm-global.html - -misc_partdocs = $(shell find doc/misc -name '*.md' \ - |sed 's|.md|.html|g' \ - |sed 's|doc/misc/|html/partial/doc/misc/|g' ) \ - html/partial/doc/index.html - - cli_htmldocs = $(shell find doc/cli -name '*.md' \ |sed 's|.md|.html|g' \ |sed 's|doc/cli/|html/doc/cli/|g' ) \ @@ -75,8 +53,6 @@ misc_htmldocs = $(shell find doc/misc -name '*.md' \ mandocs = $(api_mandocs) $(cli_mandocs) $(files_mandocs) $(misc_mandocs) -partdocs = $(api_partdocs) $(cli_partdocs) $(files_partdocs) $(misc_partdocs) - htmldocs = $(api_htmldocs) $(cli_htmldocs) $(files_htmldocs) $(misc_htmldocs) all: doc @@ -103,7 +79,7 @@ clean: markedclean marked-manclean doc-clean uninstall uninstall: node cli.js rm npm -g -f -doc: $(mandocs) $(htmldocs) $(partdocs) +doc: $(mandocs) $(htmldocs) markedclean: rm -rf node_modules/marked node_modules/.bin/marked .building_marked @@ -143,73 +119,43 @@ man/man5/%.5: doc/files/%.md scripts/doc-build.sh package.json @[ -d man/man5 ] || mkdir -p man/man5 scripts/doc-build.sh $< $@ -man/man7/%.7: doc/misc/%.md scripts/doc-build.sh package.json - @[ -d man/man7 ] || mkdir -p man/man7 - scripts/doc-build.sh $< $@ - - doc/misc/npm-index.md: scripts/index-build.js package.json node scripts/index-build.js > $@ - -# html/doc depends on html/partial/doc -html/doc/%.html: html/partial/doc/%.html - @[ -d html/doc ] || mkdir -p html/doc - scripts/doc-build.sh $< $@ - -html/doc/README.html: html/partial/doc/README.html +html/doc/index.html: doc/misc/npm-index.md $(html_docdeps) @[ -d html/doc ] || mkdir -p html/doc scripts/doc-build.sh $< $@ -html/doc/cli/%.html: html/partial/doc/cli/%.html - @[ -d html/doc/cli ] || mkdir -p html/doc/cli +man/man7/%.7: doc/misc/%.md scripts/doc-build.sh package.json + @[ -d man/man7 ] || mkdir -p man/man7 scripts/doc-build.sh $< $@ -html/doc/misc/%.html: html/partial/doc/misc/%.html - @[ -d html/doc/misc ] || mkdir -p html/doc/misc +html/doc/README.html: README.md $(html_docdeps) + @[ -d html/doc ] || mkdir -p html/doc scripts/doc-build.sh $< $@ -html/doc/files/%.html: html/partial/doc/files/%.html - @[ -d html/doc/files ] || mkdir -p html/doc/files +html/doc/cli/%.html: doc/cli/%.md $(html_docdeps) + @[ -d html/doc/cli ] || mkdir -p html/doc/cli scripts/doc-build.sh $< $@ -html/doc/api/%.html: html/partial/doc/api/%.html +html/doc/api/%.html: doc/api/%.md $(html_docdeps) @[ -d html/doc/api ] || mkdir -p html/doc/api scripts/doc-build.sh $< $@ - -html/partial/doc/index.html: doc/misc/npm-index.md $(html_docdeps) - @[ -d html/partial/doc ] || mkdir -p html/partial/doc - scripts/doc-build.sh $< $@ - -html/partial/doc/README.html: README.md $(html_docdeps) - @[ -d html/partial/doc ] || mkdir -p html/partial/doc - scripts/doc-build.sh $< $@ - -html/partial/doc/cli/%.html: doc/cli/%.md $(html_docdeps) - @[ -d html/partial/doc/cli ] || mkdir -p html/partial/doc/cli - scripts/doc-build.sh $< $@ - -html/partial/doc/api/%.html: doc/api/%.md $(html_docdeps) - @[ -d html/partial/doc/api ] || mkdir -p html/partial/doc/api - scripts/doc-build.sh $< $@ - -html/partial/doc/files/npm-json.html: html/partial/doc/files/package.json.html +html/doc/files/npm-json.html: html/doc/files/package.json.html cp $< $@ -html/partial/doc/files/npm-global.html: html/partial/doc/files/npm-folders.html +html/doc/files/npm-global.html: html/doc/files/npm-folders.html cp $< $@ -html/partial/doc/files/%.html: doc/files/%.md $(html_docdeps) - @[ -d html/partial/doc/files ] || mkdir -p html/partial/doc/files +html/doc/files/%.html: doc/files/%.md $(html_docdeps) + @[ -d html/doc/files ] || mkdir -p html/doc/files scripts/doc-build.sh $< $@ -html/partial/doc/misc/%.html: doc/misc/%.md $(html_docdeps) - @[ -d html/partial/doc/misc ] || mkdir -p html/partial/doc/misc +html/doc/misc/%.html: doc/misc/%.md $(html_docdeps) + @[ -d html/doc/misc ] || mkdir -p html/doc/misc scripts/doc-build.sh $< $@ - - marked: node_modules/.bin/marked node_modules/.bin/marked: diff --git a/scripts/doc-build.sh b/scripts/doc-build.sh index 6a5c7aa70..61819028b 100755 --- a/scripts/doc-build.sh +++ b/scripts/doc-build.sh @@ -103,22 +103,15 @@ case $dest in | man_replace_tokens > $dest exit $? ;; - - html/partial/*.html) - url=${dest/html\/partial\//} - cat $src | ./node_modules/.bin/marked | html_replace_tokens $url > $dest - ;; - - html/*.html) + *.html) url=${dest/html\//} (cat html/dochead.html && \ - cat $src && \ + cat $src | ./node_modules/.bin/marked && cat html/docfoot.html)\ | html_replace_tokens $url \ > $dest exit $? ;; - *) echo "Invalid destination type: $dest" >&2 exit 1 |