Thanks to visit codestin.com
Credit goes to github.com

Skip to content

Conversation

@indralukmana
Copy link

@indralukmana indralukmana commented Sep 3, 2025

Problem

Needed a way to quickly get the content of docs to enrich llm chat context.

Summary of Changes

Implemented the feature built-in in the Fumadocs https://fumadocs.dev/docs/ui/llms as the documentation site framework.

  • updated the documentation site dependencies as needed by the Fumadocs feature
  • setup the routing for raw markdown txt
  • add the components for the copy markdown and link to chat services. NOTE: the api references only have copy markdown as the docs are generated from the Gill package and not available as github .mdx file
  • add full doc as llms-full.txt as in https://fumadocs.dev/docs/ui/llms#llms-fulltxt
  • removed /lib from the docs project prettier ignore as the files are not formatted

Behind the scene

The way the feature is done is by leveraging Fumadocs' engine to generate .md route for each of the page on build time e.g: https://www.gillsdk.com/docs/guides/codama will be accompanied by an API route https://www.gillsdk.com/docs/guides/codama.mdx. This is a raw text of the parsed document that is LLM friendly.

Fumadocs also gave a way of doing https://www.gillsdk.com/llms-full.txt which generate complete raw documentation page in a single page/request to let LLMS have the full context of what is gill about.

With these ways of building and serving pages for LLM usage there are few concerns:

  • I'm not sure about the hosting situation of the documentation site, the static pages generation would make the build time longer, should be fine if it is on Vercel but not sure if on other hosting
  • If gill docs became popular for AI/LLM the pages can be hit much more, maybe this would be a good thing but might be not, might be able to be solve with more fine grained caching system if we get there(?)

On the other hand these concerns might not be worth worrying about, as static pages are lightweight and require minimal resources.

Screenshots

copy markdown button and chat links on docs image
copy markdown button on api reference image
mobile view image

Fixes #

#235

@changeset-bot
Copy link

changeset-bot bot commented Sep 3, 2025

⚠️ No Changeset found

Latest commit: 580dd6f

Merging this PR will not cause a version bump for any packages. If these changes should not result in a new version, you're good to go. If these changes should result in a version bump, you need to add a changeset.

This PR includes no changesets

When changesets are added to this PR, you'll see the packages that this PR includes changesets for and the associated semver types

Click here to learn what changesets are, and how to add one.

Click here if you're a maintainer who wants to add a changeset to this PR

@indralukmana indralukmana marked this pull request as ready for review September 4, 2025 10:14
value: page.data.content,
});

// note: it doesn't escape frontmatter, it's up to you.
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

can you remove this comment? feels ai

Copy link
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

yes, I copied that from fumadocs's codeblock in the past, will clean that.

@indralukmana
Copy link
Author

Also some additional notes:

  • Fumadocs have "Ask AI" feature but would need to integrate with AI API Key, might worth exploring in the future.
  • Fumadocs recently had major release (https://fumadocs.dev/blog/v16) but it would need to upgrade the base React and Next.js version, not sure if that would impact anything e.g: generated API docs. This PR propose the Fumadocs update to the minor version that allow for the raw markdown text generation/serving.

@catmcgee @tobeycodes

@catmcgee
Copy link
Collaborator

LGTM - just need to update our vercel config to run actions on forks

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants