From 13c8f931b3edc89d8d67c816dac8965608648bd0 Mon Sep 17 00:00:00 2001 From: Johannes Löthberg Date: Tue, 15 Nov 2016 11:47:14 +0100 Subject: Move scripts to scripts/ MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Signed-off-by: Johannes Löthberg --- scripts/utils/__init__.py | 0 scripts/utils/reST.py | 13 +++++++++++++ 2 files changed, 13 insertions(+) create mode 100644 scripts/utils/__init__.py create mode 100644 scripts/utils/reST.py (limited to 'scripts/utils') diff --git a/scripts/utils/__init__.py b/scripts/utils/__init__.py new file mode 100644 index 0000000..e69de29 diff --git a/scripts/utils/reST.py b/scripts/utils/reST.py new file mode 100644 index 0000000..d99758c --- /dev/null +++ b/scripts/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'] -- cgit v1.2.3-70-g09d2