From f7076c8f882116a97c984d83cb60e2ff7353a321 Mon Sep 17 00:00:00 2001 From: mb Date: Thu, 30 Nov 2023 10:17:29 +0100 Subject: [PATCH] template works now, app_hostname still hardcoded --- octomode.py | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/octomode.py b/octomode.py index 4801d96..2817081 100755 --- a/octomode.py +++ b/octomode.py @@ -83,8 +83,12 @@ def md_to_html(md_pad_content, name): app_root = get_app_root() template_url = f"{ app_hostname }{ app_root }/{ name }/template.html" md_url = f"{ app_hostname }{ app_root }/{ name }/pad.md" + print(template_url) + print(md_url) result = subprocess.run(["pandoc", "--from", "markdown", "--to", "html", "--template", f"{ template_url }", md_url], capture_output=True, text=True) html = result.stdout + print(result.stderr) + print(html) # Convert Markdown to HTML, using the default pandoc template # ---------------------------------------------------------------------------------- @@ -127,6 +131,7 @@ def get_app_hostname(): # app_url = urlparse(request.base_url).netloc # app_hostname = app_protocol + app_url + # app_hostname = "http://localhost:5555" # hardcoded for now app_hostname = "https://circulations.constantvzw.org" # hardcoded for now return app_hostname