# HG changeset patch # User Martin Geisler # Date 1287590870 -7200 # Node ID 4f4eddee254d9febc5b6fe3936c114594beafe98 # Parent cbbcabde2414560a60b41bc645a37cc378bec61e gendoc: move section commands to module scope diff -r cbbcabde2414 -r 4f4eddee254d doc/gendoc.py --- a/doc/gendoc.py Wed Oct 20 12:29:55 2010 -0200 +++ b/doc/gendoc.py Wed Oct 20 18:07:50 2010 +0200 @@ -58,19 +58,21 @@ return d +def section(ui, s): + ui.write("%s\n%s\n\n" % (s, "-" * encoding.colwidth(s))) + +def subsection(ui, s): + ui.write("%s\n%s\n\n" % (s, '"' * encoding.colwidth(s))) + + def show_doc(ui): - def section(s): - ui.write("%s\n%s\n\n" % (s, "-" * encoding.colwidth(s))) - def subsection(s): - ui.write("%s\n%s\n\n" % (s, '"' * encoding.colwidth(s))) - # print options - section(_("Options")) + section(ui, _("Options")) for optstr, desc in get_opts(globalopts): ui.write("%s\n %s\n\n" % (optstr, desc)) # print cmds - section(_("Commands")) + section(ui, _("Commands")) commandprinter(ui, table) # print topics @@ -78,7 +80,7 @@ for name in names: ui.write(".. _%s:\n" % name) ui.write("\n") - section(sec) + section(ui, sec) if hasattr(doc, '__call__'): doc = doc() ui.write(doc) diff -r cbbcabde2414 -r 4f4eddee254d doc/hg.1.txt --- a/doc/hg.1.txt Wed Oct 20 12:29:55 2010 -0200 +++ b/doc/hg.1.txt Wed Oct 20 18:07:50 2010 +0200 @@ -14,6 +14,7 @@ .. contents:: :backlinks: top :class: htmlonly + :depth: 1 Synopsis