X-Git-Url: https://projects.mako.cc/source/pyblosxom2wxr/blobdiff_plain/63b7950374b42e5bb351e534dfa3c150c3d5a285..f34e97609dfb44f29bfb8aceac0e1170707ba6e0:/convert_rst_frag.py diff --git a/convert_rst_frag.py b/convert_rst_frag.py new file mode 100755 index 0000000..d52a948 --- /dev/null +++ b/convert_rst_frag.py @@ -0,0 +1,17 @@ +#!/usr/bin/env python + +from docutils.core import publish_parts +import sys + +settings = { 'initial_header_level': 2, + 'doctitle_xform': 1 } + +raw_rst = ''.join(sys.stdin.readlines()) +html = publish_parts(raw_rst, writer_name='html', + settings_overrides=settings)['body'] +html = html.replace('\n', ' ') + +sys.stdout.write(html.encode('utf-8')) + + +