gendoc: support multi-line synopses stable
authorMartin Geisler <mg@lazybytes.net>
Sat, 23 Oct 2010 00:11:39 +0200
branchstable
changeset 12813 13fdef670c43
parent 12812 4d431a31a76e
child 12814 58bc5024805d
gendoc: support multi-line synopses
doc/gendoc.py
--- a/doc/gendoc.py	Sat Oct 23 00:01:09 2010 +0200
+++ b/doc/gendoc.py	Sat Oct 23 00:11:39 2010 +0200
@@ -130,8 +130,13 @@
         d = get_cmd(h[f], cmdtable)
         sectionfunc(ui, d['cmd'])
         # synopsis
-        ui.write("``%s``\n" % d['synopsis'].replace("hg ","", 1))
-        ui.write("\n")
+        ui.write("::\n\n")
+        synopsislines = d['synopsis'].splitlines()
+        for line in synopsislines:
+            # some commands (such as rebase) have a multi-line
+            # synopsis
+            ui.write("   %s\n" % line.replace("hg ","", 1))
+        ui.write('\n')
         # description
         ui.write("%s\n\n" % d['desc'][1])
         # options