A design system in a box. hip-ui.tngl.io/docs/introduction
0
fork

Configure Feed

Select the types of activity you want to include in your feed.

add llms.txt

+63 -5
+2 -2
apps/docs/src/docs/ai.mdx
··· 3 3 description: How to use AI to enhance building with Hip UI. 4 4 --- 5 5 6 - Hip UI interfaces with AI in two main ways: 6 + Hip UI interfaces with AI in a few main ways: 7 7 8 - 1. **llms.txt/per page markdown** - The docs as static markdown files that can be used as context for AI chats like OpenAi or Claude. 8 + 1. [**llms.txt**](https://hip-ui.tngl.io/llms.txt) - The docs as static markdown files that can be used as context for AI chats like OpenAi or Claude. 9 9 2. **MCP server** - A MCP server that AI can use to get guidance on how to use Hip UI. 10 10 11 11 ## MCP Server
+21 -3
apps/docs/src/routeTree.gen.ts
··· 9 9 // Additionally, you should also exclude this file from your linter and/or formatter to prevent it from being checked or modified. 10 10 11 11 import { Route as rootRouteImport } from './routes/__root' 12 + import { Route as LlmsDottxtRouteImport } from './routes/llms[.]txt' 12 13 import { Route as DocsRouteImport } from './routes/docs' 13 14 import { Route as IndexRouteImport } from './routes/index' 14 15 import { Route as DocsSplatRouteImport } from './routes/docs.$' 15 16 17 + const LlmsDottxtRoute = LlmsDottxtRouteImport.update({ 18 + id: '/llms.txt', 19 + path: '/llms.txt', 20 + getParentRoute: () => rootRouteImport, 21 + } as any) 16 22 const DocsRoute = DocsRouteImport.update({ 17 23 id: '/docs', 18 24 path: '/docs', ··· 32 38 export interface FileRoutesByFullPath { 33 39 '/': typeof IndexRoute 34 40 '/docs': typeof DocsRouteWithChildren 41 + '/llms.txt': typeof LlmsDottxtRoute 35 42 '/docs/$': typeof DocsSplatRoute 36 43 } 37 44 export interface FileRoutesByTo { 38 45 '/': typeof IndexRoute 39 46 '/docs': typeof DocsRouteWithChildren 47 + '/llms.txt': typeof LlmsDottxtRoute 40 48 '/docs/$': typeof DocsSplatRoute 41 49 } 42 50 export interface FileRoutesById { 43 51 __root__: typeof rootRouteImport 44 52 '/': typeof IndexRoute 45 53 '/docs': typeof DocsRouteWithChildren 54 + '/llms.txt': typeof LlmsDottxtRoute 46 55 '/docs/$': typeof DocsSplatRoute 47 56 } 48 57 export interface FileRouteTypes { 49 58 fileRoutesByFullPath: FileRoutesByFullPath 50 - fullPaths: '/' | '/docs' | '/docs/$' 59 + fullPaths: '/' | '/docs' | '/llms.txt' | '/docs/$' 51 60 fileRoutesByTo: FileRoutesByTo 52 - to: '/' | '/docs' | '/docs/$' 53 - id: '__root__' | '/' | '/docs' | '/docs/$' 61 + to: '/' | '/docs' | '/llms.txt' | '/docs/$' 62 + id: '__root__' | '/' | '/docs' | '/llms.txt' | '/docs/$' 54 63 fileRoutesById: FileRoutesById 55 64 } 56 65 export interface RootRouteChildren { 57 66 IndexRoute: typeof IndexRoute 58 67 DocsRoute: typeof DocsRouteWithChildren 68 + LlmsDottxtRoute: typeof LlmsDottxtRoute 59 69 } 60 70 61 71 declare module '@tanstack/react-router' { 62 72 interface FileRoutesByPath { 73 + '/llms.txt': { 74 + id: '/llms.txt' 75 + path: '/llms.txt' 76 + fullPath: '/llms.txt' 77 + preLoaderRoute: typeof LlmsDottxtRouteImport 78 + parentRoute: typeof rootRouteImport 79 + } 63 80 '/docs': { 64 81 id: '/docs' 65 82 path: '/docs' ··· 97 114 const rootRouteChildren: RootRouteChildren = { 98 115 IndexRoute: IndexRoute, 99 116 DocsRoute: DocsRouteWithChildren, 117 + LlmsDottxtRoute: LlmsDottxtRoute, 100 118 } 101 119 export const routeTree = rootRouteImport 102 120 ._addFileChildren(rootRouteChildren)
+40
apps/docs/src/routes/llms[.]txt.tsx
··· 1 + import { createFileRoute } from "@tanstack/react-router"; 2 + import { allDocs } from "content-collections"; 3 + import dedent from "dedent"; 4 + 5 + const componentDocs = allDocs.filter((doc) => 6 + doc._meta.directory.startsWith("components"), 7 + ); 8 + const foundationDocs = allDocs.filter((doc) => 9 + doc._meta.directory.startsWith("foundations"), 10 + ); 11 + 12 + export const Route = createFileRoute("/llms.txt")({ 13 + server: { 14 + handlers: { 15 + GET: async () => { 16 + const fileContent = dedent` 17 + # Hip UI Documentation 18 + 19 + > Plain text version of the Hip UI documentation. 20 + 21 + ## Foundations 22 + 23 + ${foundationDocs.map((doc) => `- [${doc.title}](/docs/${doc._meta.path}.md): ${doc.description}`).join("\n")} 24 + 25 + ## Components 26 + 27 + ${componentDocs.map((doc) => `- [${doc.title}](/docs/${doc._meta.path}.md): ${doc.description}`).join("\n")} 28 + `; 29 + 30 + return new Response(fileContent, { 31 + status: 200, 32 + headers: { 33 + // Set the content type to plain text 34 + "Content-Type": "text/plain", 35 + }, 36 + }); 37 + }, 38 + }, 39 + }, 40 + });