[PATCH 8 of 9 STABLE? V2] doc: make man and html from translated documents
Takumi IINO
trot.thunder at gmail.com
Wed May 15 02:14:25 CDT 2013
# HG changeset patch
# User Takumi IINO <trot.thunder at gmail.com>
# Date 1368600372 -32400
# Wed May 15 15:46:12 2013 +0900
# Branch stable
# Node ID 766ef8cefc2f7c9cf062f75a90f84cc16e7a3705
# Parent 2b02e7d54cc2f0789445f238b716c90dfdf91e20
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