diff --git a/CLAUDE.md b/CLAUDE.md index 78622cbe..d1d682d0 100644 --- a/CLAUDE.md +++ b/CLAUDE.md @@ -348,10 +348,10 @@ nix/ — weston + VNC backend systemd unit; writes /etc/hyperhive/gui.json (vnc_port + auth) for the harness WebSocket relay (/screen/ws) - docs/ HTML+MD options reference (host + agent); built - default.nix via `nix build .#docs` → static site - style.css (`index.html`, `host.html`, `agent.html`, - `host.md`, `agent.md`); rendered by cmark-gfm + docs/ markdown options reference (host + agent); + default.nix `nix build .#docs` → `index.md` + `host.md` + + `agent.md` (CommonMark from nixosOptionsDoc). + HTML+CSS rendered downstream by the website repo forge-theme/theme-catppuccin-vibec0re.css Catppuccin Mocha forge theme docs/ diff --git a/docs/gotchas.md b/docs/gotchas.md index bf483e2a..9211dad4 100644 --- a/docs/gotchas.md +++ b/docs/gotchas.md @@ -286,29 +286,24 @@ inputs stay out of the eval) and `agentEval` (reuses the already-evaluated `agent-base` container config so the per-agent options tree is identical to what a real agent container sees). -Three output trees consumed by `flake.nix`: +Three output trees consumed by `flake.nix`, all **markdown**: - `docs-host` — operator-facing host module options (`services.hyperhive.*`) - `docs-agent` — per-agent harness options (`hyperhive.*` declared in `nix/templates/harness-base.nix`) -- `docs` — bundled static site (`index.html` + `host.html` + - `agent.html`, plus `.md` source-of-truth versions of each - options page) +- `docs` — bundle of `index.md` + `host.md` + `agent.md` -Rendering pipeline: +Pipeline: -- CommonMark from `nixosOptionsDoc.optionsCommonMark` — source of - truth, kept as `.md` in the bundle. -- HTML via `pkgs.cmark-gfm` over the CommonMark, wrapped in a - minimal inline-CSS template. `cmark-gfm` (not plain `cmark`) so - any future tables / autolinks Just Work without revisiting. -- Inline `' - echo '' - echo '' - echo '' - echo '
' - echo '

${title}

' - echo '

Auto-generated from the hyperhive flake. Source: nix/docs/default.nix.

' - cmark-gfm ${doc.optionsCommonMark} - echo '
' - echo '' - echo '' - echo '' - } > $out - ''; + Auto-generated from the hyperhive flake. Two reading paths: - # Landing page — same template shape, hand-authored intro + cross-links. - indexHTML = pkgs.runCommand "hyperhive-docs-index.html" { } '' - { - echo '' - echo '' - echo '' - echo '' - echo '' - echo 'hyperhive — nix options reference' - echo '' - echo '' - echo '' - echo '' - echo '
' - echo '

hyperhive — nix options reference

' - echo '

Auto-generated from the hyperhive flake. Two reading paths:

' - echo '

host options

' - echo '

Options exposed by hyperhive.nixosModules.default to operator host configurations: services.hyperhive.{enable,domain,c0re,forge,matrix,gateway}.*.

' - echo '

agent options

' - echo '

Per-agent options declared in nix/templates/harness-base.nix and visible from every agent.nix: hyperhive.model, hyperhive.allowedRecipients, hyperhive.extraMcpServers, hyperhive.frontend.*, hyperhive.forge.*, hyperhive.matrix.*, hyperhive.gui.*.

' - echo '

Regenerate

' - echo '
nix build .#docs          # bundled static site (index + host + agent)'
-      echo 'nix build .#docs-host     # host page only (HTML)'
-      echo 'nix build .#docs-agent    # agent page only (HTML)
' - echo '

The bundle also ships .md versions of each page (host.md, agent.md) — same content, source-of-truth shape — alongside the HTML.

' - echo '
' - echo '' - echo '' - echo '' - } > $out + - [host options](host.md) — options exposed by + `hyperhive.nixosModules.default` to operator host configurations + (`services.hyperhive.{enable,domain,c0re,forge,matrix,gateway}.*`). + - [per-agent options](agent.md) — options declared in + `nix/templates/harness-base.nix`, visible from every `agent.nix` + (`hyperhive.model`, `hyperhive.allowedRecipients`, + `hyperhive.extraMcpServers`, `hyperhive.frontend.*`, + `hyperhive.forge.*`, `hyperhive.matrix.*`, `hyperhive.gui.*`). + + Regenerate with `nix build .#docs` (bundle), `.#docs-host`, or + `.#docs-agent`. ''; - hostHTML = mkHtmlPage "docs-host" "hyperhive — host options" hostDoc; - agentHTML = mkHtmlPage "docs-agent" "hyperhive — per-agent options" agentDoc; hostMD = mkMarkdownPage "docs-host" "hyperhive — host options" hostDoc; agentMD = mkMarkdownPage "docs-agent" "hyperhive — per-agent options" agentDoc; in { - host = hostHTML; - agent = agentHTML; + host = hostMD; + agent = agentMD; - # Bundled static site nginx serves at `/options/`. Asset paths are - # all relative so the prefix can change without rebuild. + # Bundle of the option reference as markdown. The website renders + # these `.md` to themed HTML for `/options/`; standalone consumers + # get the CommonMark source directly. bundle = pkgs.runCommand "hyperhive-options-docs" { } '' mkdir -p $out - cp ${indexHTML} $out/index.html - cp ${hostHTML} $out/host.html - cp ${agentHTML} $out/agent.html + cp ${indexMD} $out/index.md cp ${hostMD} $out/host.md cp ${agentMD} $out/agent.md ''; diff --git a/nix/docs/style.css b/nix/docs/style.css deleted file mode 100644 index 164867fe..00000000 --- a/nix/docs/style.css +++ /dev/null @@ -1,76 +0,0 @@ -:root { - color-scheme: light dark; - --fg: #1a1a1a; - --bg: #fafafa; - --muted: #6b6b6b; - --accent: #5e548e; - --code-bg: rgba(94, 84, 142, 0.08); - --rule: rgba(94, 84, 142, 0.2); -} -@media (prefers-color-scheme: dark) { - :root { - --fg: #e6e6e6; - --bg: #0d0d0d; - --muted: #9b9b9b; - --accent: #c4a7e7; - --code-bg: rgba(196, 167, 231, 0.08); - --rule: rgba(196, 167, 231, 0.2); - } -} -* { box-sizing: border-box; } -body { - font-family: system-ui, -apple-system, "Segoe UI", Roboto, sans-serif; - max-width: 56rem; - margin: 0 auto; - padding: 2rem 1.25rem 4rem; - color: var(--fg); - background: var(--bg); - line-height: 1.55; -} -nav { - margin-bottom: 2rem; - padding-bottom: 1rem; - border-bottom: 1px solid var(--rule); - font-size: 0.9rem; - color: var(--muted); -} -nav a { color: var(--accent); text-decoration: none; } -nav a:hover { text-decoration: underline; } -nav a + a { margin-left: 0.5rem; } -nav a + a::before { content: "· "; color: var(--muted); margin-right: 0.25rem; } -h1, h2, h3 { color: var(--accent); line-height: 1.25; } -h1 { font-size: 1.75rem; margin-top: 0; } -h2 { - font-size: 1.15rem; - margin-top: 2.5rem; - padding-top: 0.5rem; - border-top: 1px solid var(--rule); - font-family: ui-monospace, "SFMono-Regular", Menlo, monospace; -} -h3 { font-size: 1rem; } -p { margin: 0.75rem 0; } -code { - background: var(--code-bg); - padding: 0.1em 0.35em; - border-radius: 0.25em; - font-family: ui-monospace, "SFMono-Regular", Menlo, monospace; - font-size: 0.9em; -} -pre { - background: var(--code-bg); - padding: 0.85rem 1rem; - border-left: 2px solid var(--accent); - border-radius: 0 0.25rem 0.25rem 0; - overflow-x: auto; - line-height: 1.4; -} -pre code { background: transparent; padding: 0; } -a { color: var(--accent); } -em { color: var(--muted); font-style: normal; font-size: 0.9em; } -footer { - margin-top: 4rem; - padding-top: 1rem; - border-top: 1px solid var(--rule); - font-size: 0.85rem; - color: var(--muted); -}