Mercurial > public > mercurial-scm > hg
diff tests/test-minirst.py.out @ 10065:a1ae0ed78d1a
minirst: improve layout of field lists
Before, we used the padding following the key to compute where to wrap
the text. Long keys would thus give a big indentation. It also
required careful alignment of the source text, making it cumbersome to
items to the list.
We now compute the maximum key length and use that for all items in
the list. We also put a cap on the indentation: keys longer than 10
characters are put on their own line. This is similar to how rst2html
handles large keys: it uses 14 as the cutoff point, but I felt that 10
was better for monospaced text in the console.
author | Martin Geisler <mg@lazybytes.net> |
---|---|
date | Sun, 13 Dec 2009 23:49:53 +0100 |
parents | 75cff8f12910 |
children | 62d484a81dfe |
line wrap: on
line diff
--- a/tests/test-minirst.py.out Sun Dec 13 22:37:30 2009 +0100 +++ b/tests/test-minirst.py.out Sun Dec 13 23:49:53 2009 +0100 @@ -215,29 +215,34 @@ fields formatted to fit within 60 characters: ---------------------------------------------------------------------- -Field lists give a simple two-column layout: +a First item. +ab Second item. Indentation and wrapping is handled + automatically. -key The whitespace following the key is - significant for the wrapping of this text. -another key More text. The indentation on the following - lines is not significant. +Next list: + +small The larger key below triggers full indentation + here. +much too large + This key is big enough to get its own line. ---------------------------------------------------------------------- fields formatted to fit within 30 characters: ---------------------------------------------------------------------- -Field lists give a simple two- -column layout: +a First item. +ab Second item. Indentation + and wrapping is handled + automatically. + +Next list: -key The whitespace - following the - key is - significant for - the wrapping of - this text. -another key More text. The - indentation on - the following - lines is not - significant. +small The larger key + below triggers + full indentation + here. +much too large + This key is big + enough to get its + own line. ----------------------------------------------------------------------