Skip to main content

Module wisp

Module wisp 

Source
Expand description

WISP → PDF export.

Renders an organisation’s Written Information Security Program — the markdown policy set under security/ — into a single branded PDF with a cover page, table of contents, page numbers, and a provenance stamp.

Design and decisions live in docs/wisp-pdf-export.md. The short version:

  • The default renderer is Typst (pure Rust, compiled into the binary), so a plain cargo install produces a working renderer with no external toolchain. WeasyPrint / Chromium are opt-in HTML backends (not yet wired).
  • The branding partials are required, operator-owned files (Typst templates by default), scaffolded by init and checked by export.
  • Provenance reuses the same primitives as the evidence chain: the WISP repo’s git_head commit and a SHA-256 over the assembled markdown.

This module owns the format-neutral pipeline: source resolution → markdown assembly → doc::WispDoc → Typst emission. The final Typst→PDF compile (the typst crate) is wired separately; see render.

Re-exports§

pub use doc::WispDoc;
pub use scaffold::init;
pub use source::export;

Modules§

doc
The backend-neutral assembled document.
markdown
Markdown → Typst conversion, driven by pulldown-cmark.
render
Render backends. The default Typst backend compiles in-binary; the Weasyprint/Chromium HTML backends are opt-in and not wired yet (see docs/wisp-pdf-export.md §8).
scaffold
wisp init — scaffold the generic, operator-owned partials.
source
WISP source resolution, assembly, provenance, and the export entry point.
template
The bundled generic partials, plus locating/validating an operator’s template directory.
typst_emit
Compose the top-level Typst document (main.typ) from a WispDoc and the operator’s partials.

Structs§

ExportOptions
Inputs to export. None fields fall back to _config.yaml’s wisp: block and then to built-in defaults.
ExportReport
Outcome of export.
InitOptions
Inputs to init. dir is the template directory to scaffold into.
InitReport
Outcome of init.

Enums§

Format
Partial flavour. Determined by the chosen renderer: the in-binary Typst backend uses .typ partials; the opt-in HTML backends use HTML + CSS.
Renderer
Rendering backend. Only Typst is implemented today; the others are reserved for the opt-in HTML backends documented in the spec (§8).
Status
Document status, surfaced on the cover/footer and as a watermark.