mirror of
https://github.com/litruv/Docs-Viewer.git
synced 2026-09-10 10:09:46 +10:00
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:
24
demo/main.js
Normal file
24
demo/main.js
Normal 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
26
demo/site.css
Normal 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);
|
||||
}
|
||||
Reference in New Issue
Block a user