diff options
author | isaacs <i@izs.me> | 2011-09-04 22:18:22 +0400 |
---|---|---|
committer | isaacs <i@izs.me> | 2011-09-04 22:18:22 +0400 |
commit | bf4646091ab881b15a45d0f08358c6afd8317f59 (patch) | |
tree | f44261b2b78962c17eb48dd4e28bb4588f79f7d9 /Makefile | |
parent | f2a2b3e6edf6a798313c73c71714fc0a89026c35 (diff) |
Abstract doc building to a separate script
Diffstat (limited to 'Makefile')
-rw-r--r-- | Makefile | 54 |
1 files changed, 13 insertions, 41 deletions
@@ -41,50 +41,18 @@ uninstall: submodules doc: $(docs) $(htmldocs) # use `npm install ronn` for this to work. -man1/%.1: doc/%.md - @[ -x ./node_modules/.bin/ronn ] || node cli.js install ronn - @[ -d man1 ] || mkdir -p man1 - ./node_modules/.bin/ronn --roff $< \ - | perl -pi -e 's/npm\\-([^\(]*)\([0-9]\)/npm help \1/g' \ - | perl -pi -e 's/npm\([0-9]\)/npm help npm/g' \ - > $@ - -man1/%/: doc/%/ - @[ -d $@ ] || mkdir -p $@ +man1/README.1: README.md + scripts/doc-build.sh $< $@ +man1/%.1: doc/%.md + scripts/doc-build.sh $< $@ html/doc/README.html: README.md html/dochead.html html/docfoot.html - @[ -x ./node_modules/.bin/ronn ] || node cli.js install ronn - @[ -d html/doc ] || mkdir -p html/doc - (cat html/dochead.html && \ - ./node_modules/.bin/ronn -f $< && \ - cat html/docfoot.html )\ - | sed 's|@NAME@|$*|g' \ - | sed 's|@DATE@|$(shell date -u +'%Y-%M-%d %H:%m:%S')|g' \ - | perl -pi -e 's/<h1>npm(-?[^\(]*\([0-9]\)) -- (.*?)<\/h1>/<h1>npm\1<\/h1> <p>\2<\/p>/g' \ - | perl -pi -e 's/npm-?([^\)]+)\(1\)/<a href="\1.html">npm \1<\/a>/g' \ - | perl -pi -e 's/npm\(1\)/<a href="npm.html">npm<\/a>/g' \ - | perl -pi -e 's/README/<a href="README.html">README<\/a>/g' \ - > $@ + scripts/doc-build.sh $< $@ -# use `npm install ronn` for this to work. html/doc/%.html: doc/%.md html/dochead.html html/docfoot.html - @[ -x ./node_modules/.bin/ronn ] || node cli.js install ronn - @[ -d html/doc ] || mkdir -p html/doc - (cat html/dochead.html && \ - ./node_modules/.bin/ronn -f $< && \ - cat html/docfoot.html )\ - | sed 's|@NAME@|$*|g' \ - | sed 's|@DATE@|$(shell date -u +'%Y-%M-%d %H:%m:%S')|g' \ - | perl -pi -e 's/<h1>npm(-?[^\(]*\([0-9]\)) -- (.*?)<\/h1>/<h1>npm\1<\/h1> <p>\2<\/p>/g' \ - | perl -pi -e 's/npm-?([^\)]*)\(1\)/<a href="\1.html">npm \1<\/a>/g' \ - | perl -pi -e 's/npm\(1\)/<a href="npm.html">npm<\/a>/g' \ - | perl -pi -e 's/README/<a href="README.html">README<\/a>/g' \ - > $@ - - -html/doc/%/: doc/%/ html/doc - @[ -d $@ ] || mkdir -p $@ + scripts/doc-build.sh $< $@ + test: submodules node cli.js test @@ -96,6 +64,10 @@ version: link publish: link git tag -s -m v$(shell npm -v) v$(shell npm -v) &&\ git push origin master &&\ - npm publish + npm publish &&\ + make doc-publish + +doc-publish: doc + rsync -vazu --stats --no-implied-dirs --delete html/doc/ npmjs.org:/var/www/npmjs.org/public/doc -.PHONY: latest install dev link doc clean uninstall test man +.PHONY: latest install dev link doc clean uninstall test man doc-publish |