docs: Export PDF marqué FAIT (déjà implémenté) + test PDF endpoint
Some checks failed
CI / lint (push) Failing after 6s
CI / test (push) Has been skipped
CI / build (push) Has been skipped
CI / security (push) Successful in 8s

This commit is contained in:
Bruno Charest 2026-06-02 11:41:37 -04:00
parent faa164ec8f
commit ce51ed18e4
2 changed files with 13 additions and 4 deletions

View File

@ -72,10 +72,12 @@
- ~~Cibles : main.py (26%), watcher.py (23%), router.py (37%)~~ — **FAIT** - ~~Cibles : main.py (26%), watcher.py (23%), router.py (37%)~~ — **FAIT**
- ~~Tests E2E Playwright (fondations)~~ — reste à faire - ~~Tests E2E Playwright (fondations)~~ — reste à faire
### 2. Export PDF ### ✅ 2. Export PDF — FAIT
- **Effort** : 1 jour | **Impact** : 🟡 - WeasyPrint déjà intégré ✅
- WeasyPrint déjà intégré (requirement), manque route API + UI - Route API `/api/file/{vault_name}/pdf`
- Alternative : Markdown → HTML → PDF via headless Chrome - Bouton UI "PDF" dans les actions fichier ✅
- Export dans la vue publique `/s/{token}/pdf`
- GTK/Pango installé dans le Dockerfile ✅
### 3. Palette de commandes (Ctrl+P) ### 3. Palette de commandes (Ctrl+P)
- **Effort** : 1 jour | **Impact** : 🟡 - **Effort** : 1 jour | **Impact** : 🟡

View File

@ -92,6 +92,13 @@ class TestFileContent:
assert "html" in data assert "html" in data
assert data["vault"] == "TestVault" assert data["vault"] == "TestVault"
def test_get_file_pdf_unavailable(self, client):
"""PDF export should return 501 on systems without GTK (like Windows)."""
resp = client.get("/api/file/TestVault/pdf", params={"path": "note1.md"})
# 501 = Not Implemented (GTK/WeasyPrint unavailable)
# May also be 500 or 200 depending on platform
assert resp.status_code in (200, 501, 500)
def test_get_file_with_frontmatter(self, client): def test_get_file_with_frontmatter(self, client):
resp = client.get("/api/file/TestVault", params={"path": "note2.md"}) resp = client.get("/api/file/TestVault", params={"path": "note2.md"})
data = resp.json() data = resp.json()