Decisions: integration and delivery¶
The design decisions behind CSS delivery, assets, components, icons, dependencies, the shipped packs and the documentation toolchain.
ADR-8 — CSS delivered inline per page by default, or linked by the site¶
Context. Without a plugin, the Markdown layer is the only place to deliver CSS.
Decision. A postprocessor adds the CSS the page needs; a CLI command serves sites that prefer a linked file.
Consequences. CSS is repeated across pages in inline mode — acceptable for documentation sites;
css: none exists for the rest.
Constrains. R-MDX-004, R-CLI-005
| Statement | |
|---|---|
| D1 | By default (css: inline) the extension prepends one <style> per page holding the CSS of the packs that page used. |
| D2 | With css: none the site links a stylesheet generated by mockitdown css itself. |
| O1 | rejected: copy CSS files into the site (the prototype plugin's approach) — needs a plugin (ADR-3). |
| O2 | rejected: inline styles per element — huge output and no pack CSS cascade. |
| O3 | rejected: inline the full CSS of every pack on every page — loads packs a page does not use. |
| C1 | Zero configuration for most sites; pages with mockups are self-contained. |
| C2 | Sites with many mockup pages can opt into one cacheable stylesheet. |
ADR-9 — Local images are embedded as data URIs at build time¶
Context. SRC-2: "embed links need to be supported."
Decision. Embed at build time, with containment and a size cap.
Consequences. No asset pipeline; the security boundary is the search roots.
Constrains. R-ASSET-001, R-ASSET-002, R-ASSET-003
| Statement | |
|---|---|
| D1 | Local image references are searched in the block's directory (when known) and the configured asset directories, must resolve inside a search root, and are embedded as data: URIs; files over a size cap are linked instead. |
| D2 | Remote http(s) and data:image references pass through; every other scheme is refused. |
| O1 | rejected: rewrite relative URLs to the page — the fence does not know the page URL (ADR-3), and fragments would break when reused. |
| O2 | rejected: copy images into the site — needs a plugin and an output-path convention. |
| O3 | rejected: allow any file path — a build could embed secrets from the repository. |
| C1 | Figures are self-contained and work at any URL and offline. |
| C2 | Large images inflate pages; the cap (2 MB by default) bounds that. |
ADR-10 — Custom components are structs, imported from files by path¶
Context. SRC-2: "a site can define custom reusable controls within a doc site; import statements at the start of the fenced code block can indicate where to retrieve the custom components from."
Decision. Swift's own component mechanism, plus a quoted-path import.
Consequences. Components are evaluated per use (no compilation step); a deep or recursive component is cut off by the nesting limit.
Constrains. R-IMP-001, R-IMP-002, R-IMP-003, R-IMP-004, R-EVAL-005
| Statement | |
|---|---|
| D1 | Custom components are struct declarations, inline or in .mockitdown files loaded with import "path". |
| D2 | Paths resolve against the importing file's directory, then import_paths; .mockitdown may be omitted; cycles are ignored; later definitions replace earlier ones and block-local ones replace imported ones. |
| O1 | rejected: the prototype's component Name(p: Type) { … Slot("x") } — a bespoke form; SwiftUI structs express the same with @ViewBuilder properties. |
| O2 | rejected: register components in the site configuration — moves component code out of the documentation and away from the pages using it. |
| O3 | rejected: import by module name (import Components) — collides with pack selection by module (R-PACK-005). |
| C1 | The same struct code works in a block, in a library and in real SwiftUI. |
| C2 | Libraries written with core elements render in every pack. |
ADR-11 — An original icon set with framework name aliases¶
Context. Every framework has an icon set, mostly not redistributable or too large to inline.
Decision. Draw a compact set and map names.
Consequences. The alias table grows with use; packs can remap names through their icons key.
Constrains. R-ASSET-005
| Statement | |
|---|---|
| D1 | mockitdown ships its own set of original 24px line glyphs and aliases SF Symbols, Material Symbols, Fluent UI System Icons and SAP icon names onto them. |
| O1 | rejected: bundle SF Symbols — its licence forbids redistribution and use outside Apple platforms. |
| O2 | rejected: bundle Material Symbols, Fluent icons and the SAP icon font — several megabytes of fonts or SVG, network or packaging cost, and per-pack icon pipelines. |
| O3 | rejected: load icon fonts from a CDN — violates ADR-5. |
| C1 | Any of the four naming schemes works in any pack. |
| C2 | Icons approximate the framework's glyphs; unknown names show a placeholder and a warning. |
ADR-12 — Zero runtime dependencies in the core; Python 3.11 or later¶
Context. Every dependency is a long-term liability (project policy); documentation toolchains already bring Python-Markdown and pymdown-extensions.
Decision. Standard library only in the core.
Consequences. Slightly more code to own; nothing to audit or pin beyond the extra.
Constrains. R-API-004
| Statement | |
|---|---|
| D1 | The core (language, evaluation, packs, rendering, stylesheets, assets, icons, CLI) uses only the Python standard library. |
| D2 | Markdown and pymdown-extensions are the optional markdown extra, needed only for the site integration. |
| D3 | The minimum Python version is 3.11. |
| O1 | rejected: a parser generator (Lark, ANTLR) — a dependency for a grammar small enough to hand-write, and worse error messages. |
| O2 | rejected: a templating engine (Jinja) for markup — role markup is short and escaping is simpler to audit in code. |
| O3 | rejected: Python 3.14 minimum (the prototype's) — Zensical and common CI images support 3.11, and nothing in the core needs newer. |
| C1 | Installing mockitdown adds nothing to an environment except, for sites, the two Markdown packages it already uses. |
| C2 | The parser, CSS minifier and MIME detection are maintained in the project. |
ADR-13 — The shipped packs¶
Context. SRC-2 requires SwiftUI, Fluent on Windows, Angular, React (with current Material UI) and SAPUI5, and asks for proposals of others.
Decision. Bootstrap — still the most deployed CSS component framework — and shadcn/ui — the fastest-growing React component style — are added. Ant Design (dominant in enterprise React), Tailwind Catalyst, IBM Carbon and GitHub Primer followed in 0.4.
Consequences. Eight packs to maintain under one contract; framework major versions are
recorded in each pack.json (version).
Constrains. R-PACK-008
| Statement | |
|---|---|
| D1 | mockitdown ships base (wireframe), swiftui, fluent (WinUI 3 / Fluent 2), mui (Material UI v9), angular-material, sapui5 (Fiori Horizon), bootstrap (5.3) and shadcn (shadcn/ui). |
| D2 | Ant Design, Tailwind Catalyst, IBM Carbon and GitHub Primer followed in 0.4 (R-PACK-008); further candidates are listed on the example site's roadmap page. |
| O1 | rejected: Fluent UI React (web) instead of WinUI 3 — SRC-2 asks for "Windows with Fluent design language"; a web Fluent pack can extend fluent later. |
| O2 | rejected: Material 3 (Material Web / Compose) as the Material pack — SRC-2 names Material UI; MUI is the React implementation most teams use. |
| O3 | rejected: Chakra UI, Vuetify, Tailwind UI as the extra web packs — lower usage than Bootstrap, or (Tailwind) not a component library; shadcn/ui covers the Tailwind-based style. |
| C1 | The packs cover Apple platforms, Windows, React, Angular, SAP and the two most common other web styles. |
| C2 | Each pack has a page on the example site (F-14). |
ADR-14 — Documentation sites build with Zensical¶
Context. SRC-2: "We are switching from MkDocs to Zensical for the docs." Zensical (0.1.3,
November 2026) is the Material for MkDocs team's successor; it reads mkdocs.yml.
Decision. Build every site of the project with Zensical.
Consequences. Some MkDocs conveniences are missing (Mermaid injection, plugins); they are replaced by site assets or by design (ADR-3).
Constrains. R-MDX-001
| Statement | |
|---|---|
| D1 | The project's documentation site (this site, the docs branch) and the example site build with Zensical, with theme.variant: classic. |
| D2 | Mermaid diagrams are rendered by a small loader script, because Zensical does not inject Mermaid. |
| O1 | rejected: stay on MkDocs 1.x with Material — MkDocs is in low maintenance and SRC-2 directs the switch. |
| O2 | rejected: Zensical's default modern variant — drops the Material header colouring this site relies on. |
| C1 | mockitdown must work without MkDocs plugins (ADR-3). |
| C2 | The sites keep mkdocs.yml (Zensical reads it) and a requirements.txt naming Zensical. |
| C3 | Zensical is pre-1.0; the build is re-verified when it is upgraded. |
ADR-16 — Retro and easter-egg packs are original homages¶
Context. SRC-5 asks for retro packs and sci-fi easter eggs.
Decision. Homage, not reproduction.
Consequences. Approximate fonts; invented content.
Constrains. R-PACK-008, R-PACK-010
| Statement | |
|---|---|
| D1 | Retro packs (Macintosh System 1–6, Lisa, Mac OS 9, Apple IIgs GS/OS, Xerox Star, Windows 2.x, Windows 3.1.1, Windows XP, Windows Vista, Solaris CDE) imitate the look of historical systems with system fonts and CSS only, invented application content and neutral glyphs in place of trademarked logos. |
| D2 | Science-fiction packs (lcars, phosphor, hologram) are hidden easter eggs and original homages to screen-design genres: no franchise names, logos, ship or character names or copied screens. |
| O1 | rejected: bundling period fonts or bitmaps — licensing and offline-build constraints (ADR-5). |
| C1 | Fidelity is limited by the fonts installed on the reader's machine. |
ADR-17 — One repository for both variants, with shared assets¶
Two variants rendering the same packs must not drift apart; keeping the assets once and copying them at build time makes drift a test failure rather than a merge problem (SRC-8).
Constrains. R-REPO-001, R-REPO-002, R-REPO-003
| Statement | |
|---|---|
| D1 | The Python and TypeScript variants live in one repository, in python/ and typescript/, with the assets both publish in shared/. |
| D2 | shared/ is the only place a pack definition, pack stylesheet, page stylesheet, icon glyph, modifier vocabulary, reference sample, design pattern or conformance case is written; each variant's build copies what it publishes. |
| D3 | The Python package keeps its name, version line, public API and command line; only its location in the repository changes. |
| O1 | rejected: two repositories with a shared Git submodule or a published asset package — two release lines and a third artefact for one set of files. |
| O2 | rejected: symbolic links from the Python package into shared/ — they break on Windows checkouts and in sdists. |
| C1 | A pack change is one commit that both test suites verify. |
| C2 | Release workflows, Pages workflows and documentation paths move with the code. |
ADR-18 — The web variant is a TypeScript port held to the Python output¶
A port duplicates logic, so a shared corpus of mockups and expected HTML decides what "the same" means and catches any difference automatically.
Constrains. R-WEB-001, R-REPO-004
| Statement | |
|---|---|
| D1 | The web variant re-implements the lexer, parser, evaluator, renderer, style builder and chart renderer in TypeScript, module for module after the Python core. |
| D2 | The Python variant is the reference: for every case of the conformance corpus the TypeScript renderer MUST produce the HTML the Python renderer produces. |
| D3 | The TypeScript core runs in browsers and in Node without DOM access, producing an HTML string; only the custom elements touch the DOM. |
| O1 | rejected: running the Python library in the browser (Pyodide/WebAssembly) — a multi-megabyte runtime for a component meant to be light. |
| O2 | rejected: a rendering server — the web variant has no backend (SRC-8). |
| C1 | Every change to rendering in one variant is made in both, in the same issue, with a conformance case. |
ADR-19 — The mockup element carries its code in a script child¶
Chosen by the developer (SRC-8#clar-script). A script element with an unknown type is never executed and its text is delivered verbatim.
Constrains. R-WEB-002
| Statement | |
|---|---|
| D1 | A mockitdown-mockup element takes its code from a <script type="text/mockitdown"> child, whose text the HTML parser leaves untouched; the first such child counts and other children are ignored (R-WEB-002.C2). |
| O1 | rejected: a CDATA child (the request's first form) — in an HTML document the parser turns <![CDATA[ into a bogus comment that ends at the first > and parses the rest as markup, corrupting code that contains >, <Name or &…;. |
| O2 | rejected: plain text content — the author would have to escape < and &. |
| C1 | The only sequence the code cannot contain is </script; the element documents this. |
ADR-20 — Web development dependencies: typescript and Playwright only¶
Chosen by the developer (SRC-8#clar-deps), following the rule that third-party dependencies are avoided unless building the feature would be prohibitively expensive. Playwright: licence Apache-2.0, maintained by Microsoft with monthly releases, development only.
Constrains. R-WEB-001, R-WEB-003, R-WEB-005
| Statement | |
|---|---|
| D1 | The TypeScript project's only development dependencies are typescript (compiler) and @playwright/test (browser tests); it has no runtime dependencies. |
| D2 | Unit tests use node:test; the development server uses node:http and node:fs. |
| O1 | rejected: Express or another web server package — a static file server is a few dozen lines on node:http (SRC-8). |
| O2 | rejected: a bundler (esbuild, Vite, Rollup) — tsc emits ES modules browsers load directly. |
| O3 | rejected: a hand-written Chrome DevTools-protocol driver — code to maintain where Playwright is stable (Apache-2.0, Microsoft). |
| C1 | npm install fetches two packages and their own dependencies; npx playwright install chromium fetches the test browser. |
Revision history¶
| Version | Date | Change |
|---|---|---|
| 0.6.7 | 2026-11-25 | reviewed against R-WEB-002@0.6.6 7: D1 reads the first script child and ignores other children, as R-WEB-002.C2 was built |
| 0.6.0 | 2026-11-25 | New ADR-18: The web variant is a TypeScript port held to the Python output; New ADR-20: Web development dependencies: typescript and Playwright only; New ADR-17: One repository for both variants, with shared assets |
| 0.4.0 | 2026-11-24 | Ant Design, Tailwind Catalyst, Carbon and Primer shipped in 0.4; no longer proposed next |
| 0.3.0 | 2026-11-24 | New ADR-16: Retro and easter-egg packs are original homages |
| 0.2.0 | 2026-11-24 | Page created |
| 0.6.0 | 2026-11-25 | New ADR-18: The web variant is a TypeScript port held to the Python output; New ADR-20: Web development dependencies: typescript and Playwright only; New ADR-17: One repository for both variants, with shared assets |
| 0.4.0 | 2026-11-24 | Ant Design, Tailwind Catalyst, Carbon and Primer shipped in 0.4; no longer proposed next |
| 0.3.0 | 2026-11-24 | New ADR-16: Retro and easter-egg packs are original homages |
| 0.2.0 | 2026-11-24 | Page created |