from docutils.core import publish_parts
import jinja2

def rst_filter(s):
    return jinja2.Markup(publish_parts(source=s, writer_name='html')['body'])
environment.filters['rst'] = rst_filter
jinja2 + реструктурированная разметка