changeset 693:0b45854f0b7b

Generate and include images properly.
author Bryan O'Sullivan <bos@serpentine.com>
date Thu, 26 Mar 2009 22:00:53 -0700
parents 8dfdbe1cf982
children e0a4ba81f888
files en/Makefile en/appA-cmdref.xml en/ch01-tour-basic.xml en/ch02-tour-merge.xml en/ch03-concepts.xml en/ch05-collab.xml en/ch08-undo.xml en/ch11-mq.xml
diffstat 8 files changed, 52 insertions(+), 56 deletions(-) [+]
line wrap: on
line diff
--- a/en/Makefile	Thu Mar 26 22:00:32 2009 -0700
+++ b/en/Makefile	Thu Mar 26 22:00:53 2009 -0700
@@ -1,28 +1,6 @@
 # This makefile requires GNU make.
 
-image-sources := \
-	feature-branches.dot \
-	filelog.svg \
-	kdiff3.png \
-	metadata.svg \
-	mq-stack.svg \
-	note.png \
-	revlog.svg \
-	snapshot.svg \
-	tour-history.svg \
-	tour-merge-conflict.svg \
-	tour-merge-merge.svg \
-	tour-merge-pull.svg \
-	tour-merge-sep-repos.svg \
-	undo-manual.dot \
-	undo-manual-merge.dot \
-	undo-non-tip.dot \
-	undo-simple.dot \
-	wdir.svg \
-	wdir-after-commit.svg \
-	wdir-branch.svg \
-	wdir-merge.svg \
-	wdir-pre-branch.svg
+image-sources := $(wildcard figs/*.dot figs/*.png figs/*.svg)
 
 xml-src-files := \
 	00book.xml \
@@ -33,7 +11,14 @@
 image-svg := $(filter %.svg,$(image-sources))
 image-png := $(filter %.png,$(image-sources))
 
-image-html := $(image-dot:%.dot=%.png) $(image-svg:%.svg=%.png) $(image-png)
+obj-web := html
+obj-websup := $(obj-web)/support
+obj-web-read := $(obj-web)/read
+
+image-web := \
+	$(image-dot:%.dot=$(obj-web-read)/%.png) \
+	$(image-svg:%.svg=$(obj-web-read)/%.png) \
+	$(image-png:%=$(obj-web-read)/%)
 
 example-sources-by-name := \
 	backout \
@@ -71,9 +56,6 @@
 	$(example-sources-by-name:%=examples/%) \
 	$(wildcard examples/ch*/*)
 
-obj-web := html
-obj-websup := html/support
-
 extras-web-base := \
 	$(obj-web)/index.html \
 	$(obj-web)/robots.txt \
@@ -135,14 +117,16 @@
 
 web: ../xsl/system-xsl websup html
 
-html: ../xsl/system-xsl $(xml-src-files) valid
-	xsltproc $(xsltproc-opts) -o html/read/x ../xsl/chunk-stylesheet.xsl 00book.xml
-	for i in html/read/*.html; do \
+html: $(obj-web-read)/index.html
+
+$(obj-web-read)/index.html: ../xsl/system-xsl .validated-00book.xml
+	xsltproc $(xsltproc-opts) -o $(obj-web-read)/x ../xsl/chunk-stylesheet.xsl 00book.xml
+	for i in $(obj-web-read)/*.html; do \
 	  gzip -9 -c $$i > $$i.gz; \
 	done
 
-websup: $(extras-web)
-	mkdir -p $(obj-websup)/figs
+websup: $(extras-web) $(image-web)
+	mkdir -p $(obj-websup)/figs $(obj-web-read)/figs
 	cp ../xsl/system-xsl/images/*.png $(obj-websup)/figs
 	cp -f ../web/icons/*.png $(obj-websup)/figs
 
@@ -159,12 +143,23 @@
 
 # Produce 90dpi PNGs for the web.
 
-%.png: %.svg fixsvg
+$(obj-web-read)/figs/%.png: $(obj-web-read)/figs/%.svg fixsvg
+	mkdir -p $(dir $@)
 	./fixsvg $<
 	inkscape -D -e $@ $<-tmp.svg
 	rm $<-tmp.svg
 
-%.svg: %.dot
+$(obj-web-read)/figs/%.png: figs/%.svg fixsvg
+	mkdir -p $(dir $@)
+	./fixsvg $<
+	inkscape -D -e $@ $<-tmp.svg
+	rm $<-tmp.svg
+
+$(obj-web-read)/figs/%.png: figs/%.png
+	cp $< $@
+
+$(obj-web-read)/figs/%.svg: figs/%.dot
+	mkdir -p $(dir $@)
 	dot -Tsvg -o $@ $<
 
 examples: $(example-prereqs) examples/.run
--- a/en/appA-cmdref.xml	Thu Mar 26 22:00:32 2009 -0700
+++ b/en/appA-cmdref.xml	Thu Mar 26 22:00:53 2009 -0700
@@ -1,6 +1,7 @@
 <!-- vim: set filetype=docbkxml shiftwidth=2 autoindent expandtab tw=77 : -->
 
 <appendix id="cmdref">
+  <?dbhtml filename="command-reference.html"?>
 <title>Command reference</title>
 
 <para id="x_653">\cmdref{add}{add files at the next commit}
@@ -20,7 +21,7 @@
 
 <sect2>
 <title>Options</title>
-
+x
 <para id="x_657">\loptref{diff}{nodates}</para>
 
 <para id="x_658">Omit date and time information when printing diff headers.</para>
--- a/en/ch01-tour-basic.xml	Thu Mar 26 22:00:32 2009 -0700
+++ b/en/ch01-tour-basic.xml	Thu Mar 26 22:00:53 2009 -0700
@@ -258,7 +258,7 @@
       <title>Graphical history of the <filename
 	  class="directory">hello</filename> repository</title>
       <mediaobject>
-	<imageobject><imagedata fileref="tour-history"/></imageobject>
+	<imageobject><imagedata fileref="figs/tour-history.png"/></imageobject>
 	<textobject><phrase>XXX add text</phrase></textobject>
       </mediaobject>
     </figure>
--- a/en/ch02-tour-merge.xml	Thu Mar 26 22:00:32 2009 -0700
+++ b/en/ch02-tour-merge.xml	Thu Mar 26 22:00:53 2009 -0700
@@ -48,7 +48,7 @@
 	  class="directory">my-new-hello</filename>
 	repositories</title>
       <mediaobject>
-	<imageobject><imagedata fileref="tour-merge-sep-repos"/></imageobject>
+	<imageobject><imagedata fileref="figs/tour-merge-sep-repos.png"/></imageobject>
 	<textobject><phrase>XXX add text</phrase></textobject>
       </mediaobject>
     </figure>
@@ -77,7 +77,7 @@
 	    class="directory">my-new-hello</filename></title>
 	<mediaobject>
 	  <imageobject>
-	    <imagedata fileref="tour-merge-pull"/>
+	    <imagedata fileref="figs/tour-merge-pull.png"/>
 	  </imageobject>
 	  <textobject><phrase>XXX add text</phrase></textobject>
 	</mediaobject>
@@ -124,7 +124,7 @@
 	  following commit</title>
 	<mediaobject>
 	  <imageobject>
-	    <imagedata fileref="tour-merge-merge"/>
+	    <imagedata fileref="figs/tour-merge-merge.png"/>
 	  </imageobject>
 	  <textobject><phrase>XXX add text</phrase></textobject>
 	</mediaobject>
@@ -179,7 +179,7 @@
     <figure id="fig:tour-merge:conflict">
       <title>Conflicting changes to a document</title>
       <mediaobject>
-	<imageobject><imagedata fileref="tour-merge-conflict"/></imageobject>
+	<imageobject><imagedata fileref="figs/tour-merge-conflict.png"/></imageobject>
 	<textobject><phrase>XXX add text</phrase></textobject>
       </mediaobject>
     </figure>
@@ -249,7 +249,7 @@
 	  file</title>
 	<mediaobject>
 	  <imageobject>
-	    <imagedata fileref="kdiff3"/></imageobject>
+	    <imagedata fileref="figs/kdiff3.png"/></imageobject>
 	  <textobject>
 	    <phrase>XXX add text</phrase>
 	  </textobject>
--- a/en/ch03-concepts.xml	Thu Mar 26 22:00:32 2009 -0700
+++ b/en/ch03-concepts.xml	Thu Mar 26 22:00:53 2009 -0700
@@ -53,7 +53,7 @@
 	<title>Relationships between files in working directory and
 	  filelogs in repository</title>
 	<mediaobject>
-	  <imageobject><imagedata fileref="filelog"/></imageobject>
+	  <imageobject><imagedata fileref="figs/filelog.png"/></imageobject>
 	  <textobject><phrase>XXX add text</phrase></textobject>
 	</mediaobject>
       </figure>
@@ -102,7 +102,7 @@
       <figure id="fig:concepts:metadata">
 	<title>Metadata relationships</title>
 	<mediaobject>
-	  <imageobject><imagedata fileref="metadata"/></imageobject>
+	  <imageobject><imagedata fileref="figs/metadata.png"/></imageobject>
 	  <textobject><phrase>XXX add text</phrase></textobject>
 	</mediaobject>
       </figure>
@@ -187,7 +187,7 @@
       <figure id="fig:concepts:snapshot">
 	<title>Snapshot of a revlog, with incremental deltas</title>
 	<mediaobject>
-	  <imageobject><imagedata fileref="snapshot"/></imageobject>
+	  <imageobject><imagedata fileref="figs/snapshot.png"/></imageobject>
 	  <textobject><phrase>XXX add text</phrase></textobject>
 	</mediaobject>
       </figure>
@@ -291,7 +291,7 @@
     <figure id="fig:concepts:revlog">
       <title>The conceptual structure of a revlog</title>
       <mediaobject>
-	<imageobject><imagedata fileref="revlog"/></imageobject>
+	<imageobject><imagedata fileref="figs/revlog.png"/></imageobject>
 	<textobject><phrase>XXX add text</phrase></textobject>
       </mediaobject>
     </figure>
@@ -342,7 +342,7 @@
       <figure id="fig:concepts:wdir">
 	<title>The working directory can have two parents</title>
 	<mediaobject>
-	  <imageobject><imagedata fileref="wdir"/></imageobject>
+	  <imageobject><imagedata fileref="figs/wdir.png"/></imageobject>
 	  <textobject><phrase>XXX add text</phrase></textobject>
 	</mediaobject>
       </figure>
@@ -357,7 +357,7 @@
 	<title>The working directory gains new parents after a
 	  commit</title>
 	<mediaobject>
-	  <imageobject><imagedata fileref="wdir-after-commit"/></imageobject>
+	  <imageobject><imagedata fileref="figs/wdir-after-commit.png"/></imageobject>
 	  <textobject><phrase>XXX add text</phrase></textobject>
 	</mediaobject>
       </figure>
@@ -398,7 +398,7 @@
 	<title>The working directory, updated to an older
 	  changeset</title>
 	<mediaobject>
-	  <imageobject><imagedata fileref="wdir-pre-branch"/></imageobject>
+	  <imageobject><imagedata fileref="figs/wdir-pre-branch.png"/></imageobject>
 	  <textobject><phrase>XXX add text</phrase></textobject>
 	</mediaobject>
       </figure>
@@ -418,7 +418,7 @@
 	<title>After a commit made while synced to an older
 	  changeset</title>
 	<mediaobject>
-	  <imageobject><imagedata fileref="wdir-branch"/></imageobject>
+	  <imageobject><imagedata fileref="figs/wdir-branch.png"/></imageobject>
 	  <textobject><phrase>XXX add text</phrase></textobject>
 	</mediaobject>
       </figure>
@@ -460,7 +460,7 @@
 	<title>Merging two heads</title>
 	<mediaobject>
 	  <imageobject>
-	    <imagedata fileref="wdir-merge"/>
+	    <imagedata fileref="figs/wdir-merge.png"/>
 	  </imageobject>
 	  <textobject><phrase>XXX add text</phrase></textobject>
 	</mediaobject>
--- a/en/ch05-collab.xml	Thu Mar 26 22:00:32 2009 -0700
+++ b/en/ch05-collab.xml	Thu Mar 26 22:00:53 2009 -0700
@@ -272,7 +272,7 @@
       <figure id="fig:collab:feature-branches">
 	<title>Feature branches</title>
 	<mediaobject>
-	  <imageobject><imagedata fileref="feature-branches"/></imageobject>
+	  <imageobject><imagedata fileref="figs/feature-branches.png"/></imageobject>
 	  <textobject><phrase>XXX add text</phrase></textobject>
 	</mediaobject>
       </figure>
--- a/en/ch08-undo.xml	Thu Mar 26 22:00:32 2009 -0700
+++ b/en/ch08-undo.xml	Thu Mar 26 22:00:53 2009 -0700
@@ -361,7 +361,7 @@
 	<title>Backing out a change using the <command
 	    role="hg-cmd">hg backout</command> command</title>
 	<mediaobject>
-	  <imageobject><imagedata fileref="undo-simple"/></imageobject>
+	  <imageobject><imagedata fileref="figs/undo-simple.png"/></imageobject>
 	  <textobject><phrase>XXX add text</phrase></textobject>
 	</mediaobject>
       </figure>
@@ -408,7 +408,7 @@
 	<title>Automated backout of a non-tip change using the
 	  <command role="hg-cmd">hg backout</command> command</title>
 	<mediaobject>
-	  <imageobject><imagedata fileref="undo-non-tip"/></imageobject>
+	  <imageobject><imagedata fileref="figs/undo-non-tip.png"/></imageobject>
 	  <textobject><phrase>XXX add text</phrase></textobject>
 	</mediaobject>
       </figure>
@@ -473,7 +473,7 @@
 	<title>Backing out a change using the <command
 	    role="hg-cmd">hg backout</command> command</title>
 	<mediaobject>
-	  <imageobject><imagedata fileref="undo-manual"/></imageobject>
+	  <imageobject><imagedata fileref="figs/undo-manual.png"/></imageobject>
 	  <textobject><phrase>XXX add text</phrase></textobject>
 	</mediaobject>
       </figure>
@@ -511,7 +511,7 @@
       <figure id="fig:undo:backout-manual-merge">
 	<title>Manually merging a backout change</title>
 	<mediaobject>
-	  <imageobject><imagedata fileref="undo-manual-merge"/></imageobject>
+	  <imageobject><imagedata fileref="figs/undo-manual-merge.png"/></imageobject>
 	  <textobject><phrase>XXX add text</phrase></textobject>
 	</mediaobject>
       </figure>
--- a/en/ch11-mq.xml	Thu Mar 26 22:00:32 2009 -0700
+++ b/en/ch11-mq.xml	Thu Mar 26 22:00:53 2009 -0700
@@ -408,7 +408,7 @@
 	<title>Applied and unapplied patches in the MQ patch
 	  stack</title>
 	<mediaobject>
-	  <imageobject><imagedata fileref="mq-stack"/></imageobject>
+	  <imageobject><imagedata fileref="figs/mq-stack.png"/></imageobject>
 	  <textobject><phrase>XXX add text</phrase></textobject>
 	</mediaobject>
       </figure>