Expand description
Multi-format export backends (E012 US2 — Phase 7).
Public types: export::ExportFormat, export::write_export. Each
individual backend is gated behind its output-<format> leaf:
HTML5 (output-html), mIRC ^C codes (output-irc), SVG 1.1
(output-svg). The ANSI sub-formats reuse ColorDepth from
color_depth for SGR emission.
Multi-format export backends (E012 US2 — FR-005, Phase 7).
§Backends
Each backend is gated behind a distinct output-<format> Cargo leaf
per ADR-0006:
| Format | Leaf | Module |
|---|---|---|
| HTML5 | output-html | [html] |
mIRC ^C | output-irc | [irc] |
| SVG 1.1 | output-svg | [svg] |
| ANSI 16 | (always) | (renders via crate::color_depth) |
| ANSI 256 | color-256 | (renders via crate::color_depth) |
| ANSI 24bit | color-truecolor | (renders via crate::color_depth) |
§Dispatch
[write_export] receives a crate::filter::RenderGrid and an
[ExportFormat] and dispatches to the appropriate backend, returning
a Vec<u8> with the encoded bytes. When the requested format’s leaf
is disabled at compile time, FigletError::UnsupportedExportFormat
is returned with the full list of available formats so the CLI can
produce a useful diagnostic per FR-016.
§Security
- HTML/SVG: 4-char escape applied to every text-content and double-
quoted-attribute byte per AD-004 + HINT-004 — see [
html] module docs for the exact set + reasoning. - IRC: ASCII C0/C1 non-printable bytes stripped per FR-015; UTF-8
continuation bytes preserved per spec Edge Cases — see [
irc] module docs. - SVG: NO
<script>,<foreignObject>,xlink:href,<image href=...>,<use xlink:href=...>emission. Inlinestyle="..."IS emitted but contains only typed numeric#RRGGBBvalues — no user bytes ever flow into astylevalue per spec Edge Cases.
Modules§
- html
output-html - HTML5 export backend (E012 US2 — FR-005, FR-014, AD-004, HINT-004).
- irc
output-irc - mIRC
^Ccolor-code export backend (E012 US2 — FR-006, FR-015, FR-027). - svg
output-svg - SVG 1.1 export backend (E012 US2 — FR-007, FR-027).
Enums§
- Export
Format - Supported export formats (E012 US2 — FR-005).
Functions§
- write_
export - Dispatch a
RenderGridto the requestedExportFormatbackend.