# HG changeset patch # User Romain PELISSE # Date 1258969874 -3600 # Node ID a05a5ae66c38276bc3f5c1bdc6504f8b24b31c55 # Parent 0fba9db5e75c5c445302fce17d2072d91a6916f1# Parent 93154fbaae9bdef74912931bf2513eea8dfcb5b4 merge diff -r 0fba9db5e75c -r a05a5ae66c38 Makefile --- a/Makefile Sat Sep 12 20:53:56 2009 +0200 +++ b/Makefile Mon Nov 23 10:51:14 2009 +0100 @@ -6,7 +6,7 @@ FORMATS=html html-single pdf epub PO_LANGUAGES := zh -DBK_LANGUAGES := en +DBK_LANGUAGES := en it LANGUAGES := $(DBK_LANGUAGES) $(PO_LANGUAGES) UPDATEPO = PERLLIB=$(PO4A_LIB) $(PO4A_HOME)/po4a-updatepo -M UTF-8 \ @@ -22,76 +22,38 @@ #rev_id = $(shell hg parents --template '{node|short} ({date|isodate})') rev_id = $(shell hg parents --template '{node|short} ({date|shortdate})') -images := \ - en/figs/bad-merge-1.png \ - en/figs/bad-merge-2.png \ - en/figs/bad-merge-3.png \ - en/figs/bad-merge-4.png \ - en/figs/bad-merge-5.png \ - en/figs/feature-branches.png \ - en/figs/filelog.png \ - en/figs/metadata.png \ - en/figs/mq-stack.png \ - en/figs/revlog.png \ - en/figs/snapshot.png \ - en/figs/tour-history.png \ - en/figs/tour-merge-conflict.png \ - en/figs/tour-merge-merge.png \ - en/figs/tour-merge-pull.png \ - en/figs/tour-merge-sep-repos.png \ - en/figs/undo-manual-merge.png \ - en/figs/undo-manual.png \ - en/figs/undo-non-tip.png \ - en/figs/undo-simple.png \ - en/figs/wdir-after-commit.png \ - en/figs/wdir-branch.png \ - en/figs/wdir-merge.png \ - en/figs/wdir.png \ - en/figs/wdir-pre-branch.png +images-dot := $(wildcard en/figs/*.dot) + +images-svg := $(wildcard en/figs/*.svg) +images-svg :=$(filter-out %-tmp.svg, $(images-svg)) +images-svg -= $(images-dot:dot=svg) + +images-dst := $(wildcard en/figs/*.png) +images-dst += $(images-dot:dot=png) +images-dst += $(images-svg:svg=png) + +images-gen := $(images-dot:dot=png) +images-gen += $(images-svg:svg=png) +images-gen += $(wildcard en/figs/*-tmp.svg) help: - @echo " make epub [LINGUA=en|zh|...]" - @echo " make html [LINGUA=en|zh|...]" - @echo " make html-single [LINGUA=en|zh|...]" - @echo " make pdf [LINGUA=en|zh|...]" - @echo " make validate [LINGUA=en|zh|...] # always before commit!" + @echo " make epub [LINGUA=en|it|zh|...]" + @echo " make html [LINGUA=en|it|zh|...]" + @echo " make html-single [LINGUA=en|it|zh|...]" + @echo " make pdf [LINGUA=en|it|zh|...]" + @echo " make validate [LINGUA=en|it|zh|...] # always before commit!" @echo " make tidypo [LINGUA=zh|...] # always before commit!" @echo " make updatepo [LINGUA=zh|...] # update po files." - @echo " make all [LINGUA=en|zh|...]" + @echo " make all [LINGUA=en|it|zh|...]" @echo " make stat # print statistics about po files." @echo " make clean # Remove the build files." clean: - @rm -fr build po/*.mo hello en/hello en/html en/.validated-00book.xml en/examples/.run en/examples/results \ - stylesheets/system-xsl en/figs/*-tmp.svg \ - web/index-read.html.in \ - en/figs/bad-merge-1.png \ - en/figs/bad-merge-2.png \ - en/figs/bad-merge-3.png \ - en/figs/bad-merge-4.png \ - en/figs/bad-merge-5.png \ - en/figs/feature-branches.png \ - en/figs/filelog.png \ - en/figs/feature-branches.png \ - en/figs/filelog.png \ - en/figs/metadata.png \ - en/figs/mq-stack.png \ - en/figs/revlog.png \ - en/figs/snapshot.png \ - en/figs/tour-history.png \ - en/figs/tour-merge-conflict.png \ - en/figs/tour-merge-merge.png \ - en/figs/tour-merge-pull.png \ - en/figs/tour-merge-sep-repos.png \ - en/figs/undo-manual-merge.png \ - en/figs/undo-manual.png \ - en/figs/undo-non-tip.png \ - en/figs/undo-simple.png \ - en/figs/wdir-after-commit.png \ - en/figs/wdir-branch.png \ - en/figs/wdir-merge.png \ - en/figs/wdir-pre-branch.png \ - en/figs/wdir.png + @rm -fr build hello po/*.mo /tmp/REV*-hello en/examples/results + + @(for l in $(DBK_LANGUAGES); do \ + rm -fr $(subst en/figs/, $$l/figs/, $(images-gen)) $$l/examples/.run;\ + done) all: ifdef LINGUA @@ -117,8 +79,10 @@ tidypo: ifdef LINGUA + ifneq "$(findstring $(LINGUA),$(PO_LANGUAGES))" "" msgcat --sort-by-file --width=80 po/$(LINGUA).po > po/$(LINGUA).tmp && \ mv po/$(LINGUA).tmp po/$(LINGUA).po; + endif else for po in $(wildcard po/*.po); do \ msgcat --sort-by-file --width=80 $$po > $$po.tmp && mv $$po.tmp $$po; \ @@ -131,13 +95,15 @@ $(MAKE) $@ LINGUA=$$l; \ done else -updatepo: -ifneq "$(findstring $(LINGUA),$(PO_LANGUAGES))" "" +po/$(LINGUA).po: $(wildcard en/*.xml) + ifneq "$(findstring $(LINGUA),$(PO_LANGUAGES))" "" (cd po; \ $(UPDATEPO) -m ../en/00book.xml -p $(LINGUA).po; \ ) $(MAKE) tidypo LINGUA=$(LINGUA) -endif + endif + +updatepo: po/$(LINGUA).po endif ifndef LINGUA @@ -149,24 +115,28 @@ validate: build/$(LINGUA)/source/hgbook.xml xmllint --nonet --noout --postvalid --xinclude $< -ifneq "$(findstring $(LINGUA),$(DBK_LANGUAGES))" "" + ifneq "$(findstring $(LINGUA),$(DBK_LANGUAGES))" "" $(LINGUA)/examples/.run: - (cd $(LINGUA)/examples; ./run-example -v -a) - -build/$(LINGUA)/source/hgbook.xml: $(wildcard $(LINGUA)/*.xml) $(images) $(LINGUA)/examples/.run + if test -x $(LINGUA)/examples/run-example; then \ + (cd $(LINGUA)/examples; ./run-example -a); \ + else \ + touch $@; \ + fi + +build/$(LINGUA)/source/hgbook.xml: $(wildcard $(LINGUA)/*.xml) $(subst en/figs/, $(LINGUA)/figs/, $(images-dst)) $(LINGUA)/examples/.run mkdir -p build/$(LINGUA)/source/figs cp $(LINGUA)/figs/*.png build/$(LINGUA)/source/figs cp stylesheets/hgbook.css build/$(LINGUA)/source (cd $(LINGUA); xmllint --nonet --noent --xinclude --postvalid --output ../$@.tmp 00book.xml) cat $@.tmp | sed 's/\$$rev_id\$$/${rev_id}/' > $@ -else + else en/examples/.run: - (cd en/examples; ./run-example -v -a) + (cd en/examples; ./run-example -a) build/en/source/hgbook.xml: ${MAKE} LINGUA=en $@ -build/$(LINGUA)/source/hgbook.xml: $(wildcard en/*.xml) po/$(LINGUA).po $(images) +build/$(LINGUA)/source/hgbook.xml: $(wildcard en/*.xml) po/$(LINGUA).po $(images-dst) en/examples/.run mkdir -p build/$(LINGUA)/source/figs cp en/figs/*.png build/$(LINGUA)/source/figs cp stylesheets/hgbook.css build/$(LINGUA)/source @@ -174,7 +144,7 @@ xmllint --nonet --noent --xinclude --postvalid --output $@.tmp en/hgbook.xml.$(LINGUA) cat $@.tmp | sed 's/\$$rev_id\$$/${rev_id}/' > $@ mv en/hgbook.xml.$(LINGUA) build/$(LINGUA)/source -endif + endif endif @@ -246,6 +216,17 @@ (cd build/$(LINGUA)/source && $(FOP_HOME)/fop.sh -c $(FOP_HOME)/conf/userconfig.xml hgbook.fo ../pdf/hgbook.pdf) endif +$(LINGUA)/figs/%.png: $(LINGUA)/figs/%.svg + if test -x $(LINGUA)/fixsvg; then \ + $(LINGUA)/fixsvg $<; \ + inkscape -D -d 120 -e $@ $<-tmp.svg; \ + else \ + inkscape -D -d 120 -e $@ $<; \ + fi + +$(LINGUA)/figs/%.svg: $(LINGUA)/figs/%.dot + dot -Tsvg -o $@ $< + en/figs/%.png: en/figs/%.svg en/fixsvg en/fixsvg $< inkscape -D -d 120 -e $@ $<-tmp.svg diff -r 0fba9db5e75c -r a05a5ae66c38 Makefile.vars.tmpl --- a/Makefile.vars.tmpl Sat Sep 12 20:53:56 2009 +0200 +++ b/Makefile.vars.tmpl Mon Nov 23 10:51:14 2009 +0100 @@ -1,20 +1,20 @@ # -# Please create your Makefile.vars file from this template file. +# Please create your Makefile.vars from this template file. # # Please use absolute path, DO NOT use relative path ! # -# po4a (>= 0.36.1): Only for PO based Makefile ! +# po4a (>= 0.36.1): Only for PO based translation ! # po4A_HOME=/usr/bin # PO4A_LIB=/usr/share/perl5 -PO4A_HOME=/home/dongsheng/var/svn/i18n-zh/trunk/lib/po4a +PO4A_HOME=/home/dongsheng/vcs/svn/i18n-zh/trunk/lib/po4a PO4A_LIB=$(PO4A_HOME)/lib # saxon65.jar, saxon65-dbxsl.jar, xml-commons-resolver-1.2.jar: Only for pdf format ! -JAVA_LIB=/home/dongsheng/var/svn/i18n-zh/trunk/lib/share/java +JAVA_LIB=/home/dongsheng/vcs/svn/i18n-zh/trunk/lib/share/java # fop (>= 0.9.6): Only for pdf format ! -FOP_HOME=/home/dongsheng/var/svn/i18n-zh/trunk/lib/fop +FOP_HOME=/home/dongsheng/vcs/svn/i18n-zh/trunk/lib/fop # docbook-xsl (>= 1.74.3): Only for ePub format ! -DB2EPUB=/home/dongsheng/var/svn/i18n-zh/trunk/lib/docbook/docbook-xsl/epub/bin/dbtoepub +DB2EPUB=/home/dongsheng/vcs/svn/i18n-zh/trunk/lib/docbook/docbook-xsl/epub/bin/dbtoepub diff -r 0fba9db5e75c -r a05a5ae66c38 README --- a/README Sat Sep 12 20:53:56 2009 +0200 +++ b/README Mon Nov 23 10:51:14 2009 +0100 @@ -8,9 +8,13 @@ Here's a top-level tour of interesting directories: -en English-language content -es Spanish-language content -examples Miscellaneous example scripts -tools Old, largely unused conversion scripts -web Content and comment system for http://hgbook.red-bean.com/ -xsl XSLT scripts for generating HTML +contrib Miscellaneous scripts +en English-language content (DocBook XML format) +stylesheets XSLT scripts for generating HTML +web Content and comment system for http://hgbook.red-bean.com/ + +po PO based translation Chinese translation + +it Italian translation DocBook XML format +es Spanish translation old tex format +ja Japanese translation old tex format diff -r 0fba9db5e75c -r a05a5ae66c38 README.BUILD --- a/README.BUILD Sat Sep 12 20:53:56 2009 +0200 +++ b/README.BUILD Mon Nov 23 10:51:14 2009 +0100 @@ -16,17 +16,13 @@ I. PRIMER - DocBook has a tortured, confusing history. Before you do anything, - take a look at Eric Raymond's excellent "DocBook Demystification HOWTO": + DocBook has a tortured, confusing history. Before you do anything, + take a look at: - http://tldp.org/HOWTO/DocBook-Demystification-HOWTO/ - - It's very short and clears up many things. - + http://wiki.docbook.org/topic/DocBookTutorials II. COMPILING THE DOCS - 1. Install XML DTD and XSL stylesheets for DocBook % sudo apt-get install docbook-xml docbook-xsl @@ -35,27 +31,44 @@ % sudo apt-get install libxml2-utils -3. Install graph drawing tools +3. Install graph drawing and patches tools - % sudo apt-get install graphviz inkscape + % sudo apt-get install graphviz inkscape patchutils 4. Install pdf support % sudo apt-get install openjdk-6-jdk docbook-xsl-saxon libsaxon-java fop - The Makefile will actually invoke tools/fop/fop.sh, you should do + The Makefile will actually invoke $FOP_HOME/fop.sh, you should do some trick, let fop's CLASSPATH include saxon.jar and docbook-xsl-saxon.jar . -5. Make +5. Configure XML Catalogs + For non pdf output, we use xsltproc for XSLT process, xsltproc use system + catalog files automatically, usually /etc/xml/catalog. Users do not need to + care about it. + + For pdf output, we need use the xsl extensions (docbook-xsl-saxon), so we must + create file $JAVA_LIB/CatalogManager.properties like this: + + catalogs=/etc/xml/catalog + relative-catalogs=true + static-catalog=yes + catalog-class-name=org.apache.xml.resolver.Resolver + verbosity=1 + +6. Create Makefile.vars + Please create your Makefile.vars from Makefile.vars.tmpl . + +7. Make Run 'make' for more details, for example: - * make all document(pdf, html and html-single for all languages) + * make all document(pdf, epub, html and html-single for all languages) % make all - * make english document(pdf, html and html-single for all languages) + * make english document(pdf, epub, html and html-single for all languages) % make LINGUA=en all - * make Chinese document(pdf, html and html-single for all languages) + * make Chinese document(pdf, epub, html and html-single for all languages) % make LINGUA=zh all * make Chinese pdf document @@ -65,24 +78,22 @@ In addition to everything in section II: - -1. Get a nice editing environment for SGML/XML. +1. Get a nice editing environment for XML This isn't strictly required, but it's nice when your editor colorizes things, understands the DTD, tells you what tags you can insert, etc. - If you use emacs, we recommend the PSGML major-mode. Most free + If you use emacs, we recommend the nxml-mode. Most free operating systems package it, or its home page is here: - http://www.lysator.liu.se/projects/about_psgml.html + http://www.emacswiki.org/emacs/NxmlMode If you use vim, you might check out xmledit, at: http://www.vim.org/scripts/script.php?script_id=301 - -2. Get a validating parser. +2. Get a validating parser Actually, if you have what you need to compile the documentation, then you almost certainly have an XML validator installed already - @@ -93,7 +104,7 @@ $ make validate -3. Read about DocBook. +3. Read about DocBook You'll want to get real intimate with a DocBook reference, such as can be found at: http://www.docbook.org/tdg/en/html/ diff -r 0fba9db5e75c -r a05a5ae66c38 contrib/hg-package --- a/contrib/hg-package Sat Sep 12 20:53:56 2009 +0200 +++ b/contrib/hg-package Mon Nov 23 10:51:14 2009 +0100 @@ -1,9 +1,13 @@ #!/bin/sh +# +# Package build results & Upload to i18n-zh +# + build_dir=`dirname "$0"`/../build rev_id=`hg parents --template '{date|shortdate}' | sed 's/-//g'` -for l in en zh; do +for l in en zh it; do ( if [ ! -d "${build_dir}/${l}" ] ; then continue diff -r 0fba9db5e75c -r a05a5ae66c38 en/ch12-mq.xml --- a/en/ch12-mq.xml Sat Sep 12 20:53:56 2009 +0200 +++ b/en/ch12-mq.xml Mon Nov 23 10:51:14 2009 +0100 @@ -438,7 +438,7 @@ qpop each operate on a single patch at a time by default, you can push and pop many patches in one go. The option to + role="hg-ext-mq-cmd-qpush-opt">-a option to qpush causes it to push all unapplied patches, while the option to -f. The exact meaning of depends on the command. For example, hg qnew + role="hg-ext-mq-cmd-qnew-opt">-f will incorporate any outstanding changes into the new patch it creates, but hg qpop + role="hg-ext-mq-cmd-qpop-opt">-f will revert modifications to any files affected by the patch that it is popping. Be sure to read the documentation for a command's option before you use it! @@ -808,9 +808,9 @@ On my old, slow laptop, I was able to hg qpush all + role="hg-ext-mq-cmd-qpush-opt">-a all 1,738 patches in 3.5 minutes, and hg qpop - + them all in 30 seconds. (On a newer laptop, the time to push all patches dropped to two minutes.) I could qrefresh one of the biggest patches @@ -866,7 +866,7 @@ -a your patches, then hg pull changes into the underlying repository, and finally hg qpush your + role="hg-ext-mq-cmd-qpop-opt">-a your patches again. MQ will stop pushing any time it runs across a patch that fails to apply during conflicts, allowing you to fix your conflicts, qrefresh the @@ -1138,9 +1138,9 @@ update changes to patches or the series file, you will have to hg qpop and + role="hg-ext-mq-cmd-qpop-opt">-a and then hg qpush in + role="hg-ext-mq-cmd-qpush-opt">-a in the underlying repository to see those changes show up there. If you forget to do this, you can confuse MQ's idea of which patches are applied. diff -r 0fba9db5e75c -r a05a5ae66c38 fr/ch12-mq.xml --- a/fr/ch12-mq.xml Sat Sep 12 20:53:56 2009 +0200 +++ b/fr/ch12-mq.xml Mon Nov 23 10:51:14 2009 +0100 @@ -438,7 +438,7 @@ qpop each operate on a single patch at a time by default, you can push and pop many patches in one go. The option to + role="hg-ext-mq-cmd-qpush-opt">-a option to qpush causes it to push all unapplied patches, while the option to -f. The exact meaning of depends on the command. For example, hg qnew + role="hg-ext-mq-cmd-qnew-opt">-f will incorporate any outstanding changes into the new patch it creates, but hg qpop + role="hg-ext-mq-cmd-qpop-opt">-f will revert modifications to any files affected by the patch that it is popping. Be sure to read the documentation for a command's option before you use it! @@ -808,9 +808,9 @@ On my old, slow laptop, I was able to hg qpush all + role="hg-ext-mq-cmd-qpush-opt">-a all 1,738 patches in 3.5 minutes, and hg qpop - + them all in 30 seconds. (On a newer laptop, the time to push all patches dropped to two minutes.) I could qrefresh one of the biggest patches @@ -866,7 +866,7 @@ -a your patches, then hg pull changes into the underlying repository, and finally hg qpush your + role="hg-ext-mq-cmd-qpop-opt">-a your patches again. MQ will stop pushing any time it runs across a patch that fails to apply during conflicts, allowing you to fix your conflicts, qrefresh the @@ -1138,9 +1138,9 @@ update changes to patches or the series file, you will have to hg qpop and + role="hg-ext-mq-cmd-qpop-opt">-a and then hg qpush in + role="hg-ext-mq-cmd-qpush-opt">-a in the underlying repository to see those changes show up there. If you forget to do this, you can confuse MQ's idea of which patches are applied. diff -r 0fba9db5e75c -r a05a5ae66c38 it/figs/caution.png Binary file it/figs/caution.png has changed diff -r 0fba9db5e75c -r a05a5ae66c38 it/figs/note.png Binary file it/figs/note.png has changed diff -r 0fba9db5e75c -r a05a5ae66c38 it/figs/tip.png Binary file it/figs/tip.png has changed diff -r 0fba9db5e75c -r a05a5ae66c38 it/figs/warning.png Binary file it/figs/warning.png has changed diff -r 0fba9db5e75c -r a05a5ae66c38 plastex-theme/README.txt --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/plastex-theme/README.txt Mon Nov 23 10:51:14 2009 +0100 @@ -0,0 +1,12 @@ +This is a theme designed to use with the plasTeX page template +renderer to generate commentable documents. + +To "install" it, symlink this folder from the plasTeX XHTML Themes +folder. Example: + +faraday:/usr/lib/pymodules/python2.5/plasTeX/Renderers/XHTML/Themes# +ln -s (this folder) alqua + +Usage example: + +$ plastex --theme=alqua --split-level=0 mylatex.tex diff -r 0fba9db5e75c -r a05a5ae66c38 plastex-theme/default-layout.html --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/plastex-theme/default-layout.html Mon Nov 23 10:51:14 2009 +0100 @@ -0,0 +1,145 @@ + + + + + + + + + Book title + + + + + + + + + + + + + + + + + + + + + + +
+ +
File contents.
+ +
+ +
+ + +
+

Footnotes

+
    +
  1. footnote text
  2. +
+
+ +
+ +