]> rtime.felk.cvut.cz Git - omk.git/commitdiff
Bitmap figures included in HTML documentation.
authorMichal Sojka <sojkam1@fel.cvut.cz>
Tue, 23 Oct 2007 12:52:00 +0000 (12:52 +0000)
committerMichal Sojka <sojkam1@fel.cvut.cz>
Tue, 23 Oct 2007 12:52:00 +0000 (12:52 +0000)
darcs-hash:20071023125232-f2ef6-067f54883caec8a4d3e8b1af373834ab8c050a96.gz

doc/Makefile

index 3736edc7f0edef5f10bf573b1ab78910c7b44a1d..a3b2e1acd381939a670c787b394c53efb256c044 100644 (file)
@@ -15,11 +15,13 @@ PDF_FIGS = $(patsubst %.png,%.pdf,$(PNG_FIGS))
 %.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: