def _respond_with_apidoc_div(self, path): docs_md = open(path, 'r').read() try: parsed = apirenderer.md_to_div(path) self.start_response('200 OK', [('Content-type', "text/html")]) return [parsed] except apirenderer.ParseError, e: self.start_response('500 Parse Error', [('Content-type', "text/plain")]) return [str(e)]
def create_module_page(self, path): path, ext = os.path.splitext(path) md_path = path + '.md' module_content = apirenderer.md_to_div(md_path) return self._create_page(module_content)