Skip to content

Provide entire docs in a single text file for LLMs. #962

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

Merged
merged 6 commits into from
Jan 20, 2025

Conversation

lucasguellis
Copy link
Contributor

@lucasguellis lucasguellis commented Jan 20, 2025

Solves #958

This PR introduces support for the LLM-ready website standard to improve how language models (LLMs) access and suggest information about ReScript code.

The following files are now generated via a script, for both ReScript language and ReScript React package:

  • llm-full.txt: Contains the full documentation, including all markdown files from pages/docs/manual and pages/docs/react, along with examples.
  • llm-small.txt: A compressed version of llms-full.txt, excluding examples, to provide a more concise reference.
  • llms.txt: Provides metadata to inform LLMs about the available files for reference.

As an example of implementation, this aligns with the approach used by the Svelte documentation.

The script runs on build with the existing update-index script, but can be used alone with:

npm run generate-llms

The files are generated separately for each documentation version, ensuring LLMs can reference version-specific information, so the final files should look like this:

image

Also, the llm.mdx file is generated by the script for each version separately, as the links to the files depends on the version number. This automation ensures the links are always accurate and eliminates the need for manual updates with each new release.

image

Copy link

vercel bot commented Jan 20, 2025

@lucasguellis is attempting to deploy a commit to the ReScript Association Team on Vercel.

A member of the Team first needs to authorize it.

Copy link
Member

@fhammerschmidt fhammerschmidt left a comment

Choose a reason for hiding this comment

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

Great work! Let's merge this and see whether it improves the LLM's knowledge of ReScript in the future.

Thank you very much!

@fhammerschmidt fhammerschmidt merged commit 27eedd3 into rescript-lang:master Jan 20, 2025
1 of 2 checks passed
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