update markdown/help header format
Since gitiles recommends using # headers over ---/=== underlines, change the manifest-format.md over and all our help texts. Change-Id: I96391d41fba769e9f26870d497cf7cf01c8d8ab3
This commit is contained in:
parent
3891b7519d
commit
b8f7bb04d0
9 changed files with 27 additions and 65 deletions
|
@ -107,15 +107,13 @@ Displays detailed usage information about a command.
|
|||
|
||||
self.heading('%s', heading)
|
||||
self.nl()
|
||||
|
||||
self.heading('%s', ''.ljust(len(heading), '-'))
|
||||
self.nl()
|
||||
|
||||
me = 'repo %s' % cmd.NAME
|
||||
body = body.strip()
|
||||
body = body.replace('%prog', me)
|
||||
|
||||
asciidoc_hdr = re.compile(r'^\n?([^\n]{1,})\n([=~-]{2,})$')
|
||||
asciidoc_hdr = re.compile(r'^\n?#+ (.+)$')
|
||||
for para in body.split("\n\n"):
|
||||
if para.startswith(' '):
|
||||
self.write('%s', para)
|
||||
|
@ -125,19 +123,8 @@ Displays detailed usage information about a command.
|
|||
|
||||
m = asciidoc_hdr.match(para)
|
||||
if m:
|
||||
title = m.group(1)
|
||||
section_type = m.group(2)
|
||||
if section_type[0] in ('=', '-'):
|
||||
p = self.heading
|
||||
else:
|
||||
def _p(fmt, *args):
|
||||
self.write(' ')
|
||||
self.heading(fmt, *args)
|
||||
p = _p
|
||||
|
||||
p('%s', title)
|
||||
self.heading(m.group(1))
|
||||
self.nl()
|
||||
p('%s', ''.ljust(len(title), section_type[0]))
|
||||
self.nl()
|
||||
continue
|
||||
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue