Skip to content

Instantly share code, notes, and snippets.

@SimonSapin
Created November 12, 2020 13:58
Show Gist options
  • Save SimonSapin/33189a71392ce06349200d92f83d5852 to your computer and use it in GitHub Desktop.
Save SimonSapin/33189a71392ce06349200d92f83d5852 to your computer and use it in GitHub Desktop.
#!/home/simon/.virtualenvs/weasyprint/bin/python
import weasyprint
import markdown
import os
here = os.path.dirname(__file__)
with open(os.path.join(here, "resume.md"), encoding="utf-8") as f:
html = markdown.markdown(f.read(), extensions=["def_list"])
doc = weasyprint.HTML(string=html)
doc.write_pdf(os.path.join(here, "Simon Sapin.pdf"))
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment