Plugin fallbacks in HTML, PDF, and office exports #79

Closed
opened 2026-07-04 14:52:42 +02:00 by fable-5 · 1 comment
Collaborator

Context

Exports must degrade plugin content gracefully (manifest fallback, ADR 0008).

Scope

Extend the export renderers (#56 HTML, #67 PDF, #65 docx/odt): plugin_block nodes render the stored SVG/image fallback where present, else the manifest text fallback, else a neutral '[plugin content]' marker; section styles inline as basic CSS in HTML/PDF and map to plain quoted blocks in docx/odt; resolve the TODO from #67.

Acceptance criteria

  • fixture page with mermaid + toc block exports to PDF with diagram image and text marker respectively
  • docx export contains the fallback text, no broken artifacts
  • pages with plugins from since-uninstalled plugins still export (manifest snapshot used)

Technical notes

  • ADR 0008/0009.

Dependencies

Depends on #67, #76, #78.

Size: ~1 day


Conventions: English code/comments, clear human-readable code, no hard-coded UI strings (ADR 0012, add de and en), permission checks only via the shared guard (docs/architecture/permissions.md). Read the referenced ADRs before starting.

## Context Exports must degrade plugin content gracefully (manifest `fallback`, ADR 0008). ## Scope Extend the export renderers (#56 HTML, #67 PDF, #65 docx/odt): `plugin_block` nodes render the stored SVG/image fallback where present, else the manifest text fallback, else a neutral '[plugin content]' marker; `section` styles inline as basic CSS in HTML/PDF and map to plain quoted blocks in docx/odt; resolve the TODO from #67. ## Acceptance criteria - [ ] fixture page with mermaid + toc block exports to PDF with diagram image and text marker respectively - [ ] docx export contains the fallback text, no broken artifacts - [ ] pages with plugins from since-uninstalled plugins still export (manifest snapshot used) ## Technical notes - ADR 0008/0009. ## Dependencies Depends on #67, #76, #78. **Size**: ~1 day --- *Conventions: English code/comments, clear human-readable code, no hard-coded UI strings (ADR 0012, add `de` **and** `en`), permission checks only via the shared guard (docs/architecture/permissions.md). Read the referenced ADRs before starting.*
fable-5 added this to the M7 — Plugins milestone 2026-07-04 14:52:42 +02:00
fable-5 added the
backend
plugins
labels 2026-07-04 14:52:42 +02:00
Author
Collaborator

Umgesetzt in 9e8ebfe (CI grün) — damit ist M7 komplett (#70–#79).

Akzeptanzkriterien (DB-Tests in export.service.db.test.ts + shared export-fallbacks.test.ts):

  • Seite mit Mermaid- und toc-Block exportiert als PDF: Diagramm via gespeichertem SVG-Snapshot (DOMPurify-sanitisiert — hostile <script> im Snapshot wird nachweislich entfernt), toc via Manifest-Text-Fallback
  • docx enthält den Fallback-Text und keine Artefakte (keine dorfteich-plugin-Fences, keine :::-Reste; Sections werden Zitatblöcke — AST-Transform, Verschachtelung überlebt)
  • Seiten mit Blöcken deinstallierter Plugins exportieren weiter (Manifest-Tombstone; Bild-Fallbacks degradieren nach Uninstall zu Text)

Bonus: Die öffentliche Leseansicht (#56) bekommt dieselben Fallbacks plus das aktive Section-CSS des Teichs inline — öffentliche Seiten zeigen gestylte Sections und statische Plugin-Inhalte ganz ohne Plugin-Runtime. Das #67-TODO in pdf-html.ts ist aufgelöst.

Umgesetzt in `9e8ebfe` (CI grün) — **damit ist M7 komplett (#70–#79)**. **Akzeptanzkriterien (DB-Tests in `export.service.db.test.ts` + shared `export-fallbacks.test.ts`):** - [x] Seite mit Mermaid- und toc-Block exportiert als PDF: Diagramm via gespeichertem SVG-Snapshot (DOMPurify-sanitisiert — hostile `<script>` im Snapshot wird nachweislich entfernt), toc via Manifest-Text-Fallback - [x] docx enthält den Fallback-Text und keine Artefakte (keine `dorfteich-plugin`-Fences, keine `:::`-Reste; Sections werden Zitatblöcke — AST-Transform, Verschachtelung überlebt) - [x] Seiten mit Blöcken deinstallierter Plugins exportieren weiter (Manifest-Tombstone; Bild-Fallbacks degradieren nach Uninstall zu Text) **Bonus:** Die öffentliche Leseansicht (#56) bekommt dieselben Fallbacks plus das aktive Section-CSS des Teichs inline — öffentliche Seiten zeigen gestylte Sections und statische Plugin-Inhalte ganz ohne Plugin-Runtime. Das #67-TODO in `pdf-html.ts` ist aufgelöst.
Sign in to join this conversation.
No Milestone
No project
No Assignees
1 Participants
Notifications
Due Date
The due date is invalid or out of range. Please use the format 'yyyy-mm-dd'.

No due date set.

Dependencies

No dependencies set.

Reference: stwaidele/dorfteich#79
No description provided.