Welcome to mirror list, hosted at ThFree Co, Russian Federation.

github.com/npm/cli.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorisaacs <i@izs.me>2011-09-04 12:49:19 +0400
committerisaacs <i@izs.me>2011-09-04 12:49:19 +0400
commitec668256b78d4960f06afafcbbe89bf720cfa296 (patch)
treefe3e7575a699bbf463f4987dbb792f2c8e0fc61c /Makefile
parent30d98383761fe6ebb2e57f38790c78751332cf2a (diff)
Fold the README into the html doc build
Sadly, this means turning off syntax highlighted code blocks, until ronn has a markdown implementation that supports them.
Diffstat (limited to 'Makefile')
-rw-r--r--Makefile20
1 files changed, 19 insertions, 1 deletions
diff --git a/Makefile b/Makefile
index 940e848f5..a3bf9346d 100644
--- a/Makefile
+++ b/Makefile
@@ -6,7 +6,7 @@ docs = $(shell find doc -name '*.md' \
htmldocs = $(shell find doc -name '*.md' \
|sed 's|.md|.html|g' \
- |sed 's|doc/|html/doc/|g' )
+ |sed 's|doc/|html/doc/|g' ) html/doc/README.html
doc_subfolders = $(shell find doc -type d \
|sed 's|doc/|man1/|g' )
@@ -52,6 +52,22 @@ man1/%.1: doc/%.md
man1/%/: doc/%/
@[ -d $@ ] || mkdir -p $@
+
+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/npm\(1\)/<a href="npm.html">npm<\/a>/g' \
+ | perl -pi -e 's/README/<a href="README.html">README<\/a>/g' \
+ > $@
+
# 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
@@ -65,8 +81,10 @@ html/doc/%.html: doc/%.md html/dochead.html html/docfoot.html
| 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/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 $@