[PATCH 8 of 9 STABLE?] doc: make man and html from translated documents

Takumi IINO trot.thunder at gmail.com
Tue May 14 02:29:17 CDT 2013


# HG changeset patch
# User Takumi IINO <trot.thunder at gmail.com>
# Date 1368513072 -32400
#      Tue May 14 15:31:12 2013 +0900
# Branch stable
# Node ID 1c0b5e0eba2d7be1bd30dac1813be09d51e041d7
# Parent  42006f62aa28528210c58d71b2a286507d3de62f
doc: make man and html from translated documents

Before this patch, man and html are english only, and there sources are not
translatable.
This patch make translatable all documents.

diff --git a/.hgignore b/.hgignore
--- a/.hgignore
+++ b/.hgignore
@@ -25,7 +25,9 @@
 build
 contrib/hgsh/hgsh
 dist
+doc/common.txt
 doc/*.[0-9]
+doc/*.[0-9].txt
 doc/*.[0-9].gendoc.txt
 doc/*.[0-9].{x,ht}ml
 MANIFEST
diff --git a/doc/Makefile b/doc/Makefile
--- a/doc/Makefile
+++ b/doc/Makefile
@@ -1,4 +1,4 @@
-SOURCES=$(wildcard *.[0-9].txt)
+SOURCES=$(notdir $(wildcard ../mercurial/help/*.[0-9].txt))
 MAN=$(SOURCES:%.txt=%)
 HTML=$(SOURCES:%.txt=%.html)
 GENDOC=gendoc.py ../mercurial/commands.py ../mercurial/help.py \
@@ -18,22 +18,15 @@
 
 html: $(HTML)
 
-hg.1.txt: hg.1.gendoc.txt
-	touch hg.1.txt
-
-hg.1.gendoc.txt: $(GENDOC)
-	${PYTHON} gendoc.py hg.1.gendoc > $@.tmp
+common.txt $(SOURCES) $(SOURCES:%.txt=%.gendoc.txt): $(GENDOC)
+	${PYTHON} gendoc.py $(basename $@) > $@.tmp
 	mv $@.tmp $@
 
-hgrc.5: ../mercurial/help/config.txt
-
-hgrc.5.html: ../mercurial/help/config.txt
-
-%: %.txt common.txt
+%: %.txt %.gendoc.txt common.txt
 	$(PYTHON) runrst hgmanpage $(RSTARGS) --halt warning \
 	  --strip-elements-with-class htmlonly $*.txt $*
 
-%.html: %.txt common.txt
+%.html: %.txt %.gendoc.txt common.txt
 	$(PYTHON) runrst html $(RSTARGS) --halt warning \
 	  --link-stylesheet --stylesheet-path style.css $*.txt $*.html
 
@@ -52,4 +45,4 @@
 	done
 
 clean:
-	$(RM) $(MAN) $(HTML) hg.1.gendoc.txt MANIFEST
+	$(RM) $(MAN) $(HTML) common.txt $(SOURCES) $(SOURCES:%.txt=%.gendoc.txt) MANIFEST
diff --git a/doc/common.txt b/mercurial/help/common.txt
rename from doc/common.txt
rename to mercurial/help/common.txt
diff --git a/doc/hg.1.txt b/mercurial/help/hg.1.txt
rename from doc/hg.1.txt
rename to mercurial/help/hg.1.txt
diff --git a/doc/hgignore.5.txt b/mercurial/help/hgignore.5.txt
rename from doc/hgignore.5.txt
rename to mercurial/help/hgignore.5.txt
--- a/doc/hgignore.5.txt
+++ b/mercurial/help/hgignore.5.txt
@@ -11,7 +11,7 @@
 :Manual section: 5
 :Manual group:   Mercurial Manual
 
-.. include:: ../mercurial/help/hgignore.txt
+.. include:: hgignore.5.gendoc.txt
 
 Author
 ======
diff --git a/doc/hgrc.5.txt b/mercurial/help/hgrc.5.txt
rename from doc/hgrc.5.txt
rename to mercurial/help/hgrc.5.txt
--- a/doc/hgrc.5.txt
+++ b/mercurial/help/hgrc.5.txt
@@ -19,7 +19,7 @@
 Synopsis
 ========
 
-.. include:: ../mercurial/help/config.txt
+.. include:: hgrc.5.gendoc.txt
 
 Author
 ======


More information about the Mercurial-devel mailing list