diff options
Diffstat (limited to 'gn2/wqflask/api')
-rw-r--r-- | gn2/wqflask/api/markdown.py | 8 |
1 files changed, 8 insertions, 0 deletions
diff --git a/gn2/wqflask/api/markdown.py b/gn2/wqflask/api/markdown.py index aa7dd3c4..0c8ba8f2 100644 --- a/gn2/wqflask/api/markdown.py +++ b/gn2/wqflask/api/markdown.py @@ -29,6 +29,14 @@ xapian_syntax_blueprint = Blueprint("xapian_syntax_blueprint", __name__) blogs_blueprint = Blueprint("blogs_blueprint", __name__) +def render_markdown_from_editor(file_path): + results = requests.get("http://localhost:8091/edit?file_path={file_path}") + results.raise_for_status() + text = results.json()["content"] + return markdown.markdown(text, + extensions=['tables']) + + def render_markdown(file_name, is_remote_file=True): """Try to fetch the file name from Github and if that fails, try to look for it inside the file system """ |