Mercurial > hg
comparison doc/gendoc.py @ 9485:7d6ac5d7917c
test-gendoc: add tests for all languages
This ensures that we catch errors in the reST syntax early and for all
languages. The only change needed in gendoc.py was to correct the
computation of section underlines for Asian languages.
author | Martin Geisler <mg@lazybytes.net> |
---|---|
date | Sun, 27 Sep 2009 10:12:02 +0200 |
parents | c96d73dd956d |
children | 9d1a480ca6ea |
comparison
equal
deleted
inserted
replaced
9484:c96d73dd956d | 9485:7d6ac5d7917c |
---|---|
2 # import from the live mercurial repo | 2 # import from the live mercurial repo |
3 sys.path.insert(0, "..") | 3 sys.path.insert(0, "..") |
4 # fall back to pure modules if required C extensions are not available | 4 # fall back to pure modules if required C extensions are not available |
5 sys.path.append(os.path.join('..', 'mercurial', 'pure')) | 5 sys.path.append(os.path.join('..', 'mercurial', 'pure')) |
6 from mercurial import demandimport; demandimport.enable() | 6 from mercurial import demandimport; demandimport.enable() |
7 from mercurial import encoding | |
7 from mercurial.commands import table, globalopts | 8 from mercurial.commands import table, globalopts |
8 from mercurial.i18n import _ | 9 from mercurial.i18n import _ |
9 from mercurial.help import helptable | 10 from mercurial.help import helptable |
10 | 11 |
11 def get_desc(docstr): | 12 def get_desc(docstr): |
53 | 54 |
54 return d | 55 return d |
55 | 56 |
56 def show_doc(ui): | 57 def show_doc(ui): |
57 def section(s): | 58 def section(s): |
58 ui.write("%s\n%s\n\n" % (s, "-" * len(s))) | 59 ui.write("%s\n%s\n\n" % (s, "-" * encoding.colwidth(s))) |
59 def subsection(s): | 60 def subsection(s): |
60 ui.write("%s\n%s\n\n" % (s, '"' * len(s))) | 61 ui.write("%s\n%s\n\n" % (s, '"' * encoding.colwidth(s))) |
61 | 62 |
62 # print options | 63 # print options |
63 section(_("OPTIONS")) | 64 section(_("OPTIONS")) |
64 for optstr, desc in get_opts(globalopts): | 65 for optstr, desc in get_opts(globalopts): |
65 ui.write("%s\n %s\n\n" % (optstr, desc)) | 66 ui.write("%s\n %s\n\n" % (optstr, desc)) |