Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- #!/usr/bin/env python
- import markdown
- import html2text
- import sys
- markdownfile = sys.argv[1]
- with open(markdownfile, 'r') as f:
- md = f.read()
- html = markdown.markdown(md)
- h = html2text.HTML2Text()
- h.ignore_links = True
- h.wrap_list_items = True
- h.unicode_snob = True
- h.ignore_emphasis = True
- h.bypass_tables = True
- h.ignore_tables = True
- text = h.handle(html)
- print (text)
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement