diff options
author | Alexander_Kabui | 2024-09-12 21:48:11 +0300 |
---|---|---|
committer | Alexander_Kabui | 2024-09-12 21:48:11 +0300 |
commit | 7aa23af86c0fbd0edc48fad0c7e9e8d0022a1ea6 (patch) | |
tree | eead66f63fdf04fb000eef8f1e5eeb27789cdf9c /gn2 | |
parent | 28b113fc942904ea7c125dfef94e9c3dee24973d (diff) | |
download | genenetwork2-7aa23af86c0fbd0edc48fad0c7e9e8d0022a1ea6.tar.gz |
Fetch markdown for rendering form gn-docs.
Diffstat (limited to 'gn2')
-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 """ |