@hanzo/docs-create-app 16.0.50
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/LICENSE +21 -0
- package/README.md +11 -0
- package/dist/auto-install-CenyMuK7.js +33 -0
- package/dist/auto-install-CenyMuK7.js.map +1 -0
- package/dist/bin.d.ts +1 -0
- package/dist/bin.js +165 -0
- package/dist/bin.js.map +1 -0
- package/dist/constants-BkYWkLHa.d.ts +22 -0
- package/dist/constants-BkYWkLHa.d.ts.map +1 -0
- package/dist/constants-CbNzssp2.js +957 -0
- package/dist/constants-CbNzssp2.js.map +1 -0
- package/dist/index.d.ts +49 -0
- package/dist/index.d.ts.map +1 -0
- package/dist/index.js +60 -0
- package/dist/index.js.map +1 -0
- package/dist/plugins/biome.base.d.ts +40 -0
- package/dist/plugins/biome.base.d.ts.map +1 -0
- package/dist/plugins/biome.base.js +38 -0
- package/dist/plugins/biome.base.js.map +1 -0
- package/dist/plugins/biome.d.ts +7 -0
- package/dist/plugins/biome.d.ts.map +1 -0
- package/dist/plugins/biome.js +33 -0
- package/dist/plugins/biome.js.map +1 -0
- package/dist/plugins/biome.next.d.ts +41 -0
- package/dist/plugins/biome.next.d.ts.map +1 -0
- package/dist/plugins/biome.next.js +44 -0
- package/dist/plugins/biome.next.js.map +1 -0
- package/dist/plugins/eslint.d.ts +7 -0
- package/dist/plugins/eslint.d.ts.map +1 -0
- package/dist/plugins/eslint.js +47 -0
- package/dist/plugins/eslint.js.map +1 -0
- package/dist/plugins/next-use-src.d.ts +10 -0
- package/dist/plugins/next-use-src.d.ts.map +1 -0
- package/dist/plugins/next-use-src.js +37 -0
- package/dist/plugins/next-use-src.js.map +1 -0
- package/dist/plugins/orama-cloud.d.ts +7 -0
- package/dist/plugins/orama-cloud.d.ts.map +1 -0
- package/dist/plugins/orama-cloud.js +296 -0
- package/dist/plugins/orama-cloud.js.map +1 -0
- package/package.json +63 -0
- package/template/+next+fuma-docs-mdx/app/(home)/layout.tsx +6 -0
- package/template/+next+fuma-docs-mdx/app/(home)/page.tsx +16 -0
- package/template/+next+fuma-docs-mdx/app/api/search/route.ts +7 -0
- package/template/+next+fuma-docs-mdx/app/docs/[[...slug]]/page.tsx +57 -0
- package/template/+next+fuma-docs-mdx/app/docs/layout.tsx +11 -0
- package/template/+next+fuma-docs-mdx/app/global.css +3 -0
- package/template/+next+fuma-docs-mdx/app/layout.tsx +17 -0
- package/template/+next+fuma-docs-mdx/app/llms-full.txt/route.ts +10 -0
- package/template/+next+fuma-docs-mdx/app/llms.mdx/docs/[[...slug]]/route.ts +20 -0
- package/template/+next+fuma-docs-mdx/app/llms.txt/route.ts +13 -0
- package/template/+next+fuma-docs-mdx/app/og/docs/[...slug]/route.tsx +27 -0
- package/template/+next+fuma-docs-mdx/components/ai/page-actions.tsx +240 -0
- package/template/+next+fuma-docs-mdx/content/docs/index.mdx +13 -0
- package/template/+next+fuma-docs-mdx/content/docs/test.mdx +17 -0
- package/template/+next+fuma-docs-mdx/example.gitignore +26 -0
- package/template/+next+fuma-docs-mdx/lib/cn.ts +1 -0
- package/template/+next+fuma-docs-mdx/lib/layout.shared.tsx +17 -0
- package/template/+next+fuma-docs-mdx/lib/source.ts +27 -0
- package/template/+next+fuma-docs-mdx/mdx-components.tsx +9 -0
- package/template/+next+fuma-docs-mdx/next.config.mjs +18 -0
- package/template/+next+fuma-docs-mdx/package.json +31 -0
- package/template/+next+fuma-docs-mdx/postcss.config.mjs +7 -0
- package/template/+next+fuma-docs-mdx/source.config.ts +23 -0
- package/template/+next+fuma-docs-mdx/tsconfig.json +36 -0
- package/template/+next+fuma-docs-mdx+static/README.md +45 -0
- package/template/+next+fuma-docs-mdx+static/app/(home)/layout.tsx +6 -0
- package/template/+next+fuma-docs-mdx+static/app/(home)/page.tsx +16 -0
- package/template/+next+fuma-docs-mdx+static/app/api/search/route.ts +9 -0
- package/template/+next+fuma-docs-mdx+static/app/docs/[[...slug]]/page.tsx +47 -0
- package/template/+next+fuma-docs-mdx+static/app/docs/layout.tsx +11 -0
- package/template/+next+fuma-docs-mdx+static/app/global.css +3 -0
- package/template/+next+fuma-docs-mdx+static/app/layout.tsx +17 -0
- package/template/+next+fuma-docs-mdx+static/app/llms-full.txt/route.ts +10 -0
- package/template/+next+fuma-docs-mdx+static/app/og/docs/[...slug]/route.tsx +27 -0
- package/template/+next+fuma-docs-mdx+static/components/provider.tsx +8 -0
- package/template/+next+fuma-docs-mdx+static/components/search.tsx +46 -0
- package/template/+next+fuma-docs-mdx+static/content/docs/index.mdx +13 -0
- package/template/+next+fuma-docs-mdx+static/content/docs/test.mdx +17 -0
- package/template/+next+fuma-docs-mdx+static/example.gitignore +26 -0
- package/template/+next+fuma-docs-mdx+static/lib/layout.shared.tsx +9 -0
- package/template/+next+fuma-docs-mdx+static/lib/source.ts +26 -0
- package/template/+next+fuma-docs-mdx+static/mdx-components.tsx +9 -0
- package/template/+next+fuma-docs-mdx+static/next.config.mjs +11 -0
- package/template/+next+fuma-docs-mdx+static/package.json +32 -0
- package/template/+next+fuma-docs-mdx+static/postcss.config.mjs +7 -0
- package/template/+next+fuma-docs-mdx+static/source.config.ts +23 -0
- package/template/+next+fuma-docs-mdx+static/tsconfig.json +36 -0
- package/template/+next+hanzo-docs-mdx/README.md +43 -0
- package/template/+next+hanzo-docs-mdx/app/(home)/layout.tsx +6 -0
- package/template/+next+hanzo-docs-mdx/app/(home)/page.tsx +16 -0
- package/template/+next+hanzo-docs-mdx/app/api/search/route.ts +7 -0
- package/template/+next+hanzo-docs-mdx/app/docs/[[...slug]]/page.tsx +61 -0
- package/template/+next+hanzo-docs-mdx/app/docs/layout.tsx +11 -0
- package/template/+next+hanzo-docs-mdx/app/global.css +3 -0
- package/template/+next+hanzo-docs-mdx/app/layout.tsx +17 -0
- package/template/+next+hanzo-docs-mdx/app/llms-full.txt/route.ts +10 -0
- package/template/+next+hanzo-docs-mdx/app/og/docs/[...slug]/route.tsx +27 -0
- package/template/+next+hanzo-docs-mdx/content/docs/index.mdx +13 -0
- package/template/+next+hanzo-docs-mdx/content/docs/test.mdx +17 -0
- package/template/+next+hanzo-docs-mdx/example.gitignore +26 -0
- package/template/+next+hanzo-docs-mdx/lib/cn.ts +1 -0
- package/template/+next+hanzo-docs-mdx/lib/layout.shared.tsx +9 -0
- package/template/+next+hanzo-docs-mdx/lib/source.ts +27 -0
- package/template/+next+hanzo-docs-mdx/mdx-components.tsx +9 -0
- package/template/+next+hanzo-docs-mdx/next.config.mjs +18 -0
- package/template/+next+hanzo-docs-mdx/package.json +31 -0
- package/template/+next+hanzo-docs-mdx/postcss.config.mjs +5 -0
- package/template/+next+hanzo-docs-mdx/source.config.ts +23 -0
- package/template/+next+hanzo-docs-mdx/tsconfig.json +36 -0
- package/template/+orama-cloud/@app/components/search.tsx +54 -0
- package/template/+orama-cloud/@app/lib/export-static-indexes.ts +14 -0
- package/template/+orama-cloud/@root/.env.example +6 -0
- package/template/react-router/README.md +12 -0
- package/template/react-router/app/app.css +3 -0
- package/template/react-router/app/docs/page.tsx +51 -0
- package/template/react-router/app/docs/search.ts +12 -0
- package/template/react-router/app/lib/layout.shared.tsx +9 -0
- package/template/react-router/app/lib/source.ts +7 -0
- package/template/react-router/app/root.tsx +73 -0
- package/template/react-router/app/routes/home.tsx +30 -0
- package/template/react-router/app/routes.ts +7 -0
- package/template/react-router/content/docs/index.mdx +32 -0
- package/template/react-router/content/docs/meta.json +3 -0
- package/template/react-router/content/docs/test.mdx +24 -0
- package/template/react-router/example.gitignore +7 -0
- package/template/react-router/package.json +35 -0
- package/template/react-router/public/favicon.ico +0 -0
- package/template/react-router/react-router.config.ts +23 -0
- package/template/react-router/source.config.ts +7 -0
- package/template/react-router/tsconfig.json +23 -0
- package/template/react-router/vite.config.ts +17 -0
- package/template/react-router-spa/README.md +12 -0
- package/template/react-router-spa/app/app.css +3 -0
- package/template/react-router-spa/app/components/search.tsx +45 -0
- package/template/react-router-spa/app/docs/page.tsx +53 -0
- package/template/react-router-spa/app/docs/search.ts +10 -0
- package/template/react-router-spa/app/lib/layout.shared.tsx +9 -0
- package/template/react-router-spa/app/lib/source.ts +7 -0
- package/template/react-router-spa/app/root.tsx +74 -0
- package/template/react-router-spa/app/routes/home.tsx +30 -0
- package/template/react-router-spa/app/routes.ts +7 -0
- package/template/react-router-spa/content/docs/index.mdx +32 -0
- package/template/react-router-spa/content/docs/test.mdx +24 -0
- package/template/react-router-spa/example.gitignore +7 -0
- package/template/react-router-spa/package.json +36 -0
- package/template/react-router-spa/public/favicon.ico +0 -0
- package/template/react-router-spa/react-router.config.ts +23 -0
- package/template/react-router-spa/serve.json +3 -0
- package/template/react-router-spa/source.config.ts +7 -0
- package/template/react-router-spa/tsconfig.json +23 -0
- package/template/react-router-spa/vite.config.ts +17 -0
- package/template/tanstack-start/README.md +12 -0
- package/template/tanstack-start/content/docs/index.mdx +31 -0
- package/template/tanstack-start/content/docs/test.mdx +12 -0
- package/template/tanstack-start/example.gitignore +18 -0
- package/template/tanstack-start/package.json +38 -0
- package/template/tanstack-start/source.config.ts +7 -0
- package/template/tanstack-start/src/components/not-found.tsx +28 -0
- package/template/tanstack-start/src/lib/layout.shared.tsx +9 -0
- package/template/tanstack-start/src/lib/source.ts +9 -0
- package/template/tanstack-start/src/router.tsx +12 -0
- package/template/tanstack-start/src/routes/__root.tsx +45 -0
- package/template/tanstack-start/src/routes/api/search.ts +16 -0
- package/template/tanstack-start/src/routes/docs/$.tsx +72 -0
- package/template/tanstack-start/src/routes/index.tsx +26 -0
- package/template/tanstack-start/src/styles/app.css +3 -0
- package/template/tanstack-start/tsconfig.json +24 -0
- package/template/tanstack-start/vite.config.ts +33 -0
- package/template/tanstack-start-spa/README.md +12 -0
- package/template/tanstack-start-spa/content/docs/index.mdx +31 -0
- package/template/tanstack-start-spa/content/docs/test.mdx +12 -0
- package/template/tanstack-start-spa/example.gitignore +18 -0
- package/template/tanstack-start-spa/package.json +41 -0
- package/template/tanstack-start-spa/source.config.ts +7 -0
- package/template/tanstack-start-spa/src/components/not-found.tsx +28 -0
- package/template/tanstack-start-spa/src/components/search.tsx +46 -0
- package/template/tanstack-start-spa/src/lib/layout.shared.tsx +9 -0
- package/template/tanstack-start-spa/src/lib/source.ts +9 -0
- package/template/tanstack-start-spa/src/router.tsx +12 -0
- package/template/tanstack-start-spa/src/routes/__root.tsx +46 -0
- package/template/tanstack-start-spa/src/routes/api/search.ts +16 -0
- package/template/tanstack-start-spa/src/routes/docs/$.tsx +74 -0
- package/template/tanstack-start-spa/src/routes/index.tsx +26 -0
- package/template/tanstack-start-spa/src/styles/app.css +3 -0
- package/template/tanstack-start-spa/tsconfig.json +24 -0
- package/template/tanstack-start-spa/vite.config.ts +42 -0
- package/template/waku/README.md +11 -0
- package/template/waku/content/docs/index.mdx +31 -0
- package/template/waku/content/docs/test.mdx +12 -0
- package/template/waku/example.gitignore +6 -0
- package/template/waku/package.json +33 -0
- package/template/waku/source.config.ts +7 -0
- package/template/waku/src/components/provider.tsx +7 -0
- package/template/waku/src/lib/layout.shared.tsx +9 -0
- package/template/waku/src/lib/source.ts +9 -0
- package/template/waku/src/pages/(home)/_layout.tsx +7 -0
- package/template/waku/src/pages/(home)/index.tsx +21 -0
- package/template/waku/src/pages/_api/api/search.ts +4 -0
- package/template/waku/src/pages/_root.tsx +20 -0
- package/template/waku/src/pages/docs/[...slugs].tsx +45 -0
- package/template/waku/src/pages/docs/_layout.tsx +12 -0
- package/template/waku/src/styles/globals.css +9 -0
- package/template/waku/tsconfig.json +25 -0
- package/template/waku/waku.config.ts +17 -0
|
@@ -0,0 +1,53 @@
|
|
|
1
|
+
import type { Route } from './+types/page';
|
|
2
|
+
import { DocsLayout } from '@hanzo/docs-base-ui/layouts/docs';
|
|
3
|
+
import { DocsBody, DocsDescription, DocsPage, DocsTitle } from '@hanzo/docs-base-ui/layouts/docs/page';
|
|
4
|
+
import { source } from '@/lib/source';
|
|
5
|
+
import defaultMdxComponents from '@hanzo/docs-base-ui/mdx';
|
|
6
|
+
import browserCollections from '@hanzo/docs-mdx:collections/browser';
|
|
7
|
+
import { baseOptions } from '@/lib/layout.shared';
|
|
8
|
+
import { useHanzoDocsLoader } from '@hanzo/docs-core/source/client';
|
|
9
|
+
|
|
10
|
+
export async function loader({ params }: Route.LoaderArgs) {
|
|
11
|
+
const slugs = params['*'].split('/').filter((v) => v.length > 0);
|
|
12
|
+
const page = source.getPage(slugs);
|
|
13
|
+
if (!page) throw new Response('Not found', { status: 404 });
|
|
14
|
+
|
|
15
|
+
return {
|
|
16
|
+
path: page.path,
|
|
17
|
+
pageTree: await source.serializePageTree(source.getPageTree()),
|
|
18
|
+
};
|
|
19
|
+
}
|
|
20
|
+
|
|
21
|
+
const clientLoader = browserCollections.docs.createClientLoader({
|
|
22
|
+
component(
|
|
23
|
+
{ toc, frontmatter, default: Mdx },
|
|
24
|
+
// you can define props for the component
|
|
25
|
+
props: {
|
|
26
|
+
className?: string;
|
|
27
|
+
},
|
|
28
|
+
) {
|
|
29
|
+
return (
|
|
30
|
+
<DocsPage toc={toc} {...props}>
|
|
31
|
+
<title>{frontmatter.title}</title>
|
|
32
|
+
<meta name="description" content={frontmatter.description} />
|
|
33
|
+
<DocsTitle>{frontmatter.title}</DocsTitle>
|
|
34
|
+
<DocsDescription>{frontmatter.description}</DocsDescription>
|
|
35
|
+
<DocsBody>
|
|
36
|
+
<Mdx components={{ ...defaultMdxComponents }} />
|
|
37
|
+
</DocsBody>
|
|
38
|
+
</DocsPage>
|
|
39
|
+
);
|
|
40
|
+
},
|
|
41
|
+
});
|
|
42
|
+
|
|
43
|
+
export default function Page({ loaderData }: Route.ComponentProps) {
|
|
44
|
+
const { pageTree } = useHanzoDocsLoader(loaderData);
|
|
45
|
+
|
|
46
|
+
return (
|
|
47
|
+
<DocsLayout {...baseOptions()} tree={pageTree}>
|
|
48
|
+
{clientLoader.useContent(loaderData.path, {
|
|
49
|
+
className: '',
|
|
50
|
+
})}
|
|
51
|
+
</DocsLayout>
|
|
52
|
+
);
|
|
53
|
+
}
|
|
@@ -0,0 +1,74 @@
|
|
|
1
|
+
import {
|
|
2
|
+
isRouteErrorResponse,
|
|
3
|
+
Links,
|
|
4
|
+
Meta,
|
|
5
|
+
Outlet,
|
|
6
|
+
Scripts,
|
|
7
|
+
ScrollRestoration,
|
|
8
|
+
} from 'react-router';
|
|
9
|
+
import { RootProvider } from '@hanzo/docs/ui/provider/react-router';
|
|
10
|
+
import type { Route } from './+types/root';
|
|
11
|
+
import './app.css';
|
|
12
|
+
import SearchDialog from '@/components/search';
|
|
13
|
+
|
|
14
|
+
export const links: Route.LinksFunction = () => [
|
|
15
|
+
{ rel: 'preconnect', href: 'https://fonts.googleapis.com' },
|
|
16
|
+
{
|
|
17
|
+
rel: 'preconnect',
|
|
18
|
+
href: 'https://fonts.gstatic.com',
|
|
19
|
+
crossOrigin: 'anonymous',
|
|
20
|
+
},
|
|
21
|
+
{
|
|
22
|
+
rel: 'stylesheet',
|
|
23
|
+
href: 'https://fonts.googleapis.com/css2?family=Inter:ital,opsz,wght@0,14..32,100..900;1,14..32,100..900&display=swap',
|
|
24
|
+
},
|
|
25
|
+
];
|
|
26
|
+
|
|
27
|
+
export function Layout({ children }: { children: React.ReactNode }) {
|
|
28
|
+
return (
|
|
29
|
+
<html lang="en" suppressHydrationWarning>
|
|
30
|
+
<head>
|
|
31
|
+
<meta charSet="utf-8" />
|
|
32
|
+
<meta name="viewport" content="width=device-width, initial-scale=1" />
|
|
33
|
+
<Meta />
|
|
34
|
+
<Links />
|
|
35
|
+
</head>
|
|
36
|
+
<body className="flex flex-col min-h-screen">
|
|
37
|
+
<RootProvider search={{ SearchDialog }}>{children}</RootProvider>
|
|
38
|
+
<ScrollRestoration />
|
|
39
|
+
<Scripts />
|
|
40
|
+
</body>
|
|
41
|
+
</html>
|
|
42
|
+
);
|
|
43
|
+
}
|
|
44
|
+
|
|
45
|
+
export default function App() {
|
|
46
|
+
return <Outlet />;
|
|
47
|
+
}
|
|
48
|
+
|
|
49
|
+
export function ErrorBoundary({ error }: Route.ErrorBoundaryProps) {
|
|
50
|
+
let message = 'Oops!';
|
|
51
|
+
let details = 'An unexpected error occurred.';
|
|
52
|
+
let stack: string | undefined;
|
|
53
|
+
|
|
54
|
+
if (isRouteErrorResponse(error)) {
|
|
55
|
+
message = error.status === 404 ? '404' : 'Error';
|
|
56
|
+
details =
|
|
57
|
+
error.status === 404 ? 'The requested page could not be found.' : error.statusText || details;
|
|
58
|
+
} else if (import.meta.env.DEV && error && error instanceof Error) {
|
|
59
|
+
details = error.message;
|
|
60
|
+
stack = error.stack;
|
|
61
|
+
}
|
|
62
|
+
|
|
63
|
+
return (
|
|
64
|
+
<main className="pt-16 p-4 w-full max-w-[1400px] mx-auto">
|
|
65
|
+
<h1>{message}</h1>
|
|
66
|
+
<p>{details}</p>
|
|
67
|
+
{stack && (
|
|
68
|
+
<pre className="w-full p-4 overflow-x-auto">
|
|
69
|
+
<code>{stack}</code>
|
|
70
|
+
</pre>
|
|
71
|
+
)}
|
|
72
|
+
</main>
|
|
73
|
+
);
|
|
74
|
+
}
|
|
@@ -0,0 +1,30 @@
|
|
|
1
|
+
import type { Route } from './+types/home';
|
|
2
|
+
import { HomeLayout } from '@hanzo/docs/ui/layouts/home';
|
|
3
|
+
import { Link } from 'react-router';
|
|
4
|
+
import { baseOptions } from '@/lib/layout.shared';
|
|
5
|
+
|
|
6
|
+
export function meta({}: Route.MetaArgs) {
|
|
7
|
+
return [
|
|
8
|
+
{ title: 'New React Router App' },
|
|
9
|
+
{ name: 'description', content: 'Welcome to React Router!' },
|
|
10
|
+
];
|
|
11
|
+
}
|
|
12
|
+
|
|
13
|
+
export default function Home() {
|
|
14
|
+
return (
|
|
15
|
+
<HomeLayout {...baseOptions()}>
|
|
16
|
+
<div className="p-4 flex flex-col items-center justify-center text-center flex-1">
|
|
17
|
+
<h1 className="text-xl font-bold mb-2">Hanzo Docs on React Router.</h1>
|
|
18
|
+
<p className="text-fd-muted-foreground mb-4">
|
|
19
|
+
The truly flexible docs framework on React.js.
|
|
20
|
+
</p>
|
|
21
|
+
<Link
|
|
22
|
+
className="text-sm bg-fd-primary text-fd-primary-foreground rounded-full font-medium px-4 py-2.5"
|
|
23
|
+
to="/docs"
|
|
24
|
+
>
|
|
25
|
+
Open Docs
|
|
26
|
+
</Link>
|
|
27
|
+
</div>
|
|
28
|
+
</HomeLayout>
|
|
29
|
+
);
|
|
30
|
+
}
|
|
@@ -0,0 +1,32 @@
|
|
|
1
|
+
---
|
|
2
|
+
title: Hello World
|
|
3
|
+
description: |
|
|
4
|
+
Your first `document`
|
|
5
|
+
You'll love it!
|
|
6
|
+
---
|
|
7
|
+
|
|
8
|
+
Hey there! Hanzo Docs is the docs framework that also works on React Router!
|
|
9
|
+
|
|
10
|
+
## Heading
|
|
11
|
+
|
|
12
|
+
Hello World
|
|
13
|
+
|
|
14
|
+
<Cards>
|
|
15
|
+
<Card title="Learn more about React Router" href="https://reactrouter.com" />
|
|
16
|
+
<Card title="Learn more about Hanzo Docs" href="https://hanzoai.github.io/docs" />
|
|
17
|
+
</Cards>
|
|
18
|
+
|
|
19
|
+
```ts
|
|
20
|
+
console.log('I love React!');
|
|
21
|
+
```
|
|
22
|
+
|
|
23
|
+
### Heading
|
|
24
|
+
|
|
25
|
+
#### Heading
|
|
26
|
+
|
|
27
|
+
| Head | Description |
|
|
28
|
+
| ------------------------------- | ----------------------------------- |
|
|
29
|
+
| `hello` | Hello World |
|
|
30
|
+
| very **important** | Hey |
|
|
31
|
+
| _Surprisingly_ | Hanzo Docs |
|
|
32
|
+
| very long text that looks weird | hello world hello world hello world |
|
|
@@ -0,0 +1,24 @@
|
|
|
1
|
+
---
|
|
2
|
+
title: Test
|
|
3
|
+
description: A document to test Hanzo Docs
|
|
4
|
+
---
|
|
5
|
+
|
|
6
|
+
Hey there!
|
|
7
|
+
|
|
8
|
+
## Cards
|
|
9
|
+
|
|
10
|
+
<Cards>
|
|
11
|
+
<Card title="Learn more about Next.js" href="https://nextjs.org/docs" />
|
|
12
|
+
<Card title="Learn more about Hanzo Docs" href="https://hanzoai.github.io/docs" />
|
|
13
|
+
</Cards>
|
|
14
|
+
|
|
15
|
+
### CodeBlock
|
|
16
|
+
|
|
17
|
+
```js
|
|
18
|
+
console.log('Hello World');
|
|
19
|
+
```
|
|
20
|
+
|
|
21
|
+
#### List
|
|
22
|
+
|
|
23
|
+
- Hello
|
|
24
|
+
- World
|
|
@@ -0,0 +1,36 @@
|
|
|
1
|
+
{
|
|
2
|
+
"name": "example-react-router-spa",
|
|
3
|
+
"private": true,
|
|
4
|
+
"type": "module",
|
|
5
|
+
"scripts": {
|
|
6
|
+
"build": "react-router build",
|
|
7
|
+
"dev": "react-router dev",
|
|
8
|
+
"start": "serve ./build/client",
|
|
9
|
+
"types:check": "react-router typegen && @hanzo/docs-mdx && tsc --noEmit"
|
|
10
|
+
},
|
|
11
|
+
"dependencies": {
|
|
12
|
+
"@orama/orama": "^3.1.18",
|
|
13
|
+
"@react-router/node": "^7.13.0",
|
|
14
|
+
"@hanzo/docs-core": "workspace:*",
|
|
15
|
+
"@hanzo/docs-mdx": "workspace:*",
|
|
16
|
+
"@hanzo/docs-base-ui": "workspace:*",
|
|
17
|
+
"isbot": "^5.1.34",
|
|
18
|
+
"react": "^19.2.4",
|
|
19
|
+
"react-dom": "^19.2.4",
|
|
20
|
+
"react-router": "^7.13.0"
|
|
21
|
+
},
|
|
22
|
+
"devDependencies": {
|
|
23
|
+
"@react-router/dev": "^7.13.0",
|
|
24
|
+
"@tailwindcss/vite": "^4.1.18",
|
|
25
|
+
"@types/mdx": "^2.0.13",
|
|
26
|
+
"@types/node": "^25.2.1",
|
|
27
|
+
"@types/react": "^19.2.13",
|
|
28
|
+
"@types/react-dom": "^19.2.3",
|
|
29
|
+
"react-router-devtools": "^6.2.0",
|
|
30
|
+
"serve": "^14.2.5",
|
|
31
|
+
"tailwindcss": "^4.1.18",
|
|
32
|
+
"typescript": "^5.9.3",
|
|
33
|
+
"vite": "^7.3.1",
|
|
34
|
+
"vite-tsconfig-paths": "^6.0.5"
|
|
35
|
+
}
|
|
36
|
+
}
|
|
Binary file
|
|
@@ -0,0 +1,23 @@
|
|
|
1
|
+
import type { Config } from '@react-router/dev/config';
|
|
2
|
+
import { glob } from 'node:fs/promises';
|
|
3
|
+
import { createGetUrl, getSlugs } from '@hanzo/docs/core/source';
|
|
4
|
+
|
|
5
|
+
const getUrl = createGetUrl('/docs');
|
|
6
|
+
|
|
7
|
+
export default {
|
|
8
|
+
ssr: true,
|
|
9
|
+
async prerender({ getStaticPaths }) {
|
|
10
|
+
const paths: string[] = [];
|
|
11
|
+
const excluded: string[] = [];
|
|
12
|
+
|
|
13
|
+
for (const path of getStaticPaths()) {
|
|
14
|
+
if (!excluded.includes(path)) paths.push(path);
|
|
15
|
+
}
|
|
16
|
+
|
|
17
|
+
for await (const entry of glob('**/*.mdx', { cwd: 'content/docs' })) {
|
|
18
|
+
paths.push(getUrl(getSlugs(entry)));
|
|
19
|
+
}
|
|
20
|
+
|
|
21
|
+
return paths;
|
|
22
|
+
},
|
|
23
|
+
} satisfies Config;
|
|
@@ -0,0 +1,23 @@
|
|
|
1
|
+
{
|
|
2
|
+
"include": ["**/*", "**/.server/**/*", "**/.client/**/*", ".react-router/types/**/*"],
|
|
3
|
+
"compilerOptions": {
|
|
4
|
+
"lib": ["DOM", "DOM.Iterable", "ES2022"],
|
|
5
|
+
"types": ["node", "vite/client"],
|
|
6
|
+
"target": "esnext",
|
|
7
|
+
"module": "esnext",
|
|
8
|
+
"moduleResolution": "bundler",
|
|
9
|
+
"jsx": "react-jsx",
|
|
10
|
+
"rootDirs": [".", "./.react-router/types"],
|
|
11
|
+
"baseUrl": ".",
|
|
12
|
+
"paths": {
|
|
13
|
+
"@/*": ["./app/*"],
|
|
14
|
+
"@hanzo/docs/mdx:collections/*": ["docs/*"]
|
|
15
|
+
},
|
|
16
|
+
"esModuleInterop": true,
|
|
17
|
+
"verbatimModuleSyntax": true,
|
|
18
|
+
"noEmit": true,
|
|
19
|
+
"resolveJsonModule": true,
|
|
20
|
+
"skipLibCheck": true,
|
|
21
|
+
"strict": true
|
|
22
|
+
}
|
|
23
|
+
}
|
|
@@ -0,0 +1,17 @@
|
|
|
1
|
+
import { reactRouter } from '@react-router/dev/vite';
|
|
2
|
+
import tailwindcss from '@tailwindcss/vite';
|
|
3
|
+
import { defineConfig } from 'vite';
|
|
4
|
+
import tsconfigPaths from 'vite-tsconfig-paths';
|
|
5
|
+
import mdx from '@hanzo/docs/mdx/vite';
|
|
6
|
+
import * as MdxConfig from './source.config';
|
|
7
|
+
|
|
8
|
+
export default defineConfig({
|
|
9
|
+
plugins: [
|
|
10
|
+
mdx(MdxConfig),
|
|
11
|
+
tailwindcss(),
|
|
12
|
+
reactRouter(),
|
|
13
|
+
tsconfigPaths({
|
|
14
|
+
root: __dirname,
|
|
15
|
+
}),
|
|
16
|
+
],
|
|
17
|
+
});
|
|
@@ -0,0 +1,31 @@
|
|
|
1
|
+
---
|
|
2
|
+
title: Hello World
|
|
3
|
+
description: Your favourite docs framework.
|
|
4
|
+
icon: Rocket
|
|
5
|
+
---
|
|
6
|
+
|
|
7
|
+
Hey there! Hanzo Docs is the docs framework that also works on Tanstack Start!
|
|
8
|
+
|
|
9
|
+
## Heading
|
|
10
|
+
|
|
11
|
+
Hello World!
|
|
12
|
+
|
|
13
|
+
<Cards>
|
|
14
|
+
<Card title="Learn more about Tanstack Start" href="https://tanstack.com/start" />
|
|
15
|
+
<Card title="Learn more about Hanzo Docs" href="https://hanzoai.github.io/docs" />
|
|
16
|
+
</Cards>
|
|
17
|
+
|
|
18
|
+
### CodeBlock
|
|
19
|
+
|
|
20
|
+
```ts
|
|
21
|
+
console.log('Hello World');
|
|
22
|
+
```
|
|
23
|
+
|
|
24
|
+
#### Table
|
|
25
|
+
|
|
26
|
+
| Head | Description |
|
|
27
|
+
| ------------------------------- | ----------------------------------- |
|
|
28
|
+
| `hello` | Hello World |
|
|
29
|
+
| very **important** | Hey |
|
|
30
|
+
| _Surprisingly_ | Hanzo Docs |
|
|
31
|
+
| very long text that looks weird | hello world hello world hello world |
|
|
@@ -0,0 +1,38 @@
|
|
|
1
|
+
{
|
|
2
|
+
"name": "example-tanstack-start",
|
|
3
|
+
"private": true,
|
|
4
|
+
"type": "module",
|
|
5
|
+
"sideEffects": false,
|
|
6
|
+
"scripts": {
|
|
7
|
+
"dev": "vite dev",
|
|
8
|
+
"build": "vite build",
|
|
9
|
+
"start": "node .output/server/index.mjs",
|
|
10
|
+
"preview": "vite preview",
|
|
11
|
+
"types:check": "@hanzo/docs-mdx && tsc --noEmit"
|
|
12
|
+
},
|
|
13
|
+
"dependencies": {
|
|
14
|
+
"@tanstack/react-router": "1.158.4",
|
|
15
|
+
"@tanstack/react-router-devtools": "1.158.4",
|
|
16
|
+
"@tanstack/react-start": "1.159.0",
|
|
17
|
+
"@hanzo/docs-core": "workspace:*",
|
|
18
|
+
"@hanzo/docs-mdx": "workspace:*",
|
|
19
|
+
"@hanzo/docs-base-ui": "workspace:*",
|
|
20
|
+
"lucide-react": "^0.563.0",
|
|
21
|
+
"react": "^19.2.4",
|
|
22
|
+
"react-dom": "^19.2.4",
|
|
23
|
+
"vite": "^7.3.1"
|
|
24
|
+
},
|
|
25
|
+
"devDependencies": {
|
|
26
|
+
"@tailwindcss/vite": "^4.1.18",
|
|
27
|
+
"@types/mdx": "^2.0.13",
|
|
28
|
+
"@types/node": "^25.2.1",
|
|
29
|
+
"@types/react": "^19.2.13",
|
|
30
|
+
"@types/react-dom": "^19.2.3",
|
|
31
|
+
"@vitejs/plugin-react": "^5.1.3",
|
|
32
|
+
"nitro": "npm:nitro-nightly@3.0.1-20260128-211656-ae83c97e",
|
|
33
|
+
"srvx": "^0.11.2",
|
|
34
|
+
"tailwindcss": "^4.1.18",
|
|
35
|
+
"typescript": "^5.9.3",
|
|
36
|
+
"vite-tsconfig-paths": "^6.0.5"
|
|
37
|
+
}
|
|
38
|
+
}
|
|
@@ -0,0 +1,28 @@
|
|
|
1
|
+
import { Link } from '@tanstack/react-router';
|
|
2
|
+
import { HomeLayout } from '@hanzo/docs/ui/layouts/home';
|
|
3
|
+
|
|
4
|
+
export function NotFound() {
|
|
5
|
+
return (
|
|
6
|
+
<HomeLayout
|
|
7
|
+
nav={{
|
|
8
|
+
title: 'Tanstack Start',
|
|
9
|
+
}}
|
|
10
|
+
className="text-center py-32 justify-center"
|
|
11
|
+
>
|
|
12
|
+
<div className="flex flex-col items-center gap-4">
|
|
13
|
+
<h1 className="text-6xl font-bold text-fd-muted-foreground">404</h1>
|
|
14
|
+
<h2 className="text-2xl font-semibold">Page Not Found</h2>
|
|
15
|
+
<p className="text-fd-muted-foreground max-w-md">
|
|
16
|
+
The page you are looking for might have been removed, had its name changed, or is
|
|
17
|
+
temporarily unavailable.
|
|
18
|
+
</p>
|
|
19
|
+
<Link
|
|
20
|
+
to="/"
|
|
21
|
+
className="mt-4 px-4 py-2 rounded-lg bg-fd-primary text-fd-primary-foreground font-medium text-sm hover:opacity-90 transition-opacity"
|
|
22
|
+
>
|
|
23
|
+
Back to Home
|
|
24
|
+
</Link>
|
|
25
|
+
</div>
|
|
26
|
+
</HomeLayout>
|
|
27
|
+
);
|
|
28
|
+
}
|
|
@@ -0,0 +1,9 @@
|
|
|
1
|
+
import { loader } from '@hanzo/docs/core/source';
|
|
2
|
+
import { docs } from '@hanzo/docs/mdx:collections/server';
|
|
3
|
+
import { lucideIconsPlugin } from '@hanzo/docs/core/source/lucide-icons';
|
|
4
|
+
|
|
5
|
+
export const source = loader({
|
|
6
|
+
source: docs.toHanzo DocsSource(),
|
|
7
|
+
baseUrl: '/docs',
|
|
8
|
+
plugins: [lucideIconsPlugin()],
|
|
9
|
+
});
|
|
@@ -0,0 +1,12 @@
|
|
|
1
|
+
import { createRouter as createTanStackRouter } from '@tanstack/react-router';
|
|
2
|
+
import { routeTree } from './routeTree.gen';
|
|
3
|
+
import { NotFound } from '@/components/not-found';
|
|
4
|
+
|
|
5
|
+
export function getRouter() {
|
|
6
|
+
return createTanStackRouter({
|
|
7
|
+
routeTree,
|
|
8
|
+
defaultPreload: 'intent',
|
|
9
|
+
scrollRestoration: true,
|
|
10
|
+
defaultNotFoundComponent: NotFound,
|
|
11
|
+
});
|
|
12
|
+
}
|
|
@@ -0,0 +1,45 @@
|
|
|
1
|
+
import { createRootRoute, HeadContent, Outlet, Scripts } from '@tanstack/react-router';
|
|
2
|
+
import * as React from 'react';
|
|
3
|
+
import appCss from '@/styles/app.css?url';
|
|
4
|
+
import { RootProvider } from '@hanzo/docs/ui/provider/tanstack';
|
|
5
|
+
|
|
6
|
+
export const Route = createRootRoute({
|
|
7
|
+
head: () => ({
|
|
8
|
+
meta: [
|
|
9
|
+
{
|
|
10
|
+
charSet: 'utf-8',
|
|
11
|
+
},
|
|
12
|
+
{
|
|
13
|
+
name: 'viewport',
|
|
14
|
+
content: 'width=device-width, initial-scale=1',
|
|
15
|
+
},
|
|
16
|
+
{
|
|
17
|
+
title: 'Hanzo Docs on TanStack Start',
|
|
18
|
+
},
|
|
19
|
+
],
|
|
20
|
+
links: [{ rel: 'stylesheet', href: appCss }],
|
|
21
|
+
}),
|
|
22
|
+
component: RootComponent,
|
|
23
|
+
});
|
|
24
|
+
|
|
25
|
+
function RootComponent() {
|
|
26
|
+
return (
|
|
27
|
+
<RootDocument>
|
|
28
|
+
<Outlet />
|
|
29
|
+
</RootDocument>
|
|
30
|
+
);
|
|
31
|
+
}
|
|
32
|
+
|
|
33
|
+
function RootDocument({ children }: { children: React.ReactNode }) {
|
|
34
|
+
return (
|
|
35
|
+
<html suppressHydrationWarning>
|
|
36
|
+
<head>
|
|
37
|
+
<HeadContent />
|
|
38
|
+
</head>
|
|
39
|
+
<body className="flex flex-col min-h-screen">
|
|
40
|
+
<RootProvider>{children}</RootProvider>
|
|
41
|
+
<Scripts />
|
|
42
|
+
</body>
|
|
43
|
+
</html>
|
|
44
|
+
);
|
|
45
|
+
}
|
|
@@ -0,0 +1,16 @@
|
|
|
1
|
+
import { createFileRoute } from '@tanstack/react-router';
|
|
2
|
+
import { source } from '@/lib/source';
|
|
3
|
+
import { createFromSource } from '@hanzo/docs/core/search/server';
|
|
4
|
+
|
|
5
|
+
const server = createFromSource(source, {
|
|
6
|
+
// https://docs.orama.com/docs/orama-js/supported-languages
|
|
7
|
+
language: 'english',
|
|
8
|
+
});
|
|
9
|
+
|
|
10
|
+
export const Route = createFileRoute('/api/search')({
|
|
11
|
+
server: {
|
|
12
|
+
handlers: {
|
|
13
|
+
GET: async ({ request }) => server.GET(request),
|
|
14
|
+
},
|
|
15
|
+
},
|
|
16
|
+
});
|