diff en/Makefile @ 149:16f02802f448

Start to produce saner HTML and CSS. Drop the "beta" targets for now (forever?).
author Bryan O'Sullivan <bos@serpentine.com>
date Thu, 08 Mar 2007 22:51:50 -0800
parents 65f6f9d18fa1
children cf24633b8de7
line wrap: on
line diff
--- a/en/Makefile	Tue Mar 06 22:00:38 2007 -0800
+++ b/en/Makefile	Thu Mar 08 22:51:50 2007 -0800
@@ -28,6 +28,7 @@
 	kdiff3.png \
 	metadata.svg \
 	mq-stack.svg \
+	note.png \
 	revlog.svg \
 	snapshot.svg \
 	tour-history.svg \
@@ -99,7 +100,11 @@
 pdf/hgbook.pdf: $(sources) $(image-pdf) examples
 	$(call pdf)
 
-html: html/onepage/hgbook.html html/split/hgbook.html
+html: onepage split
+
+onepage: html/onepage/hgbook.html
+
+split: html/split/hgbook.html
 
 # This is a horrible hack to work around the fact that the htlatex
 # command in tex4ht is itself a horrible hack.  I really don't want to
@@ -115,37 +120,23 @@
 	head -3 $(shell which htlatex) >> $(dir $(1))/htlatex.book
 	echo 'echo status $$$$' >>  $(dir $(1))/htlatex.book
 	chmod 755 $(dir $(1))/htlatex.book
-	TEXINPUTS=$(dir $(2)): $(dir $(1))/htlatex.book $(2) "xhtml,html4-uni,$(3)" " -cunihtf -utf8" "" "$(call latex-options,$(1))" || (rm -f $(1); exit 1)
+	TEXINPUTS=$(dir $(2)): $(dir $(1))/htlatex.book $(2) "bookhtml,html4-uni,$(3)" " -cunihtf -utf8" "" "$(call latex-options,$(1))" || (rm -f $(1); exit 1)
 	cd $(dir $(1)) && tex4ht -f/$(basename $(notdir $(1))) -cvalidate -cunihtf
 	cd $(dir $(1)) && t4ht -f/$(basename $(notdir $(1)))
-	perl -pi -e 's/&#x00([0-7][0-9a-f]);/chr(hex($$1))/egi' $(dir $(1))/*.html
+	./fixhtml.py $(dir $(1))/*.html
 endef
 
 image-html := $(image-dot:%.dot=%.png) $(image-svg:%.svg=%.png) $(image-png)
 
-html/onepage/hgbook.html: $(sources) $(image-html) examples
+html/onepage/hgbook.html: $(sources) $(image-html) examples hgbook.css bookhtml.cfg
 	$(call htlatex,$@,$<)
 	cp $(image-sources:%.svg=%.png) $(dir $@)
+	cp hgbook.css $(dir $@)
 
-html/split/hgbook.html: $(sources) $(image-html) examples
+html/split/hgbook.html: $(sources) $(image-html) examples hgbook.css bookhtml.cfg
 	$(call htlatex,$@,$<,2)
 	cp $(image-sources:%.svg=%.png) $(dir $@)
-
-beta: beta/pdf/hgbook.pdf beta/html/onepage/hgbook.html beta/html/split/hgbook.html
-
-beta/%.tex: %.tex
-	./fblinks $(hg_id) $(dir $@) $<
-
-beta/pdf/hgbook.pdf: $(sources:%.tex=beta/%.tex) $(image-sources:%.svg=%.pdf) examples fblinks
-	$(call pdf)
-
-beta/html/onepage/hgbook.html: $(sources:%.tex=beta/%.tex) $(image-sources:%.svg=%.png) examples
-	$(call htlatex,$@,$<)
-	cp $(image-sources:%.svg=%.png) $(dir $@)
-
-beta/html/split/hgbook.html: $(sources:%.tex=beta/%.tex) $(image-sources:%.svg=%.png) examples
-	$(call htlatex,$@,$<,2)
-	cp $(image-sources:%.svg=%.png) $(dir $@)
+	cp hgbook.css $(dir $@)
 
 # Produce 90dpi PNGs for the web.
 
@@ -178,7 +169,7 @@
 	echo -n $(hg_id) > build_id.tex
 
 clean:
-	rm -rf beta html pdf \
+	rm -rf html pdf \
 		$(image-dot:%.dot=%.pdf) \
 		$(image-dot:%.dot=%.png) \
 		$(image-svg:%.svg=%.pdf) \