%.txt: %.texinfo
makeinfo --no-headers --force -o $@ $<
-%.html: %.texinfo
+%.html: %.texinfo Makefile
texi2html --l2h $<
# Fix texinfo HTML output
perl -w -n -e 'if (/<div class="contents">/) {$$toc=1}' \
- -e 'if (!$$toc) { s/class="toc"//}; print' < $@ > $@.tmp
+ -e 'if (!$$toc) { s/class="toc"//}' \
+ -e '@match=/\[ ([^ ]+) \]/; if (@match > 0 && -r $$match[0] . ".png") { s/\[ ([^ ]+) \]/<img src="$$1.png"><\/img>/ }' \
+ -e 'print;' < $@ > $@.tmp
mv $@.tmp $@
clean: