diff options
author | Mike Frysinger <vapier@google.com> | 2018-10-10 01:05:11 -0400 |
---|---|---|
committer | Mike Frysinger <vapier@google.com> | 2018-10-10 01:28:43 -0400 |
commit | b8f7bb04d003f8dbcf3ef2b201fc2678308995af (patch) | |
tree | db5a3854124122b007821a0eec28d02b09ccb999 /subcmds/help.py | |
parent | 3891b7519d35b6bac3e81744c846ca2ed0bd1be2 (diff) | |
download | git-repo-b8f7bb04d003f8dbcf3ef2b201fc2678308995af.tar.gz |
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
Diffstat (limited to 'subcmds/help.py')
-rw-r--r-- | subcmds/help.py | 17 |
1 files changed, 2 insertions, 15 deletions
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. | |||
107 | 107 | ||
108 | self.heading('%s', heading) | 108 | self.heading('%s', heading) |
109 | self.nl() | 109 | self.nl() |
110 | |||
111 | self.heading('%s', ''.ljust(len(heading), '-')) | ||
112 | self.nl() | 110 | self.nl() |
113 | 111 | ||
114 | me = 'repo %s' % cmd.NAME | 112 | me = 'repo %s' % cmd.NAME |
115 | body = body.strip() | 113 | body = body.strip() |
116 | body = body.replace('%prog', me) | 114 | body = body.replace('%prog', me) |
117 | 115 | ||
118 | asciidoc_hdr = re.compile(r'^\n?([^\n]{1,})\n([=~-]{2,})$') | 116 | asciidoc_hdr = re.compile(r'^\n?#+ (.+)$') |
119 | for para in body.split("\n\n"): | 117 | for para in body.split("\n\n"): |
120 | if para.startswith(' '): | 118 | if para.startswith(' '): |
121 | self.write('%s', para) | 119 | self.write('%s', para) |
@@ -125,19 +123,8 @@ Displays detailed usage information about a command. | |||
125 | 123 | ||
126 | m = asciidoc_hdr.match(para) | 124 | m = asciidoc_hdr.match(para) |
127 | if m: | 125 | if m: |
128 | title = m.group(1) | 126 | self.heading(m.group(1)) |
129 | section_type = m.group(2) | ||
130 | if section_type[0] in ('=', '-'): | ||
131 | p = self.heading | ||
132 | else: | ||
133 | def _p(fmt, *args): | ||
134 | self.write(' ') | ||
135 | self.heading(fmt, *args) | ||
136 | p = _p | ||
137 | |||
138 | p('%s', title) | ||
139 | self.nl() | 127 | self.nl() |
140 | p('%s', ''.ljust(len(title), section_type[0])) | ||
141 | self.nl() | 128 | self.nl() |
142 | continue | 129 | continue |
143 | 130 | ||