diff doc/manual/Makefile.generic @ 72:2b89d8497aad

- html manual work
author cslag
date Sun, 13 Mar 2016 21:08:59 +0100
parents edc2afc17aa0
children a59ae4370202
line wrap: on
line diff
--- a/doc/manual/Makefile.generic	Mon Mar 07 01:45:36 2016 +0100
+++ b/doc/manual/Makefile.generic	Sun Mar 13 21:08:59 2016 +0100
@@ -2,9 +2,24 @@
 
 sources: *.tex callconvs/*.tex dyncall_logo.* dyncall_watermark.*
 
-manual.pdf: sources
-	# run twice for toc on some tex installs
-	cd "${VPATH}" && for i in 1 2; do pdflatex -output-directory="${PWD}" manual.tex; done
+pdf: manual.pdf
+
+html:: html/manual.html
+#html-single: html/manual.html
+#html-split: html/manual.html
+
+clean:
+	# pdf
+	cd "${VPATH}" && for i in pdf aux lof log lol lot out toc; do rm -f manual.$$i || true; done
+	# html
+	cd "${VPATH}" && ( \
+		for i in 4ct 4tc css dvi html idv lg tmp xref; do rm -f manual.$$i || true; done; \
+		for i in manual*x.png manual*.html texput.log manual_*.log zzmanual.eps zzmanual.ps custom_tex4ht.env; do rm -f $$i || true; done; \
+		rm -r html || true; \
+	)
+
+
+# Main target dependencies --->
 
 manual_website_menu.html:
 	curl -s http://www.dyncall.org | sed '/<body>/,/<div class="mainDiv">/p;d' | sed 's/^.*<body>//;s/<div class="mainDiv">.*$$//' > $@
@@ -15,24 +30,16 @@
 		cp $$(dirname $$(which tex4ht))/../share/texmf-dist/tex4ht/base/unix/tex4ht.env ./custom_tex4ht.env; \
 		sed -E -i '' 's/(Text|Graphics)(AlphaBits)=[1,2,3]([^0-9])/\1\2=4\3/g' custom_tex4ht.env; \
 		mkdir -p ./html/; \
-		htlatex manual.tex manual_tex4ht " -cunihtf -e./custom_tex4ht.env -utf8" -d./html/; \
+		htlatex manual.tex manual_tex4ht " -cunihtf -e./custom_tex4ht.env -utf8" "-e./custom_tex4ht.env -d./html/"; \
 		rm ./html/*.css; \
 	)
-	# Inject menu into output html pages.
+	# Postprocessing. Inject menu into output html pages. Replace some pieces, etc..
 	for f in "${VPATH}/html/"*.html; do \
 		sed -i '' '/^<body>/r manual_website_menu.html' "$$f"; \
+		sed -E -i '' $$'s/([[:space:]]class=["\'])lstlisting(["\'])/\\1ttDiv\\2/' "$$f"; \
 	done
 
-pdf: manual.pdf
-
-html:: html/manual.html
+manual.pdf: sources
+	# run twice for toc on some tex installs
+	cd "${VPATH}" && for i in 1 2; do pdflatex -output-directory="${PWD}" manual.tex; done
 
-clean:
-	# pdf
-	cd "${VPATH}" && for i in pdf aux lof log lol lot out toc; do rm -f manual.$$i || true; done
-	# html
-	cd "${VPATH}" && ( \
-		for i in 4ct 4tc css dvi html idv lg tmp xref; do rm -f manual.$$i || true; done; \
-		for i in manual*x.png manual*.html texput.log manual_*.log zzmanual.eps zzmanual.ps custom_tex4ht.env; do rm -f $$i || true; done; \
-		rm -r html || true; \
-	)