Skip to content
Source
Sign inSign up
TanStack/schemas
Open History to see the last commit

docs.tsx

53 lines2.0 KB

1import { createFileRoute } from '@tanstack/react-router'
2import { Streamdown } from 'streamdown'
3​
4import { SiteFooter, SiteNav } from '#/components/site.tsx'
5import { llmsTxt } from '#/server/llms-txt.ts'
6​
7export const Route = createFileRoute('/docs')({
8 component: Docs,
9})
10​
11const LINKS: Array<[label: string, href: string]> = [
12 ['API index', '/v1'],
13 ['openapi.json', '/openapi.json'],
14 ['llms.txt (this content, raw)', '/llms.txt'],
15 ['Agent discovery', '/.well-known/agent-configuration'],
16 ['Service status', '/v1/status'],
17 ['Model catalog', '/v1/models'],
18 ['Changes feed', '/v1/changes'],
19 ['Agent skill (SKILL.md)', '/skill'],
21​
22function Docs() {
23 return (
24 <div className="min-h-screen text-ink">
25 <SiteNav active="docs" />
26 <div className="mx-auto max-w-3xl space-y-10 px-5 py-14">
27 <header className="space-y-4">
28 <h1 className="font-mono text-2xl font-semibold tracking-tight">
29 Documentation<span className="text-tok-blue">▌</span>
30 </h1>
31 <p className="font-mono text-xs text-ink-faint">
32 rendered from the exact /llms.txt agents fetch — zero drift by
33 construction.
34 </p>
35 <nav className="hairline flex flex-wrap gap-x-5 gap-y-1.5 border-y py-2.5 font-mono text-xs">
36 {LINKS.map(([label, href]) => (
37 <a key={href} className="press-link" href={href}>
38 {label}
39 </a>
40 ))}
41 </nav>
42 </header>
43​
44 {/* Rendered from the exact llms.txt source so the human docs can never
45 drift from what agents read. */}
46 <article className="prose max-w-none prose-headings:font-mono prose-headings:font-semibold prose-headings:text-ink prose-p:text-ink-soft prose-li:text-ink-soft prose-strong:text-ink prose-code:text-tok-blue prose-a:text-tok-blue prose-li:marker:text-ink-faint">
47 <Streamdown>{llmsTxt}</Streamdown>
48 </article>
49 </div>
50 <SiteFooter />
51 </div>
52 )