comparison doc/gendoc.py @ 20689:401f9b661a2d

doc: show short description of each commands in generated documents Before this patch, short description of each commands is not shown in generated documents (HTML file and UNIX man page). This omitting may prevent users from understanding about commands. This patch show it as the 1st paragraph in the help section of each commands. This style is chosen because: - showing it as the section title in "command - short desc" style disallows referencing by "#command" in HTML file: in "en" locale, hyphen concatenated title is used as the section ID in HTML file for this style - showing it as the 1st paragraph in "command - short desc" style seems to be redundant: "command" appears also just before as the section title - showing it just after synopsis like "hg help command" seems not to be reasonable in UNIX man page This patch just writes short description ("d['desc'][0]") before "::", because it should be already "strip()"-ed in "get_desc()", or empty string for the command without description.
author FUJIWARA Katsunori <foozy@lares.dti.ne.jp>
date Tue, 11 Mar 2014 14:36:40 +0900
parents 37f3be9d1541
children e0b29a0c36c4
comparison
equal deleted inserted replaced
20688:a61ed1c2d7a7 20689:401f9b661a2d
154 for f in cmds: 154 for f in cmds:
155 if f.startswith("debug"): 155 if f.startswith("debug"):
156 continue 156 continue
157 d = get_cmd(h[f], cmdtable) 157 d = get_cmd(h[f], cmdtable)
158 ui.write(sectionfunc(d['cmd'])) 158 ui.write(sectionfunc(d['cmd']))
159 # short description
160 ui.write(d['desc'][0])
159 # synopsis 161 # synopsis
160 ui.write("::\n\n") 162 ui.write("::\n\n")
161 synopsislines = d['synopsis'].splitlines() 163 synopsislines = d['synopsis'].splitlines()
162 for line in synopsislines: 164 for line in synopsislines:
163 # some commands (such as rebase) have a multi-line 165 # some commands (such as rebase) have a multi-line