orgtohtml.py 421 B

1234567891011121314151617181920
  1. #!/usr/bin/env python
  2. # Going to export org to html
  3. # Neccasary import to convert org to html
  4. from orgpython import to_html
  5. # Inputs
  6. orgfile = input("ORG file: ")
  7. with open(orgfile) as f:
  8. text = f.read()
  9. # Do stuff
  10. orgfile = orgfile.replace(".org", ".html")
  11. with open(orgfile, 'w') as f:
  12. f.write(to_html(text, toc=False, offset=0, highlight=True))
  13. print(to_html(text, toc=False, offset=0, highlight=True))