From b8f7bb04d003f8dbcf3ef2b201fc2678308995af Mon Sep 17 00:00:00 2001 From: Mike Frysinger Date: Wed, 10 Oct 2018 01:05:11 -0400 Subject: 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 --- subcmds/help.py | 17 ++--------------- 1 file changed, 2 insertions(+), 15 deletions(-) (limited to 'subcmds/help.py') diff --git a/subcmds/help.py b/subcmds/help.py index 9bb4c8c7..67a225e5 100644 --- a/subcmds/help.py +++ b/subcmds/help.py @@ -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 -- cgit v1.2.3-54-g00ecf