[PATCH 3 of 6] help: ReST tweaks

Martin Geisler martin at geisler.net
Sat Feb 9 17:07:45 CST 2013


Dan Villiom Podlaski Christiansen <danchr at gmail.com> writes:

> # HG changeset patch
> # User Dan Villiom Podlaski Christiansen  <danchr at gmail.com>
> # Date 1360414103 0
> # Node ID 03c9cfc461cce54da65f0ad0529a734181022b83
> # Parent  aa74feb1f11d43453e6ef3797e6c4c24f950a9dc
> help: ReST tweaks
>
> Use a full header for topic titles; make the indent configurable by
> the caller
>
> diff --git a/mercurial/help.py b/mercurial/help.py
> --- a/mercurial/help.py
> +++ b/mercurial/help.py
> @@ -389,12 +389,17 @@ def help_(ui, name, unknowncmd=False, fu
>          else:
>              raise error.UnknownCommand(name)
>  
> -        rst = ["%s\n\n" % header]
> +        headerstyleline = '=' * encoding.colwidth(header)
> +        rst = ["%s\n%s\n%s\n\n" % (headerstyleline, header, headerstyleline)]

When we discussed this I had a strong feeling that we already had this
code available somewhere: it's in doc/gendoc.py :) Maybe you could move
this into minirst and then let gendoc import it back -- that way we get
consistent headings.

-- 
Martin Geisler


More information about the Mercurial-devel mailing list