#!/usr/bin/env nu # Shared page chrome for projected static doc surfaces (ADRs, catalog, …). # One source of truth for the brand palette, dark/light theme, nav, and the # common structural CSS (.doc-* classes). Consumed by gen-adr-pages.nu and # gen-catalog-pages.nu so both outreach/web (static) and the SSR site share an # identical look and feel. export def esc [s: string] { $s | str replace --all '&' '&' | str replace --all '<' '<' | str replace --all '>' '>' | str replace --all '"' '"' } export def paras [text: string] { $text | split row "\n\n" | where {|b| ($b | str trim | is-not-empty) } | each {|b| $"

(esc ($b | str trim))

" } | str join "\n" } # A single
with an anchor + h2; empty body collapses to nothing. export def sec [anchor: string, title: string, body: string] { if ($body | is-empty) { "" } else { $"

(esc $title)

($body)
" } } # Brand-aligned CSS: ontoref palette tokens, dark default + html.light overrides, # content-graph SVG var bindings, and the .doc-* structural classes. export def page-css [] { r#''# } # Persisted theme toggle, shared across all doc pages. export def theme-js [] { r#''# } # Full HTML document: brand chrome + sibling-surface nav (ADRs · Catalog) + body. export def page-shell [title: string, content: string] { $" (esc $title) · Ontoref (page-css)
($content)
(theme-js) " }