diff --git a/app.py b/app.py index 4fe9860..96010d1 100644 --- a/app.py +++ b/app.py @@ -225,7 +225,7 @@ def library(project_id: Optional[int] = None): items = "".join( [ f"
#{d['id']} [{d['kind']}] {d['title']}
{d['project']} · {d['created_at']}
" - f"Ansehen | Download .md
" + f"Ansehen | Download .md" for d in docs ] ) @@ -260,13 +260,13 @@ def view_document(doc_id: int): body = f"""

Dokument #{d['id']} – {d['title']}

Projekt: {d['project']} · Typ: {d['kind']} · {d['created_at']}

-

Download .md

+

Download .md

{(d['content_md'] or '').replace('<','<')}
""" return layout("Dokument", body) -@app.get("/document/{doc_id}.md", response_class=PlainTextResponse) +@app.get("/document/{doc_id}/download.md", response_class=PlainTextResponse) def download_md(doc_id: int): with db() as c: d = c.execute("SELECT title,content_md FROM documents WHERE id=?", (doc_id,)).fetchone()