summaryrefslogtreecommitdiffstats
path: root/scripts/utils/reST.py
blob: d99758cc4158d37430e8e27c8bdc488669a69455 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
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']