Archived
1
0
Fork 0

docs: index generation

This commit is contained in:
Henrik Hautakoski 2010-11-05 11:13:18 +01:00
parent 15e73d76ab
commit baa6cbb316
3 changed files with 26 additions and 2 deletions

1
.gitignore vendored
View file

@ -4,3 +4,4 @@ build/
test/test_* test/test_*
nbproject nbproject
docs/*.html docs/*.html
docs/index.txt

View file

@ -1,10 +1,11 @@
ASCIIDOC = asciidoc ASCIIDOC = asciidoc
HTML_DOCS = api-notify.html strbuf.html xalloc.html HTML_DOCS = index.html api-notify.html strbuf.html xalloc.html
ifndef VERBOSE ifndef VERBOSE
QUIET_ASCIIDOC = @echo ' ' GEN $@; QUIET_ASCIIDOC = @echo ' ' GEN $@;
QUIET_SCRIPT = @echo ' ' GEN $@;
endif endif
.PHONY : clean .PHONY : clean
@ -14,5 +15,8 @@ html : $(HTML_DOCS)
%.html : %.txt %.html : %.txt
$(QUIET_ASCIIDOC)$(ASCIIDOC) -b xhtml11 -o $@ $< $(QUIET_ASCIIDOC)$(ASCIIDOC) -b xhtml11 -o $@ $<
index.txt :
$(QUIET_SCRIPT)$(shell ./genindex.sh index.txt)
clean : clean :
$(RM) $(HTML_DOCS) $(RM) index.txt $(HTML_DOCS)

19
docs/genindex.sh Executable file
View file

@ -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