diff options
author | isaacs <i@izs.me> | 2011-09-25 07:58:50 +0400 |
---|---|---|
committer | isaacs <i@izs.me> | 2011-09-25 07:58:50 +0400 |
commit | 308dd4254715f7845a1d2f84b05bc51cfb018890 (patch) | |
tree | b078d210051b6eacbeff16cb56d2fd060400a090 /Makefile | |
parent | a726b94c66d918a276c1acd8112ce4659809d152 (diff) | |
parent | 12e22fb2709f73fa9300ea81e3ac5b5620870492 (diff) |
Merge branch 'api-doc' into api-doc2
Conflicts:
Makefile
doc/cli/find.md
lib/help.js
man/man1/adduser.1
man/man1/bin.1
man/man1/build.1
man/man1/bundle.1
man/man1/cache.1
man/man1/changelog.1
man/man1/coding-style.1
man/man1/completion.1
man/man1/config.1
man/man1/developers.1
man/man1/docs.1
man/man1/faq.1
man/man1/find.1
man/man1/folders.1
man/man1/get.1
man/man1/global.1
man/man1/help-search.1
man/man1/home.1
man/man1/init.1
man/man1/install.1
man/man1/json.1
man/man1/link.1
man/man1/ln.1
man/man1/npm.1
man/man1/outdated.1
man/man1/prefix.1
man/man1/registry.1
man/man1/removing-npm.1
man/man1/rm.1
man/man1/root.1
man/man1/run-script.1
man/man1/scripts.1
man/man1/search.1
man/man1/semver.1
man/man1/set.1
man/man1/tag.1
man/man1/uninstall.1
man/man1/update.1
man/man1/version.1
man/man1/whoami.1
man/man3/author.3
man/man3/deprecate.3
man/man3/edit.3
man/man3/explore.3
man/man3/list.3
man/man3/ls.3
man/man3/owner.3
man/man3/pack.3
man/man3/prune.3
man/man3/publish.3
man/man3/rebuild.3
man/man3/restart.3
man/man3/start.3
man/man3/stop.3
man/man3/submodule.3
man/man3/test.3
man/man3/unpublish.3
man/man3/view.3
npm.js
Diffstat (limited to 'Makefile')
-rw-r--r-- | Makefile | 77 |
1 files changed, 55 insertions, 22 deletions
@@ -2,22 +2,30 @@ SHELL = bash markdowns = $(shell find doc -name '*.md' | grep -v 'index') README.md -mandocs = $(shell find doc -name '*.md' \ - |grep -v 'index.md' \ - |sed 's|.md|.1|g' \ - |sed 's|doc/|man1/|g' ) \ - man1/README.1 \ - man1/index.1 - -htmldocs = $(shell find doc -name '*.md' \ - |grep -v 'index.md' \ - |sed 's|.md|.html|g' \ - |sed 's|doc/|html/doc/|g' ) \ - html/doc/README.html \ - html/doc/index.html - -doc_subfolders = $(shell find doc -type d \ - |sed 's|doc/|man1/|g' ) +cli_mandocs = $(shell find doc/cli -name '*.md' \ + |sed 's|.md|.1|g' \ + |sed 's|doc/cli/|man/man1/|g' ) \ + man/man1/README.1 \ + man/man1/index.1 + +api_mandocs = $(shell find doc/api -name '*.md' \ + |sed 's|.md|.3|g' \ + |sed 's|doc/api/|man/man3/|g' ) + +cli_htmldocs = $(shell find doc/cli -name '*.md' \ + |grep -v 'index.md' \ + |sed 's|.md|.html|g' \ + |sed 's|doc/cli/|html/doc/|g' ) \ + html/doc/README.html \ + html/doc/index.html + +api_htmldocs = $(shell find doc/api -name '*.md' \ + |sed 's|.md|.html|g' \ + |sed 's|doc/api/|html/api/|g' ) + +mandocs = $(api_mandocs) $(cli_mandocs) + +htmldocs = $(api_htmldocs) $(cli_htmldocs) all: submodules doc @@ -49,26 +57,50 @@ doc: node_modules/ronn $(mandocs) $(htmldocs) docclean: doc-clean doc-clean: - rm -rf node_modules/ronn doc/index.md $(mandocs) $(htmldocs) &>/dev/null || true + rm -rf \ + node_modules/ronn \ + doc/cli/index.md \ + doc/api/index.md \ + $(api_mandocs) \ + $(cli_mandocs) \ + $(api_htmldocs) \ + $(cli_htmldocs) \ + &>/dev/null || true node_modules/ronn: node cli.js install git+https://github.com/isaacs/ronnjs.git # use `npm install ronn` for this to work. -man1/README.1: README.md scripts/doc-build.sh package.json +man/man1/README.1: README.md scripts/doc-build.sh package.json + scripts/doc-build.sh $< $@ + +man/man1/%.1: doc/%.md scripts/doc-build.sh package.json scripts/doc-build.sh $< $@ -man1/%.1: doc/%.md scripts/doc-build.sh package.json +man/man3/%.3: doc/api/%.md man/man3 node_modules/ronn scripts/doc-build.sh $< $@ html/doc/README.html: README.md html/dochead.html html/docfoot.html scripts/doc-build.sh package.json scripts/doc-build.sh $< $@ -html/doc/%.html: doc/%.md html/dochead.html html/docfoot.html scripts/doc-build.sh package.json +html/doc/%.html: doc/cli/%.md html/dochead.html html/docfoot.html scripts/doc-build.sh package.json scripts/doc-build.sh $< $@ -doc/index.md: $(markdowns) scripts/index-build.js scripts/doc-build.sh package.json - node scripts/index-build.js > doc/index.md +html/api/%.html: doc/api/%.md html/dochead.html html/docfoot.html scripts/doc-build.sh package.json + scripts/doc-build.sh $< $@ + +doc/cli/index.md: $(markdowns) scripts/index-build.js scripts/doc-build.sh package.json + node scripts/index-build.js > $@ + +doc: man + +man: $(cli_docs) $(api_docs) + +man/man1: + [ -d man/man1 ] || mkdir -p man/man1 + +man/man3: + [ -d man/man3 ] || mkdir -p man/man3 test: submodules node cli.js test @@ -86,6 +118,7 @@ publish: link docpublish: doc-publish doc-publish: doc rsync -vazu --stats --no-implied-dirs --delete html/doc/ npmjs.org:/var/www/npmjs.org/public/doc + rsync -vazu --stats --no-implied-dirs --delete html/api/ npmjs.org:/var/www/npmjs.org/public/api sandwich: @[ $$(whoami) = "root" ] && (echo "ok"; echo "ham" > sandwich) || echo "make it yourself" |