def debugformat(text, form, **kwargs): blocks, pruned = minirst.parse(text, **kwargs) if form == b'html': print("html format:") out = minirst.format(text, style=form, **kwargs) else: print("%d column format:" % form) out = minirst.format(text, width=form, **kwargs) print("-" * 70) print(out[:-1].decode('utf8')) if kwargs.get('keep'): print("-" * 70) print(stringutil.pprint(pruned).decode('utf8')) print("-" * 70) print()
def debugformat(text, form, **kwargs): if form == 'html': print "html format:" out = minirst.format(text, style=form, **kwargs) else: print "%d column format:" % form out = minirst.format(text, width=form, **kwargs) print "-" * 70 if type(out) == tuple: print out[0][:-1] print "-" * 70 pprint(out[1]) else: print out[:-1] print "-" * 70 print
def debugformat(text, form, **kwargs): if form == 'html': print("html format:") out = minirst.format(text, style=form, **kwargs) else: print("%d column format:" % form) out = minirst.format(text, width=form, **kwargs) print("-" * 70) if type(out) == tuple: print(out[0][:-1]) print("-" * 70) pprint.pprint(out[1]) else: print(out[:-1]) print("-" * 70) print()
def debugformat(text, form, **kwargs): if form == b'html': print("html format:") out = minirst.format(text, style=form, **kwargs) else: print("%d column format:" % form) out = minirst.format(text, width=form, **kwargs) print("-" * 70) if type(out) == tuple: print(out[0][:-1].decode('utf8')) print("-" * 70) print(stringutil.pprint(out[1]).decode('utf8')) else: print(out[:-1].decode('utf8')) print("-" * 70) print()
def debugformat(title, text, width, **kwargs): print "%s formatted to fit within %d characters:" % (title, width) print "-" * 70 formatted = minirst.format(text, width, **kwargs) if type(formatted) == tuple: print formatted[0] print "-" * 70 pprint(formatted[1]) else: print formatted print "-" * 70 print