changeset 71:edc2afc17aa0

- more html doc work
author cslag
date Mon, 07 Mar 2016 01:45:36 +0100
parents 33c333ec5ad2
children 2b89d8497aad
files doc/manual/Makefile.generic doc/manual/manual_tex4ht.cfg
diffstat 2 files changed, 9 insertions(+), 2 deletions(-) [+]
line wrap: on
line diff
--- a/doc/manual/Makefile.generic	Sun Mar 06 23:30:44 2016 +0100
+++ b/doc/manual/Makefile.generic	Mon Mar 07 01:45:36 2016 +0100
@@ -6,7 +6,10 @@
 	# run twice for toc on some tex installs
 	cd "${VPATH}" && for i in 1 2; do pdflatex -output-directory="${PWD}" manual.tex; done
 
-html/manual.html: manual_tex4ht.cfg sources
+manual_website_menu.html:
+	curl -s http://www.dyncall.org | sed '/<body>/,/<div class="mainDiv">/p;d' | sed 's/^.*<body>//;s/<div class="mainDiv">.*$$//' > $@
+
+html/manual.html: manual_tex4ht.cfg manual_website_menu.html sources
 	# Create tex4ht.env from default one, but with better bitmaps
 	cd "${VPATH}" &&  ( \
 		cp $$(dirname $$(which tex4ht))/../share/texmf-dist/tex4ht/base/unix/tex4ht.env ./custom_tex4ht.env; \
@@ -15,6 +18,10 @@
 		htlatex manual.tex manual_tex4ht " -cunihtf -e./custom_tex4ht.env -utf8" -d./html/; \
 		rm ./html/*.css; \
 	)
+	# Inject menu into output html pages.
+	for f in "${VPATH}/html/"*.html; do \
+		sed -i '' '/^<body>/r manual_website_menu.html' "$$f"; \
+	done
 
 pdf: manual.pdf
 
--- a/doc/manual/manual_tex4ht.cfg	Sun Mar 06 23:30:44 2016 +0100
+++ b/doc/manual/manual_tex4ht.cfg	Mon Mar 07 01:45:36 2016 +0100
@@ -35,7 +35,7 @@
 \Configure{VERSION}{}
 \Configure{DOCTYPE}{\HCode{<!DOCTYPE html>\Hnewline}}
 \Configure{HTML}{\HCode{<html>\Hnewline}}{\HCode{\Hnewline</html>}}
-\Configure{BODY}{\HCode{<body><div class="mainDiv">\Hnewline}}{\HCode{\Hnewline</div></body>}}
+\Configure{BODY}{\HCode{\Hnewline<body>\Hnewline<div class="mainDiv">\Hnewline}}{\HCode{\Hnewline</div></body>}} % KEEP the body on it's own line, as it's used as a marker for postprocessing.
 
 % TITLE+ is only on main page, other use section title. Prefix everything, though.
 \Configure{TITLE}{\HCode{<title>}dyncall Manual - }{\HCode{</title>}}