From 60042d877e578e8f19e4df6bf2ea5701faa977e3 Mon Sep 17 00:00:00 2001 From: iris Date: Fri, 5 Jun 2026 19:29:07 +0200 Subject: [PATCH] docs(options): emit markdown only, render HTML in website Per #1407 review: the options reference should be markdown here; the HTML + CSS belongs in the website repo where the theme lives and the stylesheet can be shared with /docs. - nix/docs/default.nix: drop the cmark-gfm HTML rendering, the 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); -}