def preload_docs(endpoint): """ Utility to load an RST file and turn it into fancy HTML. """ here = os.path.dirname(os.path.abspath(__file__)) fname = os.path.join(here, "..", "doc", endpoint + ".rst") with codecs.open(fname, "r", "utf-8") as stream: rst = stream.read() rst = modify_rst(rst) api_docs = docutils.examples.html_body(rst) api_docs = modify_html(api_docs) api_docs = markupsafe.Markup(api_docs) return api_docs
def preload_docs(endpoint): ''' Utility to load an RST file and turn it into fancy HTML. ''' here = os.path.dirname(os.path.abspath(__file__)) fname = os.path.join(here, '..', 'doc', endpoint + '.rst') with codecs.open(fname, 'r', 'utf-8') as f: rst = f.read() rst = modify_rst(rst) api_docs = docutils.examples.html_body(rst) api_docs = modify_html(api_docs) api_docs = markupsafe.Markup(api_docs) return api_docs