Commits

Bryan O'Sullivan committed 0b45854

Generate and include images properly.

  • Participants
  • Parent commits 8dfdbe1

Comments (0)

Files changed (8)

 # 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 \
 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 \
 	$(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 \
 
 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
 
 
 # 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

en/appA-cmdref.xml

 <!-- 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}
 
 <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>

en/ch01-tour-basic.xml

       <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>

en/ch02-tour-merge.xml

 	  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>
 	    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>
 	  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>
     <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>
 	  file</title>
 	<mediaobject>
 	  <imageobject>
-	    <imagedata fileref="kdiff3"/></imageobject>
+	    <imagedata fileref="figs/kdiff3.png"/></imageobject>
 	  <textobject>
 	    <phrase>XXX add text</phrase>
 	  </textobject>

en/ch03-concepts.xml

 	<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>
       <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>
       <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>
     <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>
       <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>
 	<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>
 	<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>
 	<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>
 	<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>

en/ch05-collab.xml

       <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>
 	<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>
 	<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>
 	<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>
       <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>
 	<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>