Port Docs-Viewer to slatehtml as the docs-viewer package.

Replace the classic DOM shell with slate widgets, markdown→slate rendering, and a CI index build that uses build-docs.cjs.
This commit is contained in:
2026-08-02 20:48:31 +10:00
parent 407ee6c0d3
commit 10e9f7ac2f
36 changed files with 3789 additions and 5474 deletions

24
demo/main.js Normal file
View File

@@ -0,0 +1,24 @@
import "slatehtml";
import "slatehtml-ui/icon";
import "slatehtml-ui/side-bar";
import "slatehtml-ui/progress";
import "slatehtml-ui/alert";
import "slatehtml-ui/divider";
import "slatehtml-ui/bottom-nav";
import "slatehtml-ui/bottom-nav-item";
import "slatehtml-ui/collapse";
import { configure } from "slatehtml-ui/configure";
import { fontAwesomeSvg } from "slatehtml-ui/icons/fontawesome";
import { mountDocs } from "../src/index.js";
import "../src/prose.css";
import "./site.css";
configure({
icons: fontAwesomeSvg,
iconSize: "15",
});
await mountDocs("slate-docs-viewer", { indexUrl: "./index.json" });
document.documentElement.setAttribute("data-ready", "");

26
demo/site.css Normal file
View File

@@ -0,0 +1,26 @@
/* Match live Docs-Viewer tokens (lit.ruv.wtf/docs). */
:root {
--bg: #1a1a1a;
--ink: #e0e0e0;
--muted: #a0a0a0;
--panel: #252526;
--line: #404040;
--accent: #2196f3;
--docs-accent: #2196f3;
--docs-panel: #252526;
--docs-line: #404040;
--docs-muted: #a0a0a0;
--slate-font: system-ui, -apple-system, "Segoe UI", Roboto, Ubuntu, Cantarell, "Noto Sans",
sans-serif;
--slate-font-mono: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
color-scheme: dark;
}
body {
margin: 0;
min-height: 100%;
background: var(--bg);
color: var(--ink);
font-family: var(--slate-font);
}