[VS-NfD] Give pandoc a reference document with classification header and footer #209

Closed
opened 2026-07-30 01:43:42 +02:00 by fable-5 · 2 comments
Collaborator

Plan reference: 20-massnahmenplan.md -> P1-2 (output channels)
ADR: ADR 0022
Effort: M (2–3 AT)
Depends on: #204

Context

DOCX and ODT are editable formats an authority will circulate; the marking
has to be part of the document's own header/footer definition, not text in
the body that a user can delete without noticing.

Current state

  • apps/api/src/import-export/pandoc.converter.ts drives pandoc; there is
    no --reference-doc / referenceDoc usage — verified by search, so
    the output uses pandoc's defaults with no header or footer.
  • The container is pinned to pandoc/core:3.6
    (deploy/compose/docker-compose.yml:206), which is also the version the
    fidelity snapshots are generated with.

Acceptance criteria

  • A reference DOCX and a reference ODT ship in the repository with
    header/footer fields carrying the classification; the converter
    passes them for the respective target format.
  • The marking is placed in the document's header/footer definition so
    it repeats on every page in Word and LibreOffice — verified by
    opening the output in both.
  • Unclassified pages produce output without a marking.
  • Fixture-first fidelity coverage per fixtures/README.md, snapshots
    regenerated only with pandoc/core:3.6.
  • How the reference documents are maintained (they are binary) is
    documented next to them.

Out of scope

Styling the exports beyond what the marking needs, and other formats.

**Plan reference:** `20-massnahmenplan.md` -> P1-2 (output channels) **ADR:** ADR 0022 **Effort:** M (2–3 AT) **Depends on:** #204 ## Context DOCX and ODT are editable formats an authority will circulate; the marking has to be part of the document's own header/footer definition, not text in the body that a user can delete without noticing. ## Current state - `apps/api/src/import-export/pandoc.converter.ts` drives pandoc; there is **no** `--reference-doc` / `referenceDoc` usage — verified by search, so the output uses pandoc's defaults with no header or footer. - The container is pinned to `pandoc/core:3.6` (`deploy/compose/docker-compose.yml:206`), which is also the version the fidelity snapshots are generated with. ## Acceptance criteria - [ ] A reference DOCX and a reference ODT ship in the repository with header/footer fields carrying the classification; the converter passes them for the respective target format. - [ ] The marking is placed in the document's header/footer definition so it repeats on every page in Word and LibreOffice — verified by opening the output in both. - [ ] Unclassified pages produce output without a marking. - [ ] Fixture-first fidelity coverage per `fixtures/README.md`, snapshots regenerated only with `pandoc/core:3.6`. - [ ] How the reference documents are maintained (they are binary) is documented next to them. ## Out of scope Styling the exports beyond what the marking needs, and other formats.
fable-5 added this to the M26 — VS-NfD: classification metadata milestone 2026-07-30 01:43:42 +02:00
fable-5 added the
effort:M
area:export
vs-nfd:blocker
vs-nfd
labels 2026-07-30 01:43:42 +02:00
Author
Collaborator

Done in commit 74a9e49 (branch PR #268; landed on main via the green fast-forward chain, CI run 552; #268 closed with pointer).

Evidence:

  • reference-vs-nfd.docx/.odt ship in apps/api/assets/ as DERIVED binaries: base = default reference docs of the pinned pandoc/core:3.6, plus header+footer carrying the marking. Source of truth is scripts/gen-classified-reference-docs.mjs (wording from shared classificationMarking()); maintenance documented in assets/README.md next to the binaries.
  • Converter passes them to pandoc-server via in-request files + reference-doc; the worker attaches them only for marked docx/odt jobs (job option {marking}); unclassified exports pass nothing and are unchanged (pinned by fake-converter test).
  • Marking sits in the document's own header/footer definition (not deletable body text) and repeats per page: LibreOffice 25.8 headless PDF of a 5-page export shows 2 markings on every page for BOTH formats (machine-verified). Word: structural OOXML parts are standard (header1.xml + sectPr references); a quick manual look in Word is still open - sample files staged in the workspace (doku/209-marked-sample.docx/.odt), procedure in assets/README.md. Word automation (AppleScript) hangs on its sandbox dialogs, deliberately not fought.
  • Fidelity: export.fidelity.test.ts asserts against real pinned pandoc that marked outputs carry the header/footer parts with the wording and unmarked outputs do not; the body round-trip snapshots are untouched by the reference doc.
Done in commit 74a9e49 (branch PR #268; landed on main via the green fast-forward chain, CI run 552; #268 closed with pointer). Evidence: - reference-vs-nfd.docx/.odt ship in apps/api/assets/ as DERIVED binaries: base = default reference docs of the pinned pandoc/core:3.6, plus header+footer carrying the marking. Source of truth is scripts/gen-classified-reference-docs.mjs (wording from shared classificationMarking()); maintenance documented in assets/README.md next to the binaries. - Converter passes them to pandoc-server via in-request files + reference-doc; the worker attaches them only for marked docx/odt jobs (job option {marking}); unclassified exports pass nothing and are unchanged (pinned by fake-converter test). - Marking sits in the document's own header/footer definition (not deletable body text) and repeats per page: LibreOffice 25.8 headless PDF of a 5-page export shows 2 markings on every page for BOTH formats (machine-verified). Word: structural OOXML parts are standard (header1.xml + sectPr references); a quick manual look in Word is still open - sample files staged in the workspace (doku/209-marked-sample.docx/.odt), procedure in assets/README.md. Word automation (AppleScript) hangs on its sandbox dialogs, deliberately not fought. - Fidelity: export.fidelity.test.ts asserts against real pinned pandoc that marked outputs carry the header/footer parts with the wording and unmarked outputs do not; the body round-trip snapshots are untouched by the reference doc.
Author
Collaborator

Word check done by Stefan (31.07.2026): opened doku/209-marked-sample.docx in Word - marking present in header AND footer on every page. With the machine-verified LibreOffice check this completes the both-suites verification; acceptance criterion fully met.

Word check done by Stefan (31.07.2026): opened doku/209-marked-sample.docx in Word - marking present in header AND footer on every page. With the machine-verified LibreOffice check this completes the both-suites verification; acceptance criterion fully met.
Sign in to join this conversation.
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#209
No description provided.