Browse Source

template works now, app_hostname still hardcoded

technodisobedience
mb 12 months ago
parent
commit
f7076c8f88
  1. 5
      octomode.py

5
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

Loading…
Cancel
Save