summaryrefslogtreecommitdiffstats
path: root/kyrias_website/util.py
blob: 10ede7770eab3f79efe046cea9f77b1ded395a27 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
from docutils.core import publish_parts

def rst_renderer(text):
    settings_overrides = {
        'footnote_references': 'superscript',
        'auto_id_prefix': 'id-',
        'initial_header_level': 3,
        'doctitle_xform': False,
    }

    parts = publish_parts(source=text,
                          writer_name='html5_polyglot',
                          settings_overrides=settings_overrides)
    return parts['fragment']