Skip to content
This repository has been archived by the owner on Aug 11, 2022. It is now read-only.

Commit

Permalink
html docs
Browse files Browse the repository at this point in the history
  • Loading branch information
isaacs committed Sep 4, 2011
1 parent 3d91260 commit 30818ab
Show file tree
Hide file tree
Showing 62 changed files with 25,684 additions and 3 deletions.
31 changes: 28 additions & 3 deletions Makefile
Expand Up @@ -4,6 +4,10 @@ docs = $(shell find doc -name '*.md' \
|sed 's|.md|.1|g' \
|sed 's|doc/|man1/|g' )

htmldocs = $(shell find doc -name '*.md' \
|sed 's|.md|.html|g' \
|sed 's|doc/|html/doc/|g' ) html/doc/index.html

doc_subfolders = $(shell find doc -type d \
|sed 's|doc/|man1/|g' )

Expand Down Expand Up @@ -39,14 +43,35 @@ man: man1
man1: $(doc_subfolders)
[ -d man1 ] || mkdir -p man1

doc: man1 $(docs)
html/doc: $(doc_subfolders)
[ -d html/doc ] || mkdir -p html/doc

doc: $(docs) $(htmldocs)

# use `npm install ronn` for this to work.
man1/%.1: doc/%.md
man1/%.1: doc/%.md man1
@[ -x ./node_modules/.bin/ronn ] || node cli.js install ronn
./node_modules/.bin/ronn --roff $< > $@

man1/%/: doc/%/
man1/%/: doc/%/ man1
@[ -d $@ ] || mkdir -p $@

# use `npm install ronn` for this to work.
html/doc/%.html: doc/%.md html/dochead.html html/docfoot.html html/doc
@[ -x ./node_modules/.bin/ronn ] || node cli.js install ronn
(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/npm-([^\)]+)\(1\)/<a href="\1.html">npm-\1(1)<\/a>/g' \
| perl -pi -e 's/npm\(1\)/<a href="index.html">npm(1)<\/a>/g' \
> $@

html/doc/index.html: html/doc/npm.html
cp $< $@

html/doc/%/: doc/%/ html/doc
@[ -d $@ ] || mkdir -p $@

test: submodules
Expand Down

0 comments on commit 30818ab

Please sign in to comment.