feat(docs): add custom documentation pages with AI beautify
User-created dynamic doc pages live at /docs/custom/:slug, persisted in the new backend. The editor offers "Beautify with AI", which regenerates the page as structured HTML with Mermaid diagrams and replaces the raw markdown source (the beautified version becomes the page's canonical content and survives edits). Adds a DocHtml renderer that lazily renders Mermaid blocks, a purple design token, sidebar/topbar entries for custom pages, and routing.
This commit is contained in:
@@ -10,7 +10,14 @@ export function TopBar({ collapsed, onToggle }: TopBarProps) {
|
||||
const location = useLocation();
|
||||
const meta = pageTitles.get(location.pathname);
|
||||
const section = meta?.section?.includes("Demo") || meta?.section?.includes("Prototype") ? "Demos" : "Docs";
|
||||
const title = meta?.title ?? "Overview";
|
||||
let title = meta?.title ?? "Overview";
|
||||
|
||||
// Custom (dynamic) pages aren't in the static pageTitles registry.
|
||||
if (location.pathname.startsWith("/docs/custom")) {
|
||||
if (location.pathname === "/docs/custom") title = "Custom Pages";
|
||||
else if (location.pathname.endsWith("/new")) title = "New Page";
|
||||
else title = "Custom Page";
|
||||
}
|
||||
|
||||
return (
|
||||
<div className="flex h-topbar min-h-topbar min-w-0 items-center gap-4 border-b border-border bg-surface px-5 text-[0.8rem] max-md:gap-2 max-md:px-3">
|
||||
|
||||
Reference in New Issue
Block a user