comparison doc/gendoc.py @ 17267:979b107eaea2 stable

doc: unify section level between help topics Some help topics use "-" for the top level underlining section mark, but "-" is used also for the top level categorization in generated documents: "hg.1.html", for example. So, TOC in such documents contain "sections in each topics", too. This patch changes underlining section mark in some help topics to unify section level in generated documents. After this patching, levels of each section marks are: level0 """""" level1 ====== level2 ------ level3 ...... level4 ###### And use of section markers in each documents are: - mercurial/help/*.txt can use level1 or more (now these use level1 and level2) - help for core commands can use level2 or more (now these use no section marker) - descriptions of extensions can use level2 or more (now hgext/acl uses level2) - help for commands defined in extension can use level4 or more (now "convert" of hgext/convert uses level4) "Level0" is used as top level categorization only in "doc/hg.1.txt" and the intermediate file generated by "doc/gendoc.py", so end users don't see it in "hg help" outoput and so on.
author FUJIWARA Katsunori <foozy@lares.dti.ne.jp>
date Wed, 25 Jul 2012 16:40:38 +0900
parents 525fdb738975
children 6e676fb6ea44
comparison
equal deleted inserted replaced
17266:4e35dea77e31 17267:979b107eaea2
62 d['synopsis'] = s.strip() 62 d['synopsis'] = s.strip()
63 63
64 return d 64 return d
65 65
66 def section(ui, s): 66 def section(ui, s):
67 ui.write("%s\n%s\n\n" % (s, "\"" * encoding.colwidth(s)))
68
69 def subsection(ui, s):
70 ui.write("%s\n%s\n\n" % (s, '=' * encoding.colwidth(s)))
71
72 def subsubsection(ui, s):
67 ui.write("%s\n%s\n\n" % (s, "-" * encoding.colwidth(s))) 73 ui.write("%s\n%s\n\n" % (s, "-" * encoding.colwidth(s)))
68 74
69 def subsection(ui, s): 75 def subsubsubsection(ui, s):
70 ui.write("%s\n%s\n\n" % (s, '"' * encoding.colwidth(s)))
71
72 def subsubsection(ui, s):
73 ui.write("%s\n%s\n\n" % (s, "." * encoding.colwidth(s))) 76 ui.write("%s\n%s\n\n" % (s, "." * encoding.colwidth(s)))
74
75 def subsubsubsection(ui, s):
76 ui.write("%s\n%s\n\n" % (s, "#" * encoding.colwidth(s)))
77 77
78 78
79 def show_doc(ui): 79 def show_doc(ui):
80 # print options 80 # print options
81 section(ui, _("Options")) 81 section(ui, _("Options"))