# HG changeset patch # User Romain PELISSE # Date 1259059489 -3600 # Node ID 44946b10a4b321fa7419637a1af20918f81389f7 # Parent cd06c45e163173583156ff1e5ab168c8c0612fbd# Parent 7ec542fabc3407633f7e59a21d89eaf750f35add merge with André Sintzoff diff -r cd06c45e1631 -r 44946b10a4b3 Makefile --- a/Makefile Mon Sep 21 00:02:10 2009 +0200 +++ b/Makefile Tue Nov 24 11:44:49 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 cd06c45e1631 -r 44946b10a4b3 Makefile.vars.tmpl --- a/Makefile.vars.tmpl Mon Sep 21 00:02:10 2009 +0200 +++ b/Makefile.vars.tmpl Tue Nov 24 11:44:49 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 cd06c45e1631 -r 44946b10a4b3 README --- a/README Mon Sep 21 00:02:10 2009 +0200 +++ b/README Tue Nov 24 11:44:49 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 cd06c45e1631 -r 44946b10a4b3 README.BUILD --- a/README.BUILD Mon Sep 21 00:02:10 2009 +0200 +++ b/README.BUILD Tue Nov 24 11:44:49 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 cd06c45e1631 -r 44946b10a4b3 contrib/hg-package --- a/contrib/hg-package Mon Sep 21 00:02:10 2009 +0200 +++ b/contrib/hg-package Tue Nov 24 11:44:49 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 cd06c45e1631 -r 44946b10a4b3 en/ch12-mq.xml --- a/en/ch12-mq.xml Mon Sep 21 00:02:10 2009 +0200 +++ b/en/ch12-mq.xml Tue Nov 24 11:44:49 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 cd06c45e1631 -r 44946b10a4b3 fr/ch00-preface.xml --- a/fr/ch00-preface.xml Mon Sep 21 00:02:10 2009 +0200 +++ b/fr/ch00-preface.xml Tue Nov 24 11:44:49 2009 +0100 @@ -2,7 +2,7 @@ - Preface + Préface Un conte technique @@ -14,15 +14,15 @@ Bien qu'à cette époque je passais beaucoup de temps à travailler sur les entrailles de Mercurial, je me suis mis à la - rédaction de ce livre parce que ça me semblait être la manière la plus efficace + rédaction de ce livre parce qu'il me semblait la manière la plus efficace d'aider notre logiciel à atteindre un vaste auditoire, toujours avec - l'idée que la gestion de révisions devrait être distribuée par nature. J'ai + l'idée que la gestion de révision devrait être distribuée par nature. J'ai publié ce libre en ligne sous une licence libre pour la même raison : pour diffuser la parole auprès du monde. Il y a un rythme familier à un bon livre sur un logiciel qui ressemble de près au fait de conter une histoire : Pourquoi ceci est ? - Pourquoi ceci est important ? Comment peut il m'aider ? Comment m'en + Pourquoi ceci est important ? Comment peut-il m'aider ? Comment m'en servir ? Dans ce livre, j'essaye de répondre à toutes ces questions pour la gestion de révisions distribuée en général, et pour Mercurial en particulier. @@ -55,23 +55,23 @@ Mes collègues et amis m'ont aidé et assisté de - de nombreuses manières. Cette liste de personne est nécessaire mais très + de nombreuses manières. Cette liste de personnes est forcément très incomplète : Stephen Hahn, Karyn Ritter, Bonnie Corwin, James Vasile, Matt Norwood, Eben Moglen, Bradley Kuhn, Robert Walsh, Jeremy Fitzhardinge, Rachel Chalmers. J'ai conçu ce livre de manière ouverte, en publiant - des brouillons de chapitres du livre sur des site web, au fur et à + des brouillons des chapitres du livre sur des site web, au fur et à mesure que je les réalisais. Leurs lecteurs m'ont fait des retours utilisant l'application web que j'avais développée. A la fin de sa conception, plus de 100 personnes m'avaient fait des commentaires, - un chiffre incroyable quand on considère que ce système de + un chiffre incroyable quand l'on considère que ce système de commentaire n'a tourné que dans les deux derniers mois de la rédaction du livre. J'aimerais particulièrement remercier les personnes suivantes, dont les commentaires représentent plus - d'un tiers de l'ensemble de ces derniers. Je voudrai les + d'un tiers de l'ensemble de ces derniers. Je voudrais les remercier pour leurs attentions et efforts à me faire des retours très détaillés. diff -r cd06c45e1631 -r 44946b10a4b3 fr/ch12-mq.xml --- a/fr/ch12-mq.xml Mon Sep 21 00:02:10 2009 +0200 +++ b/fr/ch12-mq.xml Tue Nov 24 11:44:49 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 cd06c45e1631 -r 44946b10a4b3 it/figs/caution.png Binary file it/figs/caution.png has changed diff -r cd06c45e1631 -r 44946b10a4b3 it/figs/note.png Binary file it/figs/note.png has changed diff -r cd06c45e1631 -r 44946b10a4b3 it/figs/tip.png Binary file it/figs/tip.png has changed diff -r cd06c45e1631 -r 44946b10a4b3 it/figs/warning.png Binary file it/figs/warning.png has changed diff -r cd06c45e1631 -r 44946b10a4b3 plastex-theme/README.txt --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/plastex-theme/README.txt Tue Nov 24 11:44:49 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 cd06c45e1631 -r 44946b10a4b3 plastex-theme/default-layout.html --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/plastex-theme/default-layout.html Tue Nov 24 11:44:49 2009 +0100 @@ -0,0 +1,145 @@ + + + + + + + + + Book title + + + + + + + + + + + + + + + + + + + + + + +
+ +
File contents.
+ +
+ +
+ + +
+

Footnotes

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