generated from chiffre-io/template-library
-
-
Notifications
You must be signed in to change notification settings - Fork 221
doc: support markdown response for AI #1171
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Open
aryasaatvik
wants to merge
16
commits into
47ng:next
Choose a base branch
from
aryasaatvik:feat/llm-docs
base: next
Could not load branches
Branch not found: {{ refName }}
Loading
Could not load tags
Nothing to show
Loading
Are you sure you want to change the base?
Some commits from the old base branch may be removed from the timeline,
and old review comments may become outdated.
+551
−329
Open
Changes from all commits
Commits
Show all changes
16 commits
Select commit
Hold shift + click to select a range
439f2de
chore(deps): update fumadocs-core to 15.8.5 and fumadocs-mdx to 12.0.…
aryasaatvik 61a800d
feat(docs): implement LLM markdown rewrites and add new routes for LL…
aryasaatvik b0441c7
ref(docs): replace middleware with static rewrites for LLM content
aryasaatvik 24d0d0c
chore(deps): update fumadocs-ui to 15.8.5 in package.json and pnpm-lo…
aryasaatvik cb4dd17
chore: move llms.txt and llms-full.txt to the root
aryasaatvik a133fe4
feat(docs): add new redirect for manually requesting markdown files i…
aryasaatvik 9ee7547
feat(docs): add copy button and view options for markdown files
aryasaatvik 4bc7213
chore(docs): update test script to include next typegen before tsc
aryasaatvik 82b59ad
fix(docs): use consistent cn utility import
aryasaatvik 683b3dd
feat(docs): use nuqs serializer for ChatGPT URL construction
aryasaatvik 22ef450
feat(docs): add Suspense boundary with buttonVariants skeleton
aryasaatvik 5cd30b9
feat(docs): move PageActionsSkeleton to page-actions component
aryasaatvik 0027b7c
Merge branch 'next' into feat/llm-docs
aryasaatvik af1b68c
feat(docs): restructure LLM documentation output
aryasaatvik 82120b0
feat(docs): add page exclusions for LLM text generation
aryasaatvik bf1fac4
fix(docs): filter out excluded pages in LLM text generation
aryasaatvik File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,17 @@ | ||
| import { source } from '@/src/app/source'; | ||
| import { getLLMText } from '@/src/lib/get-llm-text'; | ||
|
|
||
| // cached forever | ||
| export const revalidate = false; | ||
|
|
||
| const PAGE_EXCLUSIONS = [ | ||
| "/docs/about", | ||
| ]; | ||
|
|
||
| export async function GET() { | ||
| const pages = source.getPages().filter(page => !PAGE_EXCLUSIONS.includes(page.url)); | ||
| const scan = pages.map(getLLMText); | ||
| const scanned = await Promise.all(scan); | ||
|
|
||
| return new Response(scanned.join('\n\n')); | ||
| } |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,25 @@ | ||
| import { source } from '@/src/app/source'; | ||
| import { getLLMText } from '@/src/lib/get-llm-text'; | ||
|
|
||
| // cached forever | ||
| export const revalidate = false; | ||
|
|
||
| export async function GET() { | ||
| const scanned: string[] = []; | ||
| scanned.push('# Docs'); | ||
| const map = new Map<string, string[]>(); | ||
|
|
||
| for (const page of source.getPages()) { | ||
| const dir = page.slugs[0]; | ||
| const list = map.get(dir) ?? []; | ||
| list.push(`- [${page.data.title}](${page.url}): ${page.data.description}`); | ||
| map.set(dir, list); | ||
| } | ||
|
|
||
| for (const [key, value] of map) { | ||
| scanned.push(`## ${key}`); | ||
| scanned.push(value.join('\n')); | ||
| } | ||
|
|
||
| return new Response(scanned.join('\n\n')); | ||
| } |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,24 @@ | ||
| import { getLLMText } from '@/src/lib/get-llm-text'; | ||
| import { source } from '@/src/app/source'; | ||
| import { notFound } from 'next/navigation'; | ||
|
|
||
| export const revalidate = false; | ||
|
|
||
| export async function GET( | ||
| _req: Request, | ||
| { params }: RouteContext<'/llms/docs/[[...slug]]'>, | ||
| ) { | ||
| const { slug } = await params; | ||
| const page = source.getPage(slug); | ||
| if (!page) notFound(); | ||
|
|
||
| return new Response(await getLLMText(page), { | ||
| headers: { | ||
| 'Content-Type': 'text/markdown', | ||
| }, | ||
| }); | ||
| } | ||
|
|
||
| export function generateStaticParams() { | ||
| return source.generateParams(); | ||
| } |
Oops, something went wrong.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Uh oh!
There was an error while loading. Please reload this page.