comparison tests/test-minirst.py @ 15262:e8076af14498

minirst: add style flag to format
author Matt Mackall <mpm@selenic.com>
date Sat, 15 Oct 2011 00:39:04 -0500
parents e2df5b866d22
children 70d7293c41d6
comparison
equal deleted inserted replaced
15261:e2df5b866d22 15262:e8076af14498
2 from mercurial import minirst 2 from mercurial import minirst
3 3
4 def debugformat(title, text, width, **kwargs): 4 def debugformat(title, text, width, **kwargs):
5 print "%s formatted to fit within %d characters:" % (title, width) 5 print "%s formatted to fit within %d characters:" % (title, width)
6 formatted = minirst.format(text, width, **kwargs) 6 formatted = minirst.format(text, width, **kwargs)
7 html = minirst.formathtml(minirst.parse(text, **kwargs)[0]) 7 html = minirst.format(text, width, style='html', **kwargs)
8 print "-" * 70 8 print "-" * 70
9 if type(formatted) == tuple: 9 if type(formatted) == tuple:
10 print formatted[0] 10 print formatted[0]
11 print "-" * 70 11 print "-" * 70
12 print html
13 print "-" * 70
12 pprint(formatted[1]) 14 pprint(formatted[1])
13 else: 15 else:
14 print formatted 16 print formatted
15 print "-" * 70 17 print "-" * 70
16 print html 18 print html
17 print "-" * 70 19 print "-" * 70
18 print 20 print
19 21
20 paragraphs = """ 22 paragraphs = """
21 This is some text in the first paragraph. 23 This is some text in the first paragraph.