Mercurial > hg
annotate tests/test-minirst.py @ 10855:62216faed067
templater: drop \ when handling escaped {
author | Matt Mackall <mpm@selenic.com> |
---|---|
date | Mon, 05 Apr 2010 15:25:08 -0500 |
parents | e957cc7cbd14 |
children | 0a2c6948f5f4 |
rev | line source |
---|---|
9156
c9c7e8cdac9c
minimal reStructuredText parser
Martin Geisler <mg@lazybytes.net>
parents:
diff
changeset
|
1 #!/usr/bin/env python |
c9c7e8cdac9c
minimal reStructuredText parser
Martin Geisler <mg@lazybytes.net>
parents:
diff
changeset
|
2 |
10444
e99e0e077bc4
minirst: report pruned container types
Martin Geisler <mg@lazybytes.net>
parents:
10443
diff
changeset
|
3 from pprint import pprint |
9156
c9c7e8cdac9c
minimal reStructuredText parser
Martin Geisler <mg@lazybytes.net>
parents:
diff
changeset
|
4 from mercurial import minirst |
c9c7e8cdac9c
minimal reStructuredText parser
Martin Geisler <mg@lazybytes.net>
parents:
diff
changeset
|
5 |
10443
62d484a81dfe
minirst: support containers
Martin Geisler <mg@lazybytes.net>
parents:
10289
diff
changeset
|
6 def debugformat(title, text, width, **kwargs): |
9156
c9c7e8cdac9c
minimal reStructuredText parser
Martin Geisler <mg@lazybytes.net>
parents:
diff
changeset
|
7 print "%s formatted to fit within %d characters:" % (title, width) |
c9c7e8cdac9c
minimal reStructuredText parser
Martin Geisler <mg@lazybytes.net>
parents:
diff
changeset
|
8 print "-" * 70 |
10444
e99e0e077bc4
minirst: report pruned container types
Martin Geisler <mg@lazybytes.net>
parents:
10443
diff
changeset
|
9 formatted = minirst.format(text, width, **kwargs) |
e99e0e077bc4
minirst: report pruned container types
Martin Geisler <mg@lazybytes.net>
parents:
10443
diff
changeset
|
10 if type(formatted) == tuple: |
e99e0e077bc4
minirst: report pruned container types
Martin Geisler <mg@lazybytes.net>
parents:
10443
diff
changeset
|
11 print formatted[0] |
e99e0e077bc4
minirst: report pruned container types
Martin Geisler <mg@lazybytes.net>
parents:
10443
diff
changeset
|
12 print "-" * 70 |
e99e0e077bc4
minirst: report pruned container types
Martin Geisler <mg@lazybytes.net>
parents:
10443
diff
changeset
|
13 pprint(formatted[1]) |
e99e0e077bc4
minirst: report pruned container types
Martin Geisler <mg@lazybytes.net>
parents:
10443
diff
changeset
|
14 else: |
e99e0e077bc4
minirst: report pruned container types
Martin Geisler <mg@lazybytes.net>
parents:
10443
diff
changeset
|
15 print formatted |
9156
c9c7e8cdac9c
minimal reStructuredText parser
Martin Geisler <mg@lazybytes.net>
parents:
diff
changeset
|
16 print "-" * 70 |
c9c7e8cdac9c
minimal reStructuredText parser
Martin Geisler <mg@lazybytes.net>
parents:
diff
changeset
|
17 print |
c9c7e8cdac9c
minimal reStructuredText parser
Martin Geisler <mg@lazybytes.net>
parents:
diff
changeset
|
18 |
c9c7e8cdac9c
minimal reStructuredText parser
Martin Geisler <mg@lazybytes.net>
parents:
diff
changeset
|
19 paragraphs = """ |
c9c7e8cdac9c
minimal reStructuredText parser
Martin Geisler <mg@lazybytes.net>
parents:
diff
changeset
|
20 This is some text in the first paragraph. |
c9c7e8cdac9c
minimal reStructuredText parser
Martin Geisler <mg@lazybytes.net>
parents:
diff
changeset
|
21 |
9736
26d3ade60fa6
test-minirst: don't test on invalid reST input
Martin Geisler <mg@lazybytes.net>
parents:
9293
diff
changeset
|
22 A small indented paragraph. |
26d3ade60fa6
test-minirst: don't test on invalid reST input
Martin Geisler <mg@lazybytes.net>
parents:
9293
diff
changeset
|
23 It is followed by some lines |
26d3ade60fa6
test-minirst: don't test on invalid reST input
Martin Geisler <mg@lazybytes.net>
parents:
9293
diff
changeset
|
24 containing random whitespace. |
10289
987df17f85bb
test-minirst: hide trailing whitespace from check-code
Matt Mackall <mpm@selenic.com>
parents:
10065
diff
changeset
|
25 \n \n \nThe third and final paragraph. |
9156
c9c7e8cdac9c
minimal reStructuredText parser
Martin Geisler <mg@lazybytes.net>
parents:
diff
changeset
|
26 """ |
c9c7e8cdac9c
minimal reStructuredText parser
Martin Geisler <mg@lazybytes.net>
parents:
diff
changeset
|
27 |
c9c7e8cdac9c
minimal reStructuredText parser
Martin Geisler <mg@lazybytes.net>
parents:
diff
changeset
|
28 debugformat('paragraphs', paragraphs, 60) |
c9c7e8cdac9c
minimal reStructuredText parser
Martin Geisler <mg@lazybytes.net>
parents:
diff
changeset
|
29 debugformat('paragraphs', paragraphs, 30) |
c9c7e8cdac9c
minimal reStructuredText parser
Martin Geisler <mg@lazybytes.net>
parents:
diff
changeset
|
30 |
c9c7e8cdac9c
minimal reStructuredText parser
Martin Geisler <mg@lazybytes.net>
parents:
diff
changeset
|
31 |
c9c7e8cdac9c
minimal reStructuredText parser
Martin Geisler <mg@lazybytes.net>
parents:
diff
changeset
|
32 definitions = """ |
c9c7e8cdac9c
minimal reStructuredText parser
Martin Geisler <mg@lazybytes.net>
parents:
diff
changeset
|
33 A Term |
c9c7e8cdac9c
minimal reStructuredText parser
Martin Geisler <mg@lazybytes.net>
parents:
diff
changeset
|
34 Definition. The indented |
c9c7e8cdac9c
minimal reStructuredText parser
Martin Geisler <mg@lazybytes.net>
parents:
diff
changeset
|
35 lines make up the definition. |
c9c7e8cdac9c
minimal reStructuredText parser
Martin Geisler <mg@lazybytes.net>
parents:
diff
changeset
|
36 Another Term |
c9c7e8cdac9c
minimal reStructuredText parser
Martin Geisler <mg@lazybytes.net>
parents:
diff
changeset
|
37 Another definition. The final line in the |
c9c7e8cdac9c
minimal reStructuredText parser
Martin Geisler <mg@lazybytes.net>
parents:
diff
changeset
|
38 definition determines the indentation, so |
c9c7e8cdac9c
minimal reStructuredText parser
Martin Geisler <mg@lazybytes.net>
parents:
diff
changeset
|
39 this will be indented with four spaces. |
c9c7e8cdac9c
minimal reStructuredText parser
Martin Geisler <mg@lazybytes.net>
parents:
diff
changeset
|
40 |
c9c7e8cdac9c
minimal reStructuredText parser
Martin Geisler <mg@lazybytes.net>
parents:
diff
changeset
|
41 A Nested/Indented Term |
c9c7e8cdac9c
minimal reStructuredText parser
Martin Geisler <mg@lazybytes.net>
parents:
diff
changeset
|
42 Definition. |
c9c7e8cdac9c
minimal reStructuredText parser
Martin Geisler <mg@lazybytes.net>
parents:
diff
changeset
|
43 """ |
c9c7e8cdac9c
minimal reStructuredText parser
Martin Geisler <mg@lazybytes.net>
parents:
diff
changeset
|
44 |
c9c7e8cdac9c
minimal reStructuredText parser
Martin Geisler <mg@lazybytes.net>
parents:
diff
changeset
|
45 debugformat('definitions', definitions, 60) |
c9c7e8cdac9c
minimal reStructuredText parser
Martin Geisler <mg@lazybytes.net>
parents:
diff
changeset
|
46 debugformat('definitions', definitions, 30) |
c9c7e8cdac9c
minimal reStructuredText parser
Martin Geisler <mg@lazybytes.net>
parents:
diff
changeset
|
47 |
c9c7e8cdac9c
minimal reStructuredText parser
Martin Geisler <mg@lazybytes.net>
parents:
diff
changeset
|
48 |
c9c7e8cdac9c
minimal reStructuredText parser
Martin Geisler <mg@lazybytes.net>
parents:
diff
changeset
|
49 literals = r""" |
c9c7e8cdac9c
minimal reStructuredText parser
Martin Geisler <mg@lazybytes.net>
parents:
diff
changeset
|
50 The fully minimized form is the most |
c9c7e8cdac9c
minimal reStructuredText parser
Martin Geisler <mg@lazybytes.net>
parents:
diff
changeset
|
51 convenient form:: |
c9c7e8cdac9c
minimal reStructuredText parser
Martin Geisler <mg@lazybytes.net>
parents:
diff
changeset
|
52 |
c9c7e8cdac9c
minimal reStructuredText parser
Martin Geisler <mg@lazybytes.net>
parents:
diff
changeset
|
53 Hello |
c9c7e8cdac9c
minimal reStructuredText parser
Martin Geisler <mg@lazybytes.net>
parents:
diff
changeset
|
54 literal |
c9c7e8cdac9c
minimal reStructuredText parser
Martin Geisler <mg@lazybytes.net>
parents:
diff
changeset
|
55 world |
c9c7e8cdac9c
minimal reStructuredText parser
Martin Geisler <mg@lazybytes.net>
parents:
diff
changeset
|
56 |
c9c7e8cdac9c
minimal reStructuredText parser
Martin Geisler <mg@lazybytes.net>
parents:
diff
changeset
|
57 In the partially minimized form a paragraph |
c9c7e8cdac9c
minimal reStructuredText parser
Martin Geisler <mg@lazybytes.net>
parents:
diff
changeset
|
58 simply ends with space-double-colon. :: |
c9c7e8cdac9c
minimal reStructuredText parser
Martin Geisler <mg@lazybytes.net>
parents:
diff
changeset
|
59 |
c9c7e8cdac9c
minimal reStructuredText parser
Martin Geisler <mg@lazybytes.net>
parents:
diff
changeset
|
60 //////////////////////////////////////// |
c9c7e8cdac9c
minimal reStructuredText parser
Martin Geisler <mg@lazybytes.net>
parents:
diff
changeset
|
61 long un-wrapped line in a literal block |
c9c7e8cdac9c
minimal reStructuredText parser
Martin Geisler <mg@lazybytes.net>
parents:
diff
changeset
|
62 \\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\ |
c9c7e8cdac9c
minimal reStructuredText parser
Martin Geisler <mg@lazybytes.net>
parents:
diff
changeset
|
63 |
c9c7e8cdac9c
minimal reStructuredText parser
Martin Geisler <mg@lazybytes.net>
parents:
diff
changeset
|
64 :: |
c9c7e8cdac9c
minimal reStructuredText parser
Martin Geisler <mg@lazybytes.net>
parents:
diff
changeset
|
65 |
c9c7e8cdac9c
minimal reStructuredText parser
Martin Geisler <mg@lazybytes.net>
parents:
diff
changeset
|
66 This literal block is started with '::', |
c9c7e8cdac9c
minimal reStructuredText parser
Martin Geisler <mg@lazybytes.net>
parents:
diff
changeset
|
67 the so-called expanded form. The paragraph |
c9c7e8cdac9c
minimal reStructuredText parser
Martin Geisler <mg@lazybytes.net>
parents:
diff
changeset
|
68 with '::' disappears in the final output. |
c9c7e8cdac9c
minimal reStructuredText parser
Martin Geisler <mg@lazybytes.net>
parents:
diff
changeset
|
69 """ |
c9c7e8cdac9c
minimal reStructuredText parser
Martin Geisler <mg@lazybytes.net>
parents:
diff
changeset
|
70 |
c9c7e8cdac9c
minimal reStructuredText parser
Martin Geisler <mg@lazybytes.net>
parents:
diff
changeset
|
71 debugformat('literals', literals, 60) |
c9c7e8cdac9c
minimal reStructuredText parser
Martin Geisler <mg@lazybytes.net>
parents:
diff
changeset
|
72 debugformat('literals', literals, 30) |
c9c7e8cdac9c
minimal reStructuredText parser
Martin Geisler <mg@lazybytes.net>
parents:
diff
changeset
|
73 |
c9c7e8cdac9c
minimal reStructuredText parser
Martin Geisler <mg@lazybytes.net>
parents:
diff
changeset
|
74 |
c9c7e8cdac9c
minimal reStructuredText parser
Martin Geisler <mg@lazybytes.net>
parents:
diff
changeset
|
75 lists = """ |
c9c7e8cdac9c
minimal reStructuredText parser
Martin Geisler <mg@lazybytes.net>
parents:
diff
changeset
|
76 - This is the first list item. |
c9c7e8cdac9c
minimal reStructuredText parser
Martin Geisler <mg@lazybytes.net>
parents:
diff
changeset
|
77 |
c9c7e8cdac9c
minimal reStructuredText parser
Martin Geisler <mg@lazybytes.net>
parents:
diff
changeset
|
78 Second paragraph in the first list item. |
c9c7e8cdac9c
minimal reStructuredText parser
Martin Geisler <mg@lazybytes.net>
parents:
diff
changeset
|
79 |
c9c7e8cdac9c
minimal reStructuredText parser
Martin Geisler <mg@lazybytes.net>
parents:
diff
changeset
|
80 - List items need not be separated |
c9c7e8cdac9c
minimal reStructuredText parser
Martin Geisler <mg@lazybytes.net>
parents:
diff
changeset
|
81 by a blank line. |
c9c7e8cdac9c
minimal reStructuredText parser
Martin Geisler <mg@lazybytes.net>
parents:
diff
changeset
|
82 - And will be rendered without |
c9c7e8cdac9c
minimal reStructuredText parser
Martin Geisler <mg@lazybytes.net>
parents:
diff
changeset
|
83 one in any case. |
c9c7e8cdac9c
minimal reStructuredText parser
Martin Geisler <mg@lazybytes.net>
parents:
diff
changeset
|
84 |
c9c7e8cdac9c
minimal reStructuredText parser
Martin Geisler <mg@lazybytes.net>
parents:
diff
changeset
|
85 We can have indented lists: |
c9c7e8cdac9c
minimal reStructuredText parser
Martin Geisler <mg@lazybytes.net>
parents:
diff
changeset
|
86 |
c9c7e8cdac9c
minimal reStructuredText parser
Martin Geisler <mg@lazybytes.net>
parents:
diff
changeset
|
87 - This is an indented list item |
c9c7e8cdac9c
minimal reStructuredText parser
Martin Geisler <mg@lazybytes.net>
parents:
diff
changeset
|
88 |
c9c7e8cdac9c
minimal reStructuredText parser
Martin Geisler <mg@lazybytes.net>
parents:
diff
changeset
|
89 - Another indented list item:: |
c9c7e8cdac9c
minimal reStructuredText parser
Martin Geisler <mg@lazybytes.net>
parents:
diff
changeset
|
90 |
c9c7e8cdac9c
minimal reStructuredText parser
Martin Geisler <mg@lazybytes.net>
parents:
diff
changeset
|
91 - A literal block in the middle |
c9c7e8cdac9c
minimal reStructuredText parser
Martin Geisler <mg@lazybytes.net>
parents:
diff
changeset
|
92 of an indented list. |
c9c7e8cdac9c
minimal reStructuredText parser
Martin Geisler <mg@lazybytes.net>
parents:
diff
changeset
|
93 |
c9c7e8cdac9c
minimal reStructuredText parser
Martin Geisler <mg@lazybytes.net>
parents:
diff
changeset
|
94 (The above is not a list item since we are in the literal block.) |
c9c7e8cdac9c
minimal reStructuredText parser
Martin Geisler <mg@lazybytes.net>
parents:
diff
changeset
|
95 |
c9c7e8cdac9c
minimal reStructuredText parser
Martin Geisler <mg@lazybytes.net>
parents:
diff
changeset
|
96 :: |
c9c7e8cdac9c
minimal reStructuredText parser
Martin Geisler <mg@lazybytes.net>
parents:
diff
changeset
|
97 |
9291
cd5b6a11b607
minirst: indent literal blocks with two spaces
Martin Geisler <mg@lazybytes.net>
parents:
9156
diff
changeset
|
98 Literal block with no indentation (apart from |
cd5b6a11b607
minirst: indent literal blocks with two spaces
Martin Geisler <mg@lazybytes.net>
parents:
9156
diff
changeset
|
99 the two spaces added to all literal blocks). |
9739
75cff8f12910
minirst: support enumerated lists
Martin Geisler <mg@lazybytes.net>
parents:
9736
diff
changeset
|
100 |
75cff8f12910
minirst: support enumerated lists
Martin Geisler <mg@lazybytes.net>
parents:
9736
diff
changeset
|
101 1. This is an enumerated list (first item). |
75cff8f12910
minirst: support enumerated lists
Martin Geisler <mg@lazybytes.net>
parents:
9736
diff
changeset
|
102 2. Continuing with the second item. |
75cff8f12910
minirst: support enumerated lists
Martin Geisler <mg@lazybytes.net>
parents:
9736
diff
changeset
|
103 |
75cff8f12910
minirst: support enumerated lists
Martin Geisler <mg@lazybytes.net>
parents:
9736
diff
changeset
|
104 (1) foo |
75cff8f12910
minirst: support enumerated lists
Martin Geisler <mg@lazybytes.net>
parents:
9736
diff
changeset
|
105 (2) bar |
75cff8f12910
minirst: support enumerated lists
Martin Geisler <mg@lazybytes.net>
parents:
9736
diff
changeset
|
106 |
75cff8f12910
minirst: support enumerated lists
Martin Geisler <mg@lazybytes.net>
parents:
9736
diff
changeset
|
107 1) Another |
75cff8f12910
minirst: support enumerated lists
Martin Geisler <mg@lazybytes.net>
parents:
9736
diff
changeset
|
108 2) List |
10447
e957cc7cbd14
minirst: support line blocks
Martin Geisler <mg@lazybytes.net>
parents:
10444
diff
changeset
|
109 |
e957cc7cbd14
minirst: support line blocks
Martin Geisler <mg@lazybytes.net>
parents:
10444
diff
changeset
|
110 Line blocks are also a form of list: |
e957cc7cbd14
minirst: support line blocks
Martin Geisler <mg@lazybytes.net>
parents:
10444
diff
changeset
|
111 |
e957cc7cbd14
minirst: support line blocks
Martin Geisler <mg@lazybytes.net>
parents:
10444
diff
changeset
|
112 | This is the first line. |
e957cc7cbd14
minirst: support line blocks
Martin Geisler <mg@lazybytes.net>
parents:
10444
diff
changeset
|
113 The line continues here. |
e957cc7cbd14
minirst: support line blocks
Martin Geisler <mg@lazybytes.net>
parents:
10444
diff
changeset
|
114 | This is the second line. |
9156
c9c7e8cdac9c
minimal reStructuredText parser
Martin Geisler <mg@lazybytes.net>
parents:
diff
changeset
|
115 """ |
c9c7e8cdac9c
minimal reStructuredText parser
Martin Geisler <mg@lazybytes.net>
parents:
diff
changeset
|
116 |
c9c7e8cdac9c
minimal reStructuredText parser
Martin Geisler <mg@lazybytes.net>
parents:
diff
changeset
|
117 debugformat('lists', lists, 60) |
c9c7e8cdac9c
minimal reStructuredText parser
Martin Geisler <mg@lazybytes.net>
parents:
diff
changeset
|
118 debugformat('lists', lists, 30) |
c9c7e8cdac9c
minimal reStructuredText parser
Martin Geisler <mg@lazybytes.net>
parents:
diff
changeset
|
119 |
c9c7e8cdac9c
minimal reStructuredText parser
Martin Geisler <mg@lazybytes.net>
parents:
diff
changeset
|
120 |
c9c7e8cdac9c
minimal reStructuredText parser
Martin Geisler <mg@lazybytes.net>
parents:
diff
changeset
|
121 options = """ |
c9c7e8cdac9c
minimal reStructuredText parser
Martin Geisler <mg@lazybytes.net>
parents:
diff
changeset
|
122 There is support for simple option lists, |
c9c7e8cdac9c
minimal reStructuredText parser
Martin Geisler <mg@lazybytes.net>
parents:
diff
changeset
|
123 but only with long options: |
c9c7e8cdac9c
minimal reStructuredText parser
Martin Geisler <mg@lazybytes.net>
parents:
diff
changeset
|
124 |
c9c7e8cdac9c
minimal reStructuredText parser
Martin Geisler <mg@lazybytes.net>
parents:
diff
changeset
|
125 --all Output all. |
c9c7e8cdac9c
minimal reStructuredText parser
Martin Geisler <mg@lazybytes.net>
parents:
diff
changeset
|
126 --both Output both (this description is |
c9c7e8cdac9c
minimal reStructuredText parser
Martin Geisler <mg@lazybytes.net>
parents:
diff
changeset
|
127 quite long). |
c9c7e8cdac9c
minimal reStructuredText parser
Martin Geisler <mg@lazybytes.net>
parents:
diff
changeset
|
128 --long Output all day long. |
c9c7e8cdac9c
minimal reStructuredText parser
Martin Geisler <mg@lazybytes.net>
parents:
diff
changeset
|
129 |
c9c7e8cdac9c
minimal reStructuredText parser
Martin Geisler <mg@lazybytes.net>
parents:
diff
changeset
|
130 --par This option has two paragraphs in its description. |
c9c7e8cdac9c
minimal reStructuredText parser
Martin Geisler <mg@lazybytes.net>
parents:
diff
changeset
|
131 This is the first. |
c9c7e8cdac9c
minimal reStructuredText parser
Martin Geisler <mg@lazybytes.net>
parents:
diff
changeset
|
132 |
c9c7e8cdac9c
minimal reStructuredText parser
Martin Geisler <mg@lazybytes.net>
parents:
diff
changeset
|
133 This is the second. Blank lines may be omitted between |
c9c7e8cdac9c
minimal reStructuredText parser
Martin Geisler <mg@lazybytes.net>
parents:
diff
changeset
|
134 options (as above) or left in (as here). |
c9c7e8cdac9c
minimal reStructuredText parser
Martin Geisler <mg@lazybytes.net>
parents:
diff
changeset
|
135 |
c9c7e8cdac9c
minimal reStructuredText parser
Martin Geisler <mg@lazybytes.net>
parents:
diff
changeset
|
136 The next paragraph looks like an option list, but lacks the two-space |
c9c7e8cdac9c
minimal reStructuredText parser
Martin Geisler <mg@lazybytes.net>
parents:
diff
changeset
|
137 marker after the option. It is treated as a normal paragraph: |
c9c7e8cdac9c
minimal reStructuredText parser
Martin Geisler <mg@lazybytes.net>
parents:
diff
changeset
|
138 |
c9c7e8cdac9c
minimal reStructuredText parser
Martin Geisler <mg@lazybytes.net>
parents:
diff
changeset
|
139 --foo bar baz |
c9c7e8cdac9c
minimal reStructuredText parser
Martin Geisler <mg@lazybytes.net>
parents:
diff
changeset
|
140 """ |
c9c7e8cdac9c
minimal reStructuredText parser
Martin Geisler <mg@lazybytes.net>
parents:
diff
changeset
|
141 |
c9c7e8cdac9c
minimal reStructuredText parser
Martin Geisler <mg@lazybytes.net>
parents:
diff
changeset
|
142 debugformat('options', options, 60) |
c9c7e8cdac9c
minimal reStructuredText parser
Martin Geisler <mg@lazybytes.net>
parents:
diff
changeset
|
143 debugformat('options', options, 30) |
9293
e48a48b754d3
minirst: parse field lists
Martin Geisler <mg@lazybytes.net>
parents:
9291
diff
changeset
|
144 |
e48a48b754d3
minirst: parse field lists
Martin Geisler <mg@lazybytes.net>
parents:
9291
diff
changeset
|
145 |
e48a48b754d3
minirst: parse field lists
Martin Geisler <mg@lazybytes.net>
parents:
9291
diff
changeset
|
146 fields = """ |
10065
a1ae0ed78d1a
minirst: improve layout of field lists
Martin Geisler <mg@lazybytes.net>
parents:
9739
diff
changeset
|
147 :a: First item. |
a1ae0ed78d1a
minirst: improve layout of field lists
Martin Geisler <mg@lazybytes.net>
parents:
9739
diff
changeset
|
148 :ab: Second item. Indentation and wrapping |
a1ae0ed78d1a
minirst: improve layout of field lists
Martin Geisler <mg@lazybytes.net>
parents:
9739
diff
changeset
|
149 is handled automatically. |
9293
e48a48b754d3
minirst: parse field lists
Martin Geisler <mg@lazybytes.net>
parents:
9291
diff
changeset
|
150 |
10065
a1ae0ed78d1a
minirst: improve layout of field lists
Martin Geisler <mg@lazybytes.net>
parents:
9739
diff
changeset
|
151 Next list: |
a1ae0ed78d1a
minirst: improve layout of field lists
Martin Geisler <mg@lazybytes.net>
parents:
9739
diff
changeset
|
152 |
a1ae0ed78d1a
minirst: improve layout of field lists
Martin Geisler <mg@lazybytes.net>
parents:
9739
diff
changeset
|
153 :small: The larger key below triggers full indentation here. |
a1ae0ed78d1a
minirst: improve layout of field lists
Martin Geisler <mg@lazybytes.net>
parents:
9739
diff
changeset
|
154 :much too large: This key is big enough to get its own line. |
9293
e48a48b754d3
minirst: parse field lists
Martin Geisler <mg@lazybytes.net>
parents:
9291
diff
changeset
|
155 """ |
e48a48b754d3
minirst: parse field lists
Martin Geisler <mg@lazybytes.net>
parents:
9291
diff
changeset
|
156 |
e48a48b754d3
minirst: parse field lists
Martin Geisler <mg@lazybytes.net>
parents:
9291
diff
changeset
|
157 debugformat('fields', fields, 60) |
e48a48b754d3
minirst: parse field lists
Martin Geisler <mg@lazybytes.net>
parents:
9291
diff
changeset
|
158 debugformat('fields', fields, 30) |
10443
62d484a81dfe
minirst: support containers
Martin Geisler <mg@lazybytes.net>
parents:
10289
diff
changeset
|
159 |
62d484a81dfe
minirst: support containers
Martin Geisler <mg@lazybytes.net>
parents:
10289
diff
changeset
|
160 containers = """ |
62d484a81dfe
minirst: support containers
Martin Geisler <mg@lazybytes.net>
parents:
10289
diff
changeset
|
161 Normal output. |
62d484a81dfe
minirst: support containers
Martin Geisler <mg@lazybytes.net>
parents:
10289
diff
changeset
|
162 |
62d484a81dfe
minirst: support containers
Martin Geisler <mg@lazybytes.net>
parents:
10289
diff
changeset
|
163 .. container:: debug |
62d484a81dfe
minirst: support containers
Martin Geisler <mg@lazybytes.net>
parents:
10289
diff
changeset
|
164 |
62d484a81dfe
minirst: support containers
Martin Geisler <mg@lazybytes.net>
parents:
10289
diff
changeset
|
165 Initial debug output. |
62d484a81dfe
minirst: support containers
Martin Geisler <mg@lazybytes.net>
parents:
10289
diff
changeset
|
166 |
62d484a81dfe
minirst: support containers
Martin Geisler <mg@lazybytes.net>
parents:
10289
diff
changeset
|
167 .. container:: verbose |
62d484a81dfe
minirst: support containers
Martin Geisler <mg@lazybytes.net>
parents:
10289
diff
changeset
|
168 |
62d484a81dfe
minirst: support containers
Martin Geisler <mg@lazybytes.net>
parents:
10289
diff
changeset
|
169 Verbose output. |
62d484a81dfe
minirst: support containers
Martin Geisler <mg@lazybytes.net>
parents:
10289
diff
changeset
|
170 |
62d484a81dfe
minirst: support containers
Martin Geisler <mg@lazybytes.net>
parents:
10289
diff
changeset
|
171 .. container:: debug |
62d484a81dfe
minirst: support containers
Martin Geisler <mg@lazybytes.net>
parents:
10289
diff
changeset
|
172 |
62d484a81dfe
minirst: support containers
Martin Geisler <mg@lazybytes.net>
parents:
10289
diff
changeset
|
173 Debug output. |
62d484a81dfe
minirst: support containers
Martin Geisler <mg@lazybytes.net>
parents:
10289
diff
changeset
|
174 """ |
62d484a81dfe
minirst: support containers
Martin Geisler <mg@lazybytes.net>
parents:
10289
diff
changeset
|
175 |
62d484a81dfe
minirst: support containers
Martin Geisler <mg@lazybytes.net>
parents:
10289
diff
changeset
|
176 debugformat('containers (normal)', containers, 60) |
62d484a81dfe
minirst: support containers
Martin Geisler <mg@lazybytes.net>
parents:
10289
diff
changeset
|
177 debugformat('containers (verbose)', containers, 60, keep=['verbose']) |
62d484a81dfe
minirst: support containers
Martin Geisler <mg@lazybytes.net>
parents:
10289
diff
changeset
|
178 debugformat('containers (debug)', containers, 60, keep=['debug']) |
62d484a81dfe
minirst: support containers
Martin Geisler <mg@lazybytes.net>
parents:
10289
diff
changeset
|
179 debugformat('containers (verbose debug)', containers, 60, |
62d484a81dfe
minirst: support containers
Martin Geisler <mg@lazybytes.net>
parents:
10289
diff
changeset
|
180 keep=['verbose', 'debug']) |