summaryrefslogtreecommitdiffstats
path: root/utils
diff options
context:
space:
mode:
authorJohannes Löthberg <johannes@kyriasis.com>2016-11-12 02:06:41 +0100
committerJohannes Löthberg <johannes@kyriasis.com>2016-11-12 02:06:41 +0100
commit5591d977998a189573e8f780a5270ab81bb56ddc (patch)
tree16188b30ea414fb556b024aa20a4b918b1d61fbc /utils
downloadkyblo-5591d977998a189573e8f780a5270ab81bb56ddc.tar.xz
Initial commit
Signed-off-by: Johannes Löthberg <johannes@kyriasis.com>
Diffstat (limited to 'utils')
-rw-r--r--utils/__init__.py0
-rw-r--r--utils/reST.py13
2 files changed, 13 insertions, 0 deletions
diff --git a/utils/__init__.py b/utils/__init__.py
new file mode 100644
index 0000000..e69de29
--- /dev/null
+++ b/utils/__init__.py
diff --git a/utils/reST.py b/utils/reST.py
new file mode 100644
index 0000000..d99758c
--- /dev/null
+++ b/utils/reST.py
@@ -0,0 +1,13 @@
+from docutils import core
+
+def reST_to_html(source):
+ settings_overrides = {
+ 'footnote_references': 'superscript',
+ 'auto_id_prefix': 'id-',
+ 'initial_header_level': 3,
+ 'doctitle_xform': False,
+ }
+ formatted = core.publish_parts(source,
+ writer_name='html4css1',
+ settings_overrides=settings_overrides)
+ return formatted['body']