add two modified version and documentation
[pyblosxom2wxr] / convert_rst_frag.py
diff --git a/convert_rst_frag.py b/convert_rst_frag.py
new file mode 100755 (executable)
index 0000000..d52a948
--- /dev/null
@@ -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'))
+
+
+

Benjamin Mako Hill || Want to submit a patch?