Patchwork [4,of,5,V3] doc: make man and html from translated documents

login
register
mail settings
Submitter Takumi IINO
Date July 3, 2013, 1:20 p.m.
Message ID <2073ba0c816c4d6cc410.1372857653@iino-no-MacBook-Air.local>
Download mbox | patch
Permalink /patch/1788/
State Accepted
Commit e4318468046154567b252cea773dc1e5553a89a1
Headers show

Comments

Takumi IINO - July 3, 2013, 1:20 p.m.
# HG changeset patch
# User Takumi IINO <trot.thunder@gmail.com>
# Date 1372855783 -32400
#      Wed Jul 03 21:49:43 2013 +0900
# Node ID 2073ba0c816c4d6cc4100ff09d0a0bf318846f83
# Parent  7d62a614cafbf11f33ac21e9d0c24b13d37ea574
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.

Patch

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 @@ 
 Description
 ===========
 
-.. include:: ../mercurial/help/config.txt
+.. include:: hgrc.5.gendoc.txt
 
 Author
 ======