From 7aa23af86c0fbd0edc48fad0c7e9e8d0022a1ea6 Mon Sep 17 00:00:00 2001 From: Alexander_Kabui Date: Thu, 12 Sep 2024 21:48:11 +0300 Subject: Fetch markdown for rendering form gn-docs. --- gn2/wqflask/api/markdown.py | 8 ++++++++ 1 file changed, 8 insertions(+) (limited to 'gn2') 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 """ -- cgit v1.2.3