bgneal@1: #!/usr/bin/python bgneal@1: bgneal@1: import docutils.core bgneal@1: bgneal@1: with open('resume.rst', 'r') as f: bgneal@1: content = f.read() bgneal@1: bgneal@1: body = docutils.core.publish_parts(content, writer_name='html', bgneal@1: settings_overrides={ bgneal@1: 'doctitle_xform': False, bgneal@1: 'initial_header_level': 2, bgneal@1: })['html_body'] bgneal@1: bgneal@1: with open('resume-fragment.html', 'w') as f: bgneal@1: f.write(body)