[PATCH 3 of 4] gendoc: documentation section describing available extensions
Cédric Duval
cedricduval at free.fr
Fri Jul 31 01:06:35 CDT 2009
# HG changeset patch
# User Cédric Duval <cedricduval at free.fr>
# Date 1248811309 -7200
# Node ID 742aee956146f6c322d2a6e03fcd25c78ac477a5
# Parent f106029efa922413437e594ed68da32909a9f42a
gendoc: documentation section describing available extensions
diff --git a/doc/gendoc.py b/doc/gendoc.py
--- a/doc/gendoc.py
+++ b/doc/gendoc.py
@@ -7,6 +7,7 @@
from mercurial.commands import table, globalopts
from mercurial.i18n import _
from mercurial.help import helptable
+from mercurial import extensions
def get_desc(docstr):
if not docstr:
@@ -108,5 +109,16 @@
ui.write(doc)
ui.write("\n")
+ # print extensions
+ underlined(_("EXTENSIONS"))
+ ui.write('\n')
+ for name in sorted(extensions.listexts('../hgext')):
+ ui.write(".. _%s:\n\n" % name)
+ doc = extensions.doc(name).splitlines()
+ synopsis, rest = doc[0], doc[1:]
+ ui.write("``%s: %s``" % (name, synopsis))
+ ui.write("%s\n" % '\n '.join(rest))
+ ui.write("\n")
+
if __name__ == "__main__":
show_doc(sys.stdout)
More information about the Mercurial-devel
mailing list