Mercurial > hg-stable
diff doc/gendoc.py @ 3797:54fd4d3b4fce
Generate docs for help topics
author | Matt Mackall <mpm@selenic.com> |
---|---|
date | Tue, 05 Dec 2006 16:28:59 -0600 |
parents | 7956893e8458 |
children | bbdcdc7f170e |
line wrap: on
line diff
--- a/doc/gendoc.py Tue Dec 05 16:28:56 2006 -0600 +++ b/doc/gendoc.py Tue Dec 05 16:28:59 2006 -0600 @@ -3,6 +3,7 @@ sys.path.insert(0, "..") from mercurial.commands import table, globalopts from mercurial.i18n import gettext as _ +from mercurial.help import helptable def get_desc(docstr): if not docstr: @@ -88,5 +89,16 @@ if d['aliases']: ui.write(_(" aliases: %s\n\n") % " ".join(d['aliases'])) + # print topics + for t in helptable: + l = t.split("|") + section = l[-1] + underlined(_(section).upper()) + doc = helptable[t] + if callable(doc): + doc = doc() + ui.write(_(doc)) + ui.write("\n") + if __name__ == "__main__": show_doc(sys.stdout)