Skip to content

Commit

Permalink
doc: stop building HTML partials
Browse files Browse the repository at this point in the history
This reverts commit 8b58ad0.

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: npm/npm#9201
  • Loading branch information
isaacs authored and iarna committed Aug 21, 2015
1 parent de7c872 commit d73cdba
Show file tree
Hide file tree
Showing 3 changed files with 17 additions and 79 deletions.
1 change: 0 additions & 1 deletion .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,6 @@ npm-debug.log
/test/root
/node_modules/.bin
/html/api/
/html/partial/
/html/doc/
/man/
/doc/*/npm-index.md
Expand Down
84 changes: 15 additions & 69 deletions Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -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' ) \
Expand All @@ -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
Expand All @@ -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
Expand Down Expand Up @@ -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:
Expand Down
11 changes: 2 additions & 9 deletions scripts/doc-build.sh
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down

0 comments on commit d73cdba

Please sign in to comment.