diff --git a/.gitignore b/.gitignore index 2b188b8..00ff297 100644 --- a/.gitignore +++ b/.gitignore @@ -4,3 +4,4 @@ build/ test/test_* nbproject docs/*.html +docs/index.txt diff --git a/docs/Makefile b/docs/Makefile index 5db843b..7cd0d19 100644 --- a/docs/Makefile +++ b/docs/Makefile @@ -1,10 +1,11 @@ ASCIIDOC = asciidoc -HTML_DOCS = api-notify.html strbuf.html xalloc.html +HTML_DOCS = index.html api-notify.html strbuf.html xalloc.html ifndef VERBOSE QUIET_ASCIIDOC = @echo ' ' GEN $@; + QUIET_SCRIPT = @echo ' ' GEN $@; endif .PHONY : clean @@ -14,5 +15,8 @@ html : $(HTML_DOCS) %.html : %.txt $(QUIET_ASCIIDOC)$(ASCIIDOC) -b xhtml11 -o $@ $< +index.txt : + $(QUIET_SCRIPT)$(shell ./genindex.sh index.txt) + clean : - $(RM) $(HTML_DOCS) + $(RM) index.txt $(HTML_DOCS) diff --git a/docs/genindex.sh b/docs/genindex.sh new file mode 100755 index 0000000..8ce3362 --- /dev/null +++ b/docs/genindex.sh @@ -0,0 +1,19 @@ +#!/bin/sh + +if [ $# -lt 1 ]; then + exit 1 +fi + +( + echo "Archived Documentation" + echo "----------------------" + + for DOC in `ls *.txt`; do + if [ "$DOC" = "$1" ]; then + continue + fi + display=$(sed -e 1q "${DOC}") + link=${DOC%.txt}.html + echo "* link:${link}[${display}]" + done +) > $1