def rest2html(s): """Converts a restructuredText document into HTML Note that the returned object is a bytes so need to be decoded with decode()""" return core.publish_string( s, writer = html_fragment_writer )