Skip to content

Commit f1b197b

Browse files
committed
feat: add docs system with MDX rendering, hierarchical nav, inline demos, and content cleanup
1 parent 479e62c commit f1b197b

364 files changed

Lines changed: 2732 additions & 4827 deletions

File tree

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

pnpm-lock.yaml

Lines changed: 1976 additions & 2665 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

showcase/shell/package.json

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -23,6 +23,7 @@
2323
"react-markdown": "^9.0.0",
2424
"react-syntax-highlighter": "^15.6.0",
2525
"rehype-highlight": "^7.0.2",
26+
"rehype-raw": "^7.0.0",
2627
"remark-gfm": "^4.0.0",
2728
"yaml": "^2.7.0"
2829
},

showcase/shell/src/app/ag-ui/[[...slug]]/page.tsx

Lines changed: 37 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,9 @@ import remarkGfm from "remark-gfm";
77
import rehypeHighlight from "rehype-highlight";
88
import Link from "next/link";
99
import { Callout, Cards, Card, Accordions, Accordion } from "@/components/mdx-components";
10+
import { SidebarNav } from "@/components/sidebar-nav";
1011
import { PropertyReference } from "@/components/property-reference";
12+
import { getRegistry } from "@/lib/registry";
1113

1214
const CONTENT_DIR = path.join(process.cwd(), "src/content/ag-ui");
1315

@@ -113,8 +115,7 @@ const NAV_DEFINITION: NavTab[] = [
113115
"sdk/js/client/compaction",
114116
],
115117
},
116-
"sdk/js/encoder",
117-
"sdk/js/proto",
118+
// sdk/js/encoder and sdk/js/proto removed (empty placeholder pages)
118119
],
119120
},
120121
{
@@ -190,6 +191,35 @@ const components = {
190191
Accordions,
191192
Accordion,
192193
PropertyReference,
194+
InlineDemo: ({ integration, demo }: { integration?: string; demo?: string }) => {
195+
if (!integration || !demo) return null;
196+
const reg = getRegistry();
197+
const int = reg.integrations.find((i) => i.slug === integration);
198+
if (!int || !int.deployed) return null;
199+
const demoUrl = `${int.backend_url}/demos/${demo}`;
200+
return (
201+
<div className="my-6 rounded-xl border border-[var(--border)] overflow-hidden">
202+
<div className="flex items-center justify-between px-4 py-2 bg-[var(--bg-elevated)] border-b border-[var(--border)]">
203+
<span className="text-xs font-mono text-[var(--text-muted)]">
204+
Live Demo: {int.name}{demo}
205+
</span>
206+
<a
207+
href={`/integrations/${integration}?demo=${demo}`}
208+
className="text-xs text-[var(--accent)] hover:underline"
209+
>
210+
Open full demo →
211+
</a>
212+
</div>
213+
<iframe
214+
src={demoUrl}
215+
className="w-full"
216+
style={{ height: "500px" }}
217+
sandbox="allow-scripts allow-same-origin allow-forms allow-popups"
218+
loading="lazy"
219+
/>
220+
</div>
221+
);
222+
},
193223
Note: Callout,
194224
Warning: ({ children }: { children: React.ReactNode }) => (
195225
<Callout type="warn">{children}</Callout>
@@ -312,12 +342,14 @@ export default async function AgUiDocPage({
312342
function renderNavItem(item: ResolvedNavItem, depth: number = 0): React.ReactNode {
313343
const indent = depth * 16;
314344
if (item.kind === "page") {
345+
const isActive = item.slug === slugPath;
315346
return (
316347
<Link
317348
key={item.slug}
318349
href={`/ag-ui/${item.slug}`}
350+
data-active={isActive ? "true" : undefined}
319351
className={`block py-[5px] text-[14px] transition-colors ${
320-
item.slug === slugPath
352+
isActive
321353
? "text-[var(--text)] font-medium"
322354
: "text-[var(--text-secondary)] hover:text-[var(--text)]"
323355
}`}
@@ -366,7 +398,7 @@ export default async function AgUiDocPage({
366398
return (
367399
<div className="flex" style={{ height: "calc(100vh - 52px)" }}>
368400
{/* Sidebar */}
369-
<aside className="w-[220px] shrink-0 border-r border-[var(--border)] bg-[var(--bg)] overflow-y-auto p-4">
401+
<SidebarNav className="w-[220px] shrink-0 border-r border-[var(--border)] bg-[var(--bg)] overflow-y-auto p-4">
370402
<Link
371403
href="/ag-ui"
372404
className="block text-xs font-mono uppercase tracking-widest text-[var(--violet)] mb-4"
@@ -385,7 +417,7 @@ export default async function AgUiDocPage({
385417
))}
386418
</div>
387419
))}
388-
</aside>
420+
</SidebarNav>
389421

390422
{/* Content */}
391423
<main className="flex-1 max-w-3xl px-8 py-8 overflow-y-auto">

0 commit comments

Comments
 (0)