##// END OF EJS Templates
minirst: improve test harness
Matt Mackall -
r15263:70d7293c default
parent child Browse files
Show More
@@ -1,249 +1,244 b''
1 from pprint import pprint
1 from pprint import pprint
2 from mercurial import minirst
2 from mercurial import minirst
3
3
4 def debugformat(title, text, width, **kwargs):
4 def debugformat(text, form, **kwargs):
5 print "%s formatted to fit within %d characters:" % (title, width)
5 if form == 'html':
6 formatted = minirst.format(text, width, **kwargs)
6 print "html format:"
7 html = minirst.format(text, width, style='html', **kwargs)
7 out = minirst.format(text, style=form, **kwargs)
8 else:
9 print "%d column format:" % form
10 out = minirst.format(text, width=form, **kwargs)
11
8 print "-" * 70
12 print "-" * 70
9 if type(formatted) == tuple:
13 if type(out) == tuple:
10 print formatted[0]
14 print out[0][:-1]
11 print "-" * 70
15 print "-" * 70
12 print html
16 pprint(out[1])
13 print "-" * 70
14 pprint(formatted[1])
15 else:
17 else:
16 print formatted
18 print out[:-1]
17 print "-" * 70
18 print html
19 print "-" * 70
19 print "-" * 70
20 print
20 print
21
21
22 def debugformats(title, text, **kwargs):
23 print "== %s ==" % title
24 debugformat(text, 60, **kwargs)
25 debugformat(text, 30, **kwargs)
26 debugformat(text, 'html', **kwargs)
27
22 paragraphs = """
28 paragraphs = """
23 This is some text in the first paragraph.
29 This is some text in the first paragraph.
24
30
25 A small indented paragraph.
31 A small indented paragraph.
26 It is followed by some lines
32 It is followed by some lines
27 containing random whitespace.
33 containing random whitespace.
28 \n \n \nThe third and final paragraph.
34 \n \n \nThe third and final paragraph.
29 """
35 """
30
36
31 debugformat('paragraphs', paragraphs, 60)
37 debugformats('paragraphs', paragraphs)
32 debugformat('paragraphs', paragraphs, 30)
33
34
38
35 definitions = """
39 definitions = """
36 A Term
40 A Term
37 Definition. The indented
41 Definition. The indented
38 lines make up the definition.
42 lines make up the definition.
39 Another Term
43 Another Term
40 Another definition. The final line in the
44 Another definition. The final line in the
41 definition determines the indentation, so
45 definition determines the indentation, so
42 this will be indented with four spaces.
46 this will be indented with four spaces.
43
47
44 A Nested/Indented Term
48 A Nested/Indented Term
45 Definition.
49 Definition.
46 """
50 """
47
51
48 debugformat('definitions', definitions, 60)
52 debugformats('definitions', definitions)
49 debugformat('definitions', definitions, 30)
50
51
53
52 literals = r"""
54 literals = r"""
53 The fully minimized form is the most
55 The fully minimized form is the most
54 convenient form::
56 convenient form::
55
57
56 Hello
58 Hello
57 literal
59 literal
58 world
60 world
59
61
60 In the partially minimized form a paragraph
62 In the partially minimized form a paragraph
61 simply ends with space-double-colon. ::
63 simply ends with space-double-colon. ::
62
64
63 ////////////////////////////////////////
65 ////////////////////////////////////////
64 long un-wrapped line in a literal block
66 long un-wrapped line in a literal block
65 \\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\
67 \\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\
66
68
67 ::
69 ::
68
70
69 This literal block is started with '::',
71 This literal block is started with '::',
70 the so-called expanded form. The paragraph
72 the so-called expanded form. The paragraph
71 with '::' disappears in the final output.
73 with '::' disappears in the final output.
72 """
74 """
73
75
74 debugformat('literals', literals, 60)
76 debugformats('literals', literals)
75 debugformat('literals', literals, 30)
76
77
77
78 lists = """
78 lists = """
79 - This is the first list item.
79 - This is the first list item.
80
80
81 Second paragraph in the first list item.
81 Second paragraph in the first list item.
82
82
83 - List items need not be separated
83 - List items need not be separated
84 by a blank line.
84 by a blank line.
85 - And will be rendered without
85 - And will be rendered without
86 one in any case.
86 one in any case.
87
87
88 We can have indented lists:
88 We can have indented lists:
89
89
90 - This is an indented list item
90 - This is an indented list item
91
91
92 - Another indented list item::
92 - Another indented list item::
93
93
94 - A literal block in the middle
94 - A literal block in the middle
95 of an indented list.
95 of an indented list.
96
96
97 (The above is not a list item since we are in the literal block.)
97 (The above is not a list item since we are in the literal block.)
98
98
99 ::
99 ::
100
100
101 Literal block with no indentation (apart from
101 Literal block with no indentation (apart from
102 the two spaces added to all literal blocks).
102 the two spaces added to all literal blocks).
103
103
104 1. This is an enumerated list (first item).
104 1. This is an enumerated list (first item).
105 2. Continuing with the second item.
105 2. Continuing with the second item.
106
106
107 (1) foo
107 (1) foo
108 (2) bar
108 (2) bar
109
109
110 1) Another
110 1) Another
111 2) List
111 2) List
112
112
113 Line blocks are also a form of list:
113 Line blocks are also a form of list:
114
114
115 | This is the first line.
115 | This is the first line.
116 The line continues here.
116 The line continues here.
117 | This is the second line.
117 | This is the second line.
118 """
118 """
119
119
120 debugformat('lists', lists, 60)
120 debugformats('lists', lists)
121 debugformat('lists', lists, 30)
122
123
121
124 options = """
122 options = """
125 There is support for simple option lists,
123 There is support for simple option lists,
126 but only with long options:
124 but only with long options:
127
125
128 -X, --exclude filter an option with a short and long option with an argument
126 -X, --exclude filter an option with a short and long option with an argument
129 -I, --include an option with both a short option and a long option
127 -I, --include an option with both a short option and a long option
130 --all Output all.
128 --all Output all.
131 --both Output both (this description is
129 --both Output both (this description is
132 quite long).
130 quite long).
133 --long Output all day long.
131 --long Output all day long.
134
132
135 --par This option has two paragraphs in its description.
133 --par This option has two paragraphs in its description.
136 This is the first.
134 This is the first.
137
135
138 This is the second. Blank lines may be omitted between
136 This is the second. Blank lines may be omitted between
139 options (as above) or left in (as here).
137 options (as above) or left in (as here).
140
138
141
139
142 The next paragraph looks like an option list, but lacks the two-space
140 The next paragraph looks like an option list, but lacks the two-space
143 marker after the option. It is treated as a normal paragraph:
141 marker after the option. It is treated as a normal paragraph:
144
142
145 --foo bar baz
143 --foo bar baz
146 """
144 """
147
145
148 debugformat('options', options, 60)
146 debugformats('options', options)
149 debugformat('options', options, 30)
150
151
147
152 fields = """
148 fields = """
153 :a: First item.
149 :a: First item.
154 :ab: Second item. Indentation and wrapping
150 :ab: Second item. Indentation and wrapping
155 is handled automatically.
151 is handled automatically.
156
152
157 Next list:
153 Next list:
158
154
159 :small: The larger key below triggers full indentation here.
155 :small: The larger key below triggers full indentation here.
160 :much too large: This key is big enough to get its own line.
156 :much too large: This key is big enough to get its own line.
161 """
157 """
162
158
163 debugformat('fields', fields, 60)
159 debugformats('fields', fields)
164 debugformat('fields', fields, 30)
165
160
166 containers = """
161 containers = """
167 Normal output.
162 Normal output.
168
163
169 .. container:: debug
164 .. container:: debug
170
165
171 Initial debug output.
166 Initial debug output.
172
167
173 .. container:: verbose
168 .. container:: verbose
174
169
175 Verbose output.
170 Verbose output.
176
171
177 .. container:: debug
172 .. container:: debug
178
173
179 Debug output.
174 Debug output.
180 """
175 """
181
176
182 debugformat('containers (normal)', containers, 60)
177 debugformats('containers (normal)', containers)
183 debugformat('containers (verbose)', containers, 60, keep=['verbose'])
178 debugformats('containers (verbose)', containers, keep=['verbose'])
184 debugformat('containers (debug)', containers, 60, keep=['debug'])
179 debugformats('containers (debug)', containers, keep=['debug'])
185 debugformat('containers (verbose debug)', containers, 60,
180 debugformats('containers (verbose debug)', containers,
186 keep=['verbose', 'debug'])
181 keep=['verbose', 'debug'])
187
182
188 roles = """Please see :hg:`add`."""
183 roles = """Please see :hg:`add`."""
189 debugformat('roles', roles, 60)
184 debugformats('roles', roles)
190
185
191
186
192 sections = """
187 sections = """
193 Title
188 Title
194 =====
189 =====
195
190
196 Section
191 Section
197 -------
192 -------
198
193
199 Subsection
194 Subsection
200 ''''''''''
195 ''''''''''
201
196
202 Markup: ``foo`` and :hg:`help`
197 Markup: ``foo`` and :hg:`help`
203 ------------------------------
198 ------------------------------
204 """
199 """
205 debugformat('sections', sections, 20)
200 debugformats('sections', sections)
206
201
207
202
208 admonitions = """
203 admonitions = """
209 .. note::
204 .. note::
210 This is a note
205 This is a note
211
206
212 - Bullet 1
207 - Bullet 1
213 - Bullet 2
208 - Bullet 2
214
209
215 .. warning:: This is a warning Second
210 .. warning:: This is a warning Second
216 input line of warning
211 input line of warning
217
212
218 .. danger::
213 .. danger::
219 This is danger
214 This is danger
220 """
215 """
221
216
222 debugformat('admonitions', admonitions, 30)
217 debugformats('admonitions', admonitions)
223
218
224 comments = """
219 comments = """
225 Some text.
220 Some text.
226
221
227 .. A comment
222 .. A comment
228
223
229 .. An indented comment
224 .. An indented comment
230
225
231 Some indented text.
226 Some indented text.
232
227
233 ..
228 ..
234
229
235 Empty comment above
230 Empty comment above
236 """
231 """
237
232
238 debugformat('comments', comments, 30)
233 debugformats('comments', comments)
239
234
240
235
241 data = [['a', 'b', 'c'],
236 data = [['a', 'b', 'c'],
242 ['1', '2', '3'],
237 ['1', '2', '3'],
243 ['foo', 'bar', 'baz this list is very very very long man']]
238 ['foo', 'bar', 'baz this list is very very very long man']]
244
239
245 table = minirst.maketable(data, 2, True)
240 table = minirst.maketable(data, 2, True)
246
241
247 print table
242 print table
248
243
249 debugformat('table', table, 30)
244 debugformats('table', table)
This diff has been collapsed as it changes many lines, (521 lines changed) Show them Hide them
@@ -1,761 +1,764 b''
1 paragraphs formatted to fit within 60 characters:
1 == paragraphs ==
2 60 column format:
2 ----------------------------------------------------------------------
3 ----------------------------------------------------------------------
3 This is some text in the first paragraph.
4 This is some text in the first paragraph.
4
5
5 A small indented paragraph. It is followed by some lines
6 A small indented paragraph. It is followed by some lines
6 containing random whitespace.
7 containing random whitespace.
7
8
8 The third and final paragraph.
9 The third and final paragraph.
10 ----------------------------------------------------------------------
9
11
12 30 column format:
13 ----------------------------------------------------------------------
14 This is some text in the first
15 paragraph.
16
17 A small indented paragraph.
18 It is followed by some lines
19 containing random
20 whitespace.
21
22 The third and final paragraph.
23 ----------------------------------------------------------------------
24
25 html format:
10 ----------------------------------------------------------------------
26 ----------------------------------------------------------------------
11 <p>
27 <p>
12 This is some text in the first paragraph.
28 This is some text in the first paragraph.
13 </p>
29 </p>
14 <p>
30 <p>
15 A small indented paragraph.
31 A small indented paragraph.
16 It is followed by some lines
32 It is followed by some lines
17 containing random whitespace.
33 containing random whitespace.
18 </p>
34 </p>
19 <p>
35 <p>
20 The third and final paragraph.
36 The third and final paragraph.
21 </p>
37 </p>
22
23 ----------------------------------------------------------------------
38 ----------------------------------------------------------------------
24
39
25 paragraphs formatted to fit within 30 characters:
40 == definitions ==
26 ----------------------------------------------------------------------
41 60 column format:
27 This is some text in the first
28 paragraph.
29
30 A small indented paragraph.
31 It is followed by some lines
32 containing random
33 whitespace.
34
35 The third and final paragraph.
36
37 ----------------------------------------------------------------------
38 <p>
39 This is some text in the first paragraph.
40 </p>
41 <p>
42 A small indented paragraph.
43 It is followed by some lines
44 containing random whitespace.
45 </p>
46 <p>
47 The third and final paragraph.
48 </p>
49
50 ----------------------------------------------------------------------
51
52 definitions formatted to fit within 60 characters:
53 ----------------------------------------------------------------------
42 ----------------------------------------------------------------------
54 A Term
43 A Term
55 Definition. The indented lines make up the definition.
44 Definition. The indented lines make up the definition.
56
45
57 Another Term
46 Another Term
58 Another definition. The final line in the definition
47 Another definition. The final line in the definition
59 determines the indentation, so this will be indented
48 determines the indentation, so this will be indented
60 with four spaces.
49 with four spaces.
61
50
62 A Nested/Indented Term
51 A Nested/Indented Term
63 Definition.
52 Definition.
64
65 ----------------------------------------------------------------------
66 <dl>
67 <dt>A Term
68 <dd>Definition. The indented lines make up the definition.
69 <dt>Another Term
70 <dd>Another definition. The final line in the definition determines the indentation, so this will be indented with four spaces.
71 <dt>A Nested/Indented Term
72 <dd>Definition.
73 </dl>
74
75 ----------------------------------------------------------------------
53 ----------------------------------------------------------------------
76
54
77 definitions formatted to fit within 30 characters:
55 30 column format:
78 ----------------------------------------------------------------------
56 ----------------------------------------------------------------------
79 A Term
57 A Term
80 Definition. The indented
58 Definition. The indented
81 lines make up the
59 lines make up the
82 definition.
60 definition.
83
61
84 Another Term
62 Another Term
85 Another definition. The
63 Another definition. The
86 final line in the
64 final line in the
87 definition determines the
65 definition determines the
88 indentation, so this will
66 indentation, so this will
89 be indented with four
67 be indented with four
90 spaces.
68 spaces.
91
69
92 A Nested/Indented Term
70 A Nested/Indented Term
93 Definition.
71 Definition.
72 ----------------------------------------------------------------------
94
73
74 html format:
95 ----------------------------------------------------------------------
75 ----------------------------------------------------------------------
96 <dl>
76 <dl>
97 <dt>A Term
77 <dt>A Term
98 <dd>Definition. The indented lines make up the definition.
78 <dd>Definition. The indented lines make up the definition.
99 <dt>Another Term
79 <dt>Another Term
100 <dd>Another definition. The final line in the definition determines the indentation, so this will be indented with four spaces.
80 <dd>Another definition. The final line in the definition determines the indentation, so this will be indented with four spaces.
101 <dt>A Nested/Indented Term
81 <dt>A Nested/Indented Term
102 <dd>Definition.
82 <dd>Definition.
103 </dl>
83 </dl>
104
105 ----------------------------------------------------------------------
84 ----------------------------------------------------------------------
106
85
107 literals formatted to fit within 60 characters:
86 == literals ==
87 60 column format:
108 ----------------------------------------------------------------------
88 ----------------------------------------------------------------------
109 The fully minimized form is the most convenient form:
89 The fully minimized form is the most convenient form:
110
90
111 Hello
91 Hello
112 literal
92 literal
113 world
93 world
114
94
115 In the partially minimized form a paragraph simply ends with
95 In the partially minimized form a paragraph simply ends with
116 space-double-colon.
96 space-double-colon.
117
97
118 ////////////////////////////////////////
98 ////////////////////////////////////////
119 long un-wrapped line in a literal block
99 long un-wrapped line in a literal block
120 \\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\
100 \\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\
121
101
122 This literal block is started with '::',
102 This literal block is started with '::',
123 the so-called expanded form. The paragraph
103 the so-called expanded form. The paragraph
124 with '::' disappears in the final output.
104 with '::' disappears in the final output.
105 ----------------------------------------------------------------------
125
106
107 30 column format:
108 ----------------------------------------------------------------------
109 The fully minimized form is
110 the most convenient form:
111
112 Hello
113 literal
114 world
115
116 In the partially minimized
117 form a paragraph simply ends
118 with space-double-colon.
119
120 ////////////////////////////////////////
121 long un-wrapped line in a literal block
122 \\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\
123
124 This literal block is started with '::',
125 the so-called expanded form. The paragraph
126 with '::' disappears in the final output.
127 ----------------------------------------------------------------------
128
129 html format:
126 ----------------------------------------------------------------------
130 ----------------------------------------------------------------------
127 <p>
131 <p>
128 The fully minimized form is the most
132 The fully minimized form is the most
129 convenient form:
133 convenient form:
130 </p>
134 </p>
131 <pre>
135 <pre>
132 Hello
136 Hello
133 literal
137 literal
134 world
138 world
135 </pre>
139 </pre>
136 <p>
140 <p>
137 In the partially minimized form a paragraph
141 In the partially minimized form a paragraph
138 simply ends with space-double-colon.
142 simply ends with space-double-colon.
139 </p>
143 </p>
140 <pre>
144 <pre>
141 ////////////////////////////////////////
145 ////////////////////////////////////////
142 long un-wrapped line in a literal block
146 long un-wrapped line in a literal block
143 \\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\
147 \\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\
144 </pre>
148 </pre>
145 <pre>
149 <pre>
146 This literal block is started with '::',
150 This literal block is started with '::',
147 the so-called expanded form. The paragraph
151 the so-called expanded form. The paragraph
148 with '::' disappears in the final output.
152 with '::' disappears in the final output.
149 </pre>
153 </pre>
150
151 ----------------------------------------------------------------------
154 ----------------------------------------------------------------------
152
155
153 literals formatted to fit within 30 characters:
156 == lists ==
154 ----------------------------------------------------------------------
157 60 column format:
155 The fully minimized form is
156 the most convenient form:
157
158 Hello
159 literal
160 world
161
162 In the partially minimized
163 form a paragraph simply ends
164 with space-double-colon.
165
166 ////////////////////////////////////////
167 long un-wrapped line in a literal block
168 \\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\
169
170 This literal block is started with '::',
171 the so-called expanded form. The paragraph
172 with '::' disappears in the final output.
173
174 ----------------------------------------------------------------------
175 <p>
176 The fully minimized form is the most
177 convenient form:
178 </p>
179 <pre>
180 Hello
181 literal
182 world
183 </pre>
184 <p>
185 In the partially minimized form a paragraph
186 simply ends with space-double-colon.
187 </p>
188 <pre>
189 ////////////////////////////////////////
190 long un-wrapped line in a literal block
191 \\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\
192 </pre>
193 <pre>
194 This literal block is started with '::',
195 the so-called expanded form. The paragraph
196 with '::' disappears in the final output.
197 </pre>
198
199 ----------------------------------------------------------------------
200
201 lists formatted to fit within 60 characters:
202 ----------------------------------------------------------------------
158 ----------------------------------------------------------------------
203 - This is the first list item.
159 - This is the first list item.
204
160
205 Second paragraph in the first list item.
161 Second paragraph in the first list item.
206
162
207 - List items need not be separated by a blank line.
163 - List items need not be separated by a blank line.
208 - And will be rendered without one in any case.
164 - And will be rendered without one in any case.
209
165
210 We can have indented lists:
166 We can have indented lists:
211
167
212 - This is an indented list item
168 - This is an indented list item
213 - Another indented list item:
169 - Another indented list item:
214
170
215 - A literal block in the middle
171 - A literal block in the middle
216 of an indented list.
172 of an indented list.
217
173
218 (The above is not a list item since we are in the literal block.)
174 (The above is not a list item since we are in the literal block.)
219
175
220 Literal block with no indentation (apart from
176 Literal block with no indentation (apart from
221 the two spaces added to all literal blocks).
177 the two spaces added to all literal blocks).
222
178
223 1. This is an enumerated list (first item).
179 1. This is an enumerated list (first item).
224 2. Continuing with the second item.
180 2. Continuing with the second item.
225 (1) foo
181 (1) foo
226 (2) bar
182 (2) bar
227 1) Another
183 1) Another
228 2) List
184 2) List
229
185
230 Line blocks are also a form of list:
186 Line blocks are also a form of list:
231
187
232 This is the first line. The line continues here.
188 This is the first line. The line continues here.
233 This is the second line.
189 This is the second line.
190 ----------------------------------------------------------------------
234
191
192 30 column format:
193 ----------------------------------------------------------------------
194 - This is the first list item.
195
196 Second paragraph in the
197 first list item.
198
199 - List items need not be
200 separated by a blank line.
201 - And will be rendered without
202 one in any case.
203
204 We can have indented lists:
205
206 - This is an indented list
207 item
208 - Another indented list
209 item:
210
211 - A literal block in the middle
212 of an indented list.
213
214 (The above is not a list item since we are in the literal block.)
215
216 Literal block with no indentation (apart from
217 the two spaces added to all literal blocks).
218
219 1. This is an enumerated list
220 (first item).
221 2. Continuing with the second
222 item.
223 (1) foo
224 (2) bar
225 1) Another
226 2) List
227
228 Line blocks are also a form of
229 list:
230
231 This is the first line. The
232 line continues here.
233 This is the second line.
234 ----------------------------------------------------------------------
235
236 html format:
235 ----------------------------------------------------------------------
237 ----------------------------------------------------------------------
236 <ul>
238 <ul>
237 <li> This is the first list item.
239 <li> This is the first list item.
238 <p>
240 <p>
239 Second paragraph in the first list item.
241 Second paragraph in the first list item.
240 </p>
242 </p>
241 <li> List items need not be separated by a blank line.
243 <li> List items need not be separated by a blank line.
242 <li> And will be rendered without one in any case.
244 <li> And will be rendered without one in any case.
243 </ul>
245 </ul>
244 <p>
246 <p>
245 We can have indented lists:
247 We can have indented lists:
246 </p>
248 </p>
247 <ul>
249 <ul>
248 <li> This is an indented list item
250 <li> This is an indented list item
249 <li> Another indented list item:
251 <li> Another indented list item:
250 <pre>
252 <pre>
251 - A literal block in the middle
253 - A literal block in the middle
252 of an indented list.
254 of an indented list.
253 </pre>
255 </pre>
254 <pre>
256 <pre>
255 (The above is not a list item since we are in the literal block.)
257 (The above is not a list item since we are in the literal block.)
256 </pre>
258 </pre>
257 </ul>
259 </ul>
258 <pre>
260 <pre>
259 Literal block with no indentation (apart from
261 Literal block with no indentation (apart from
260 the two spaces added to all literal blocks).
262 the two spaces added to all literal blocks).
261 </pre>
263 </pre>
262 <ol>
264 <ol>
263 <li> This is an enumerated list (first item).
265 <li> This is an enumerated list (first item).
264 <li> Continuing with the second item.
266 <li> Continuing with the second item.
265 <li> foo
267 <li> foo
266 <li> bar
268 <li> bar
267 <li> Another
269 <li> Another
268 <li> List
270 <li> List
269 </ol>
271 </ol>
270 <p>
272 <p>
271 Line blocks are also a form of list:
273 Line blocks are also a form of list:
272 </p>
274 </p>
273 <ol>
275 <ol>
274 <li> This is the first line. The line continues here.
276 <li> This is the first line. The line continues here.
275 <li> This is the second line.
277 <li> This is the second line.
276 </ol>
278 </ol>
277
278 ----------------------------------------------------------------------
279 ----------------------------------------------------------------------
279
280
280 lists formatted to fit within 30 characters:
281 == options ==
281 ----------------------------------------------------------------------
282 60 column format:
282 - This is the first list item.
283
284 Second paragraph in the
285 first list item.
286
287 - List items need not be
288 separated by a blank line.
289 - And will be rendered without
290 one in any case.
291
292 We can have indented lists:
293
294 - This is an indented list
295 item
296 - Another indented list
297 item:
298
299 - A literal block in the middle
300 of an indented list.
301
302 (The above is not a list item since we are in the literal block.)
303
304 Literal block with no indentation (apart from
305 the two spaces added to all literal blocks).
306
307 1. This is an enumerated list
308 (first item).
309 2. Continuing with the second
310 item.
311 (1) foo
312 (2) bar
313 1) Another
314 2) List
315
316 Line blocks are also a form of
317 list:
318
319 This is the first line. The
320 line continues here.
321 This is the second line.
322
323 ----------------------------------------------------------------------
324 <ul>
325 <li> This is the first list item.
326 <p>
327 Second paragraph in the first list item.
328 </p>
329 <li> List items need not be separated by a blank line.
330 <li> And will be rendered without one in any case.
331 </ul>
332 <p>
333 We can have indented lists:
334 </p>
335 <ul>
336 <li> This is an indented list item
337 <li> Another indented list item:
338 <pre>
339 - A literal block in the middle
340 of an indented list.
341 </pre>
342 <pre>
343 (The above is not a list item since we are in the literal block.)
344 </pre>
345 </ul>
346 <pre>
347 Literal block with no indentation (apart from
348 the two spaces added to all literal blocks).
349 </pre>
350 <ol>
351 <li> This is an enumerated list (first item).
352 <li> Continuing with the second item.
353 <li> foo
354 <li> bar
355 <li> Another
356 <li> List
357 </ol>
358 <p>
359 Line blocks are also a form of list:
360 </p>
361 <ol>
362 <li> This is the first line. The line continues here.
363 <li> This is the second line.
364 </ol>
365
366 ----------------------------------------------------------------------
367
368 options formatted to fit within 60 characters:
369 ----------------------------------------------------------------------
283 ----------------------------------------------------------------------
370 There is support for simple option lists, but only with long
284 There is support for simple option lists, but only with long
371 options:
285 options:
372
286
373 -X --exclude filter an option with a short and long option
287 -X --exclude filter an option with a short and long option
374 with an argument
288 with an argument
375 -I --include an option with both a short option and
289 -I --include an option with both a short option and
376 a long option
290 a long option
377 --all Output all.
291 --all Output all.
378 --both Output both (this description is quite
292 --both Output both (this description is quite
379 long).
293 long).
380 --long Output all day long.
294 --long Output all day long.
381 --par This option has two paragraphs in its
295 --par This option has two paragraphs in its
382 description. This is the first.
296 description. This is the first.
383
297
384 This is the second. Blank lines may
298 This is the second. Blank lines may
385 be omitted between options (as above)
299 be omitted between options (as above)
386 or left in (as here).
300 or left in (as here).
387
301
388 The next paragraph looks like an option list, but lacks the
302 The next paragraph looks like an option list, but lacks the
389 two-space marker after the option. It is treated as a normal
303 two-space marker after the option. It is treated as a normal
390 paragraph:
304 paragraph:
391
305
392 --foo bar baz
306 --foo bar baz
393
394 ----------------------------------------------------------------------
395 <p>
396 There is support for simple option lists,
397 but only with long options:
398 </p>
399 <dl>
400 <dt>-X --exclude filter
401 <dd>an option with a short and long option with an argument
402 <dt>-I --include
403 <dd>an option with both a short option and a long option
404 <dt> --all
405 <dd>Output all.
406 <dt> --both
407 <dd>Output both (this description is quite long).
408 <dt> --long
409 <dd>Output all day long.
410 <dt> --par
411 <dd>This option has two paragraphs in its description. This is the first.
412 <p>
413 This is the second. Blank lines may be omitted between
414 options (as above) or left in (as here).
415 </p>
416 </dl>
417 <p>
418 The next paragraph looks like an option list, but lacks the two-space
419 marker after the option. It is treated as a normal paragraph:
420 </p>
421 <p>
422 --foo bar baz
423 </p>
424
425 ----------------------------------------------------------------------
307 ----------------------------------------------------------------------
426
308
427 options formatted to fit within 30 characters:
309 30 column format:
428 ----------------------------------------------------------------------
310 ----------------------------------------------------------------------
429 There is support for simple
311 There is support for simple
430 option lists, but only with
312 option lists, but only with
431 long options:
313 long options:
432
314
433 -X --exclude filter an
315 -X --exclude filter an
434 option
316 option
435 with a
317 with a
436 short
318 short
437 and
319 and
438 long
320 long
439 option
321 option
440 with an
322 with an
441 argumen
323 argumen
442 t
324 t
443 -I --include an
325 -I --include an
444 option
326 option
445 with
327 with
446 both a
328 both a
447 short
329 short
448 option
330 option
449 and a
331 and a
450 long
332 long
451 option
333 option
452 --all Output
334 --all Output
453 all.
335 all.
454 --both Output
336 --both Output
455 both
337 both
456 (this d
338 (this d
457 escript
339 escript
458 ion is
340 ion is
459 quite
341 quite
460 long).
342 long).
461 --long Output
343 --long Output
462 all day
344 all day
463 long.
345 long.
464 --par This
346 --par This
465 option
347 option
466 has two
348 has two
467 paragra
349 paragra
468 phs in
350 phs in
469 its des
351 its des
470 criptio
352 criptio
471 n. This
353 n. This
472 is the
354 is the
473 first.
355 first.
474
356
475 This is
357 This is
476 the
358 the
477 second.
359 second.
478 Blank
360 Blank
479 lines
361 lines
480 may be
362 may be
481 omitted
363 omitted
482 between
364 between
483 options
365 options
484 (as
366 (as
485 above)
367 above)
486 or left
368 or left
487 in (as
369 in (as
488 here).
370 here).
489
371
490 The next paragraph looks like
372 The next paragraph looks like
491 an option list, but lacks the
373 an option list, but lacks the
492 two-space marker after the
374 two-space marker after the
493 option. It is treated as a
375 option. It is treated as a
494 normal paragraph:
376 normal paragraph:
495
377
496 --foo bar baz
378 --foo bar baz
379 ----------------------------------------------------------------------
497
380
381 html format:
498 ----------------------------------------------------------------------
382 ----------------------------------------------------------------------
499 <p>
383 <p>
500 There is support for simple option lists,
384 There is support for simple option lists,
501 but only with long options:
385 but only with long options:
502 </p>
386 </p>
503 <dl>
387 <dl>
504 <dt>-X --exclude filter
388 <dt>-X --exclude filter
505 <dd>an option with a short and long option with an argument
389 <dd>an option with a short and long option with an argument
506 <dt>-I --include
390 <dt>-I --include
507 <dd>an option with both a short option and a long option
391 <dd>an option with both a short option and a long option
508 <dt> --all
392 <dt> --all
509 <dd>Output all.
393 <dd>Output all.
510 <dt> --both
394 <dt> --both
511 <dd>Output both (this description is quite long).
395 <dd>Output both (this description is quite long).
512 <dt> --long
396 <dt> --long
513 <dd>Output all day long.
397 <dd>Output all day long.
514 <dt> --par
398 <dt> --par
515 <dd>This option has two paragraphs in its description. This is the first.
399 <dd>This option has two paragraphs in its description. This is the first.
516 <p>
400 <p>
517 This is the second. Blank lines may be omitted between
401 This is the second. Blank lines may be omitted between
518 options (as above) or left in (as here).
402 options (as above) or left in (as here).
519 </p>
403 </p>
520 </dl>
404 </dl>
521 <p>
405 <p>
522 The next paragraph looks like an option list, but lacks the two-space
406 The next paragraph looks like an option list, but lacks the two-space
523 marker after the option. It is treated as a normal paragraph:
407 marker after the option. It is treated as a normal paragraph:
524 </p>
408 </p>
525 <p>
409 <p>
526 --foo bar baz
410 --foo bar baz
527 </p>
411 </p>
528
529 ----------------------------------------------------------------------
412 ----------------------------------------------------------------------
530
413
531 fields formatted to fit within 60 characters:
414 == fields ==
415 60 column format:
532 ----------------------------------------------------------------------
416 ----------------------------------------------------------------------
533 a First item.
417 a First item.
534 ab Second item. Indentation and wrapping is handled
418 ab Second item. Indentation and wrapping is handled
535 automatically.
419 automatically.
536
420
537 Next list:
421 Next list:
538
422
539 small The larger key below triggers full indentation
423 small The larger key below triggers full indentation
540 here.
424 here.
541 much too large
425 much too large
542 This key is big enough to get its own line.
426 This key is big enough to get its own line.
543
544 ----------------------------------------------------------------------
545 <dl>
546 <dt>a
547 <dd>First item.
548 <dt>ab
549 <dd>Second item. Indentation and wrapping is handled automatically.
550 </dl>
551 <p>
552 Next list:
553 </p>
554 <dl>
555 <dt>small
556 <dd>The larger key below triggers full indentation here.
557 <dt>much too large
558 <dd>This key is big enough to get its own line.
559 </dl>
560
561 ----------------------------------------------------------------------
427 ----------------------------------------------------------------------
562
428
563 fields formatted to fit within 30 characters:
429 30 column format:
564 ----------------------------------------------------------------------
430 ----------------------------------------------------------------------
565 a First item.
431 a First item.
566 ab Second item. Indentation
432 ab Second item. Indentation
567 and wrapping is handled
433 and wrapping is handled
568 automatically.
434 automatically.
569
435
570 Next list:
436 Next list:
571
437
572 small The larger key
438 small The larger key
573 below triggers
439 below triggers
574 full indentation
440 full indentation
575 here.
441 here.
576 much too large
442 much too large
577 This key is big
443 This key is big
578 enough to get its
444 enough to get its
579 own line.
445 own line.
446 ----------------------------------------------------------------------
580
447
448 html format:
581 ----------------------------------------------------------------------
449 ----------------------------------------------------------------------
582 <dl>
450 <dl>
583 <dt>a
451 <dt>a
584 <dd>First item.
452 <dd>First item.
585 <dt>ab
453 <dt>ab
586 <dd>Second item. Indentation and wrapping is handled automatically.
454 <dd>Second item. Indentation and wrapping is handled automatically.
587 </dl>
455 </dl>
588 <p>
456 <p>
589 Next list:
457 Next list:
590 </p>
458 </p>
591 <dl>
459 <dl>
592 <dt>small
460 <dt>small
593 <dd>The larger key below triggers full indentation here.
461 <dd>The larger key below triggers full indentation here.
594 <dt>much too large
462 <dt>much too large
595 <dd>This key is big enough to get its own line.
463 <dd>This key is big enough to get its own line.
596 </dl>
464 </dl>
597
598 ----------------------------------------------------------------------
465 ----------------------------------------------------------------------
599
466
600 containers (normal) formatted to fit within 60 characters:
467 == containers (normal) ==
468 60 column format:
601 ----------------------------------------------------------------------
469 ----------------------------------------------------------------------
602 Normal output.
470 Normal output.
471 ----------------------------------------------------------------------
603
472
473 30 column format:
474 ----------------------------------------------------------------------
475 Normal output.
476 ----------------------------------------------------------------------
477
478 html format:
604 ----------------------------------------------------------------------
479 ----------------------------------------------------------------------
605 <p>
480 <p>
606 Normal output.
481 Normal output.
607 </p>
482 </p>
608
609 ----------------------------------------------------------------------
483 ----------------------------------------------------------------------
610
484
611 containers (verbose) formatted to fit within 60 characters:
485 == containers (verbose) ==
486 60 column format:
487 ----------------------------------------------------------------------
488 Normal output.
489
490 Verbose output.
491 ----------------------------------------------------------------------
492 ['debug', 'debug']
493 ----------------------------------------------------------------------
494
495 30 column format:
612 ----------------------------------------------------------------------
496 ----------------------------------------------------------------------
613 Normal output.
497 Normal output.
614
498
615 Verbose output.
499 Verbose output.
500 ----------------------------------------------------------------------
501 ['debug', 'debug']
502 ----------------------------------------------------------------------
616
503
504 html format:
617 ----------------------------------------------------------------------
505 ----------------------------------------------------------------------
618 ('<p>\nNormal output.\n</p>\n<p>\nVerbose output.\n</p>\n', ['debug', 'debug'])
506 <p>
507 Normal output.
508 </p>
509 <p>
510 Verbose output.
511 </p>
619 ----------------------------------------------------------------------
512 ----------------------------------------------------------------------
620 ['debug', 'debug']
513 ['debug', 'debug']
621 ----------------------------------------------------------------------
514 ----------------------------------------------------------------------
622
515
623 containers (debug) formatted to fit within 60 characters:
516 == containers (debug) ==
517 60 column format:
518 ----------------------------------------------------------------------
519 Normal output.
520
521 Initial debug output.
522 ----------------------------------------------------------------------
523 ['verbose']
524 ----------------------------------------------------------------------
525
526 30 column format:
624 ----------------------------------------------------------------------
527 ----------------------------------------------------------------------
625 Normal output.
528 Normal output.
626
529
627 Initial debug output.
530 Initial debug output.
628
629 ----------------------------------------------------------------------
630 ('<p>\nNormal output.\n</p>\n<p>\nInitial debug output.\n</p>\n', ['verbose'])
631 ----------------------------------------------------------------------
531 ----------------------------------------------------------------------
632 ['verbose']
532 ['verbose']
633 ----------------------------------------------------------------------
533 ----------------------------------------------------------------------
634
534
635 containers (verbose debug) formatted to fit within 60 characters:
535 html format:
536 ----------------------------------------------------------------------
537 <p>
538 Normal output.
539 </p>
540 <p>
541 Initial debug output.
542 </p>
543 ----------------------------------------------------------------------
544 ['verbose']
545 ----------------------------------------------------------------------
546
547 == containers (verbose debug) ==
548 60 column format:
636 ----------------------------------------------------------------------
549 ----------------------------------------------------------------------
637 Normal output.
550 Normal output.
638
551
639 Initial debug output.
552 Initial debug output.
640
553
641 Verbose output.
554 Verbose output.
642
555
643 Debug output.
556 Debug output.
557 ----------------------------------------------------------------------
558 []
559 ----------------------------------------------------------------------
644
560
561 30 column format:
645 ----------------------------------------------------------------------
562 ----------------------------------------------------------------------
646 ('<p>\nNormal output.\n</p>\n<p>\nInitial debug output.\n</p>\n<p>\nVerbose output.\n</p>\n<p>\nDebug output.\n</p>\n', [])
563 Normal output.
564
565 Initial debug output.
566
567 Verbose output.
568
569 Debug output.
647 ----------------------------------------------------------------------
570 ----------------------------------------------------------------------
648 []
571 []
649 ----------------------------------------------------------------------
572 ----------------------------------------------------------------------
650
573
651 roles formatted to fit within 60 characters:
574 html format:
575 ----------------------------------------------------------------------
576 <p>
577 Normal output.
578 </p>
579 <p>
580 Initial debug output.
581 </p>
582 <p>
583 Verbose output.
584 </p>
585 <p>
586 Debug output.
587 </p>
588 ----------------------------------------------------------------------
589 []
590 ----------------------------------------------------------------------
591
592 == roles ==
593 60 column format:
652 ----------------------------------------------------------------------
594 ----------------------------------------------------------------------
653 Please see "hg add".
595 Please see "hg add".
596 ----------------------------------------------------------------------
654
597
598 30 column format:
599 ----------------------------------------------------------------------
600 Please see "hg add".
601 ----------------------------------------------------------------------
602
603 html format:
655 ----------------------------------------------------------------------
604 ----------------------------------------------------------------------
656 <p>
605 <p>
657 Please see "hg add".
606 Please see "hg add".
658 </p>
607 </p>
659
660 ----------------------------------------------------------------------
608 ----------------------------------------------------------------------
661
609
662 sections formatted to fit within 20 characters:
610 == sections ==
611 60 column format:
663 ----------------------------------------------------------------------
612 ----------------------------------------------------------------------
664 Title
613 Title
665 =====
614 =====
666
615
667 Section
616 Section
668 -------
617 -------
669
618
670 Subsection
619 Subsection
671 ''''''''''
620 ''''''''''
672
621
673 Markup: "foo" and "hg help"
622 Markup: "foo" and "hg help"
674 ---------------------------
623 ---------------------------
624 ----------------------------------------------------------------------
675
625
626 30 column format:
627 ----------------------------------------------------------------------
628 Title
629 =====
630
631 Section
632 -------
633
634 Subsection
635 ''''''''''
636
637 Markup: "foo" and "hg help"
638 ---------------------------
639 ----------------------------------------------------------------------
640
641 html format:
676 ----------------------------------------------------------------------
642 ----------------------------------------------------------------------
677 <h1>Title</h1>
643 <h1>Title</h1>
678 <h2>Section</h2>
644 <h2>Section</h2>
679 <h3>Subsection</h3>
645 <h3>Subsection</h3>
680 <h2>Markup: "foo" and "hg help"</h2>
646 <h2>Markup: "foo" and "hg help"</h2>
681
682 ----------------------------------------------------------------------
647 ----------------------------------------------------------------------
683
648
684 admonitions formatted to fit within 30 characters:
649 == admonitions ==
650 60 column format:
651 ----------------------------------------------------------------------
652 Note:
653 This is a note
654
655 - Bullet 1
656 - Bullet 2
657
658 Warning!
659 This is a warning Second input line of warning
660
661 !Danger!
662 This is danger
663 ----------------------------------------------------------------------
664
665 30 column format:
685 ----------------------------------------------------------------------
666 ----------------------------------------------------------------------
686 Note:
667 Note:
687 This is a note
668 This is a note
688
669
689 - Bullet 1
670 - Bullet 1
690 - Bullet 2
671 - Bullet 2
691
672
692 Warning!
673 Warning!
693 This is a warning Second
674 This is a warning Second
694 input line of warning
675 input line of warning
695
676
696 !Danger!
677 !Danger!
697 This is danger
678 This is danger
679 ----------------------------------------------------------------------
698
680
681 html format:
699 ----------------------------------------------------------------------
682 ----------------------------------------------------------------------
700 <p>
683 <p>
701 <b>Note:</b> This is a note
684 <b>Note:</b> This is a note
702 </p>
685 </p>
703 <ul>
686 <ul>
704 <li> Bullet 1
687 <li> Bullet 1
705 <li> Bullet 2
688 <li> Bullet 2
706 </ul>
689 </ul>
707 <p>
690 <p>
708 <b>Warning!</b> This is a warning Second input line of warning
691 <b>Warning!</b> This is a warning Second input line of warning
709 </p>
692 </p>
710 <p>
693 <p>
711 <b>!Danger!</b> This is danger
694 <b>!Danger!</b> This is danger
712 </p>
695 </p>
713
714 ----------------------------------------------------------------------
696 ----------------------------------------------------------------------
715
697
716 comments formatted to fit within 30 characters:
698 == comments ==
699 60 column format:
717 ----------------------------------------------------------------------
700 ----------------------------------------------------------------------
718 Some text.
701 Some text.
719
702
720 Some indented text.
703 Some indented text.
721
704
722 Empty comment above
705 Empty comment above
706 ----------------------------------------------------------------------
723
707
708 30 column format:
709 ----------------------------------------------------------------------
710 Some text.
711
712 Some indented text.
713
714 Empty comment above
715 ----------------------------------------------------------------------
716
717 html format:
724 ----------------------------------------------------------------------
718 ----------------------------------------------------------------------
725 <p>
719 <p>
726 Some text.
720 Some text.
727 </p>
721 </p>
728 <p>
722 <p>
729 Some indented text.
723 Some indented text.
730 </p>
724 </p>
731 <p>
725 <p>
732 Empty comment above
726 Empty comment above
733 </p>
727 </p>
734
735 ----------------------------------------------------------------------
728 ----------------------------------------------------------------------
736
729
737 === === ========================================
730 === === ========================================
738 a b c
731 a b c
739 === === ========================================
732 === === ========================================
740 1 2 3
733 1 2 3
741 foo bar baz this list is very very very long man
734 foo bar baz this list is very very very long man
742 === === ========================================
735 === === ========================================
743
736
744 table formatted to fit within 30 characters:
737 == table ==
738 60 column format:
739 ----------------------------------------------------------------------
740 a b c
741 ------------------------------------------------
742 1 2 3
743 foo bar baz this list is very very very long man
744 ----------------------------------------------------------------------
745
746 30 column format:
745 ----------------------------------------------------------------------
747 ----------------------------------------------------------------------
746 a b c
748 a b c
747 ------------------------------
749 ------------------------------
748 1 2 3
750 1 2 3
749 foo bar baz this list is
751 foo bar baz this list is
750 very very very long
752 very very very long
751 man
753 man
754 ----------------------------------------------------------------------
752
755
756 html format:
753 ----------------------------------------------------------------------
757 ----------------------------------------------------------------------
754 <table>
758 <table>
755 <tr><th>a</th><th>b</th><th>c</th></tr>
759 <tr><th>a</th><th>b</th><th>c</th></tr>
756 <tr><td>1</td><td>2</td><td>3</td></tr>
760 <tr><td>1</td><td>2</td><td>3</td></tr>
757 <tr><td>foo</td><td>bar</td><td>baz this list is very very very long man</td></tr>
761 <tr><td>foo</td><td>bar</td><td>baz this list is very very very long man</td></tr>
758 </table>
762 </table>
759
760 ----------------------------------------------------------------------
763 ----------------------------------------------------------------------
761
764
General Comments 0
You need to be logged in to leave comments. Login now