Skip to content

Add llms.txt with Mapbox/MapLibre split - #2593

Open
tordans wants to merge 2 commits into
visgl:masterfrom
tordans:llm-txt
Open

Add llms.txt with Mapbox/MapLibre split#2593
tordans wants to merge 2 commits into
visgl:masterfrom
tordans:llm-txt

Conversation

@tordans

@tordans tordans commented May 30, 2026

Copy link
Copy Markdown
Contributor

Summary

  • Adds docusaurus-plugin-llms to generate LLM-friendly documentation during the website build
  • Splits output by base map library so agents do not load duplicate API reference:
    • llms.txt — lightweight router pointing to stack-specific bundles
    • llms-mapbox.txt / llms-maplibre.txt — link indexes (shared guides + stack API + examples)
    • llms-mapbox-full.txt / llms-maplibre-full.txt — full markdown content per stack
  • Disables monolithic llms-full.txt (~3700 lines of near-duplicate Mapbox/MapLibre API pages)
  • Post-build script appends example links with technique blurbs sourced from examples/{stack}/{name}/README.md

After deploy, files will be available at:

Preview

# react-map-gl

> React components for Mapbox GL JS and MapLibre GL JS

Choose the documentation bundle for your base map library:

- [Mapbox GL JS index](https://visgl.github.io/react-map-gl/llms-mapbox.txt) (full content: [llms-mapbox-full.txt](https://visgl.github.io/react-map-gl/llms-mapbox-full.txt))
- [MapLibre GL JS index](https://visgl.github.io/react-map-gl/llms-maplibre.txt) (full content: [llms-maplibre-full.txt](https://visgl.github.io/react-map-gl/llms-maplibre-full.txt))

Only load one stack's files — API reference pages are parallel but not interchangeable.

## Table of Contents

- [Introduction](https://visgl.github.io/react-map-gl/docs): > These docs are for v8.0. For v7, see [here](https://github.com/visgl/react-map-gl/tree/7.1-release/docs).
- [What's new](https://visgl.github.io/react-map-gl/docs/whats-new.md): Release date: Oct 2025
- [Upgrade Guide](https://visgl.github.io/react-map-gl/docs/upgrade-guide.md): - All imports from `react-map-gl` should be replaced with one of the following endpoints:
- [Contributing](https://visgl.github.io/react-map-gl/docs/contributing.md): **Thanks for taking the time to contribute!**
- [Adding Custom Data](https://visgl.github.io/react-map-gl/docs/get-started/adding-custom-data.md): You can inject data and mapbox native layers using the [Source](../api-reference/mapbox/source.md) and [Layer](../api-reference/mapbox/layer.md) co...
- [Get Started](https://visgl.github.io/react-map-gl/docs/get-started.md): You may find complete project setups in [get-started examples](https://github.com/visgl/react-map-gl/tree/8.0-release/examples/get-started).
- [About Mapbox Tokens](https://visgl.github.io/react-map-gl/docs/get-started/mapbox-tokens.md): `react-map-gl` itself is open source and free. It provides a React wrapper for `mapbox-gl`, `maplibre-gl` or compatible projects.
- [State Management](https://visgl.github.io/react-map-gl/docs/get-started/state-management.md): There are two ways to use a [Map](../api-reference/maplibre/map.md):
- [Tips and Tricks](https://visgl.github.io/react-map-gl/docs/get-started/tips-and-tricks.md): Because Mapbox tokens are required for the client application to make requests to Mapbox servers, you have to distribute it with your app. It is no...

Preview

# react-map-gl (MapLibre GL JS)

> Docs for react-map-gl with MapLibre GL JS

This file contains links to documentation sections following the llmstxt.org standard.

## Table of Contents

- [Introduction](https://visgl.github.io/react-map-gl/docs): > These docs are for v8.0. For v7, see [here](https://github.com/visgl/react-map-gl/tree/7.1-release/docs).
- [What's new](https://visgl.github.io/react-map-gl/docs/whats-new.md): Release date: Oct 2025
- [Upgrade Guide](https://visgl.github.io/react-map-gl/docs/upgrade-guide.md): - All imports from `react-map-gl` should be replaced with one of the following endpoints:
- [Contributing](https://visgl.github.io/react-map-gl/docs/contributing.md): **Thanks for taking the time to contribute!**
- [Adding Custom Data](https://visgl.github.io/react-map-gl/docs/get-started/adding-custom-data.md): You can inject data and mapbox native layers using the [Source](../api-reference/mapbox/source.md) and [Layer](../api-reference/mapbox/layer.md) co...
- [Get Started](https://visgl.github.io/react-map-gl/docs/get-started.md): You may find complete project setups in [get-started examples](https://github.com/visgl/react-map-gl/tree/8.0-release/examples/get-started).
- [About Mapbox Tokens](https://visgl.github.io/react-map-gl/docs/get-started/mapbox-tokens.md): `react-map-gl` itself is open source and free. It provides a React wrapper for `mapbox-gl`, `maplibre-gl` or compatible projects.
- [State Management](https://visgl.github.io/react-map-gl/docs/get-started/state-management.md): There are two ways to use a [Map](../api-reference/maplibre/map.md):
- [Tips and Tricks](https://visgl.github.io/react-map-gl/docs/get-started/tips-and-tricks.md): Because Mapbox tokens are required for the client application to make requests to Mapbox servers, you have to distribute it with your app. It is no...
- [AttributionControl](https://visgl.github.io/react-map-gl/docs/api-reference/maplibre/attribution-control.md): AttributionControl
- [FullscreenControl](https://visgl.github.io/react-map-gl/docs/api-reference/maplibre/fullscreen-control.md): FullscreenControl
- [GeolocateControl](https://visgl.github.io/react-map-gl/docs/api-reference/maplibre/geolocate-control.md): GeolocateControl
- [GlobeControl](https://visgl.github.io/react-map-gl/docs/api-reference/maplibre/globe-control.md): React component that wraps maplibre-gl's [GlobeControl](https://maplibre.org/maplibre-gl-js/docs/API/classes/GlobeControl/) class.
- [Layer](https://visgl.github.io/react-map-gl/docs/api-reference/maplibre/layer.md): Layer
- [LogoControl](https://visgl.github.io/react-map-gl/docs/api-reference/maplibre/logo-control.md): LogoControl
- [MapProvider](https://visgl.github.io/react-map-gl/docs/api-reference/maplibre/map-provider.md): A [Context.Provider](https://reactjs.org/docs/context.html#contextprovider) that facilitates map operations outside of the component that directly ...
- [default (Map)](https://visgl.github.io/react-map-gl/docs/api-reference/maplibre/map.md): default (Map)
- [Marker](https://visgl.github.io/react-map-gl/docs/api-reference/maplibre/marker.md): Marker
- [NavigationControl](https://visgl.github.io/react-map-gl/docs/api-reference/maplibre/navigation-control.md): NavigationControl
- [Popup](https://visgl.github.io/react-map-gl/docs/api-reference/maplibre/popup.md): Popup
- [ScaleControl](https://visgl.github.io/react-map-gl/docs/api-reference/maplibre/scale-control.md): ScaleControl
- [Source](https://visgl.github.io/react-map-gl/docs/api-reference/maplibre/source.md): Source
- [TerrainControl](https://visgl.github.io/react-map-gl/docs/api-reference/maplibre/terrain-control.md): TerrainControl
- [Types](https://visgl.github.io/react-map-gl/docs/api-reference/maplibre/types.md): Types
- [useControl](https://visgl.github.io/react-map-gl/docs/api-reference/maplibre/use-control.md): The `useControl` hook is used to create React wrappers for custom map controls.
- [useMap](https://visgl.github.io/react-map-gl/docs/api-reference/maplibre/use-map.md): The `useMap` hook allows a custom component to reference the [Map](./map.md) that contains it.

## Examples

- [Clusters](https://visgl.github.io/react-map-gl/examples/maplibre/clusters): visualize points as clusters
- [Markers, Popups and Controls](https://visgl.github.io/react-map-gl/examples/maplibre/controls)
- [Custom Cursor](https://visgl.github.io/react-map-gl/examples/maplibre/custom-cursor): dynamically change the cursor over the map based on interactivity
- [Draggable Marker](https://visgl.github.io/react-map-gl/examples/maplibre/draggable-markers)
- [Draw Polygon](https://visgl.github.io/react-map-gl/examples/maplibre/draw-polygon)
- [Highlight By Filter](https://visgl.github.io/react-map-gl/examples/maplibre/filter): dynamically add/remove filters from layers
- [Geocoder](https://visgl.github.io/react-map-gl/examples/maplibre/geocoder)
- [GeoJSON Animation](https://visgl.github.io/react-map-gl/examples/maplibre/geojson-animation): dynamically add and update custom data sources
- [GeoJSON](https://visgl.github.io/react-map-gl/examples/maplibre/geojson): dynamically add and update custom data sources
- [Heatmap](https://visgl.github.io/react-map-gl/examples/maplibre/heatmap)
- [Limit Map Interaction](https://visgl.github.io/react-map-gl/examples/maplibre/interaction): toggle/limit user interaction
- [Dynamic Styling](https://visgl.github.io/react-map-gl/examples/maplibre/layers): dynamically change layer styles and show/hide layers
- [Side by Side](https://visgl.github.io/react-map-gl/examples/maplibre/side-by-side)
- [Terrain](https://visgl.github.io/react-map-gl/examples/maplibre/terrain)
- [Camera Transition](https://visgl.github.io/react-map-gl/examples/maplibre/viewport-animation): transition smoothly between one viewport to another
- [Zoom to Bounds](https://visgl.github.io/react-map-gl/examples/maplibre/zoom-to-bounds)


Test plan

  • cd website && yarn build succeeds
  • website/build/llms.txt is a router with no Mapbox/MapLibre API pages
  • llms-mapbox.txt contains Mapbox API + 16 examples with blurbs; no api-reference/maplibre links
  • llms-maplibre.txt contains MapLibre API + 16 examples; no api-reference/mapbox links
  • No llms-full.txt generated
  • Verify live URLs after gh-pages deploy on next *-release branch push

Made with Cursor

@tordans
tordans force-pushed the llm-txt branch 2 times, most recently from a398492 to 1c01abd Compare May 30, 2026 05:40
Generate stack-specific LLM documentation files so agents load only the
relevant API reference, plus a root router and example links with technique
blurbs from example READMEs.

Co-Authored-By: Cursor <cursoragent@cursor.com>

@cursor cursor Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

Cursor Bugbot has reviewed your changes and found 1 potential issue.

Fix All in Cursor

Reviewed by Cursor Bugbot for commit 13514f5. Configure here.

docsDir: [{path: '../docs', routeBasePath: 'docs', label: 'Docs'}],
generateLLMsTxt: false,
generateLLMsFullTxt: false,
generateMarkdownFiles: false,

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

Index links point to missing markdown

Medium Severity

generateMarkdownFiles is set to false, but docusaurus-plugin-llms v0.4.0 still appends .md to doc links in the generated index files. Those URLs do not exist in the static build (live pages are HTML paths without .md), so agents following llms.txt / llms-mapbox.txt / llms-maplibre.txt links get 404s unless they only use the full-content bundles.

Fix in Cursor Fix in Web

Reviewed by Cursor Bugbot for commit 13514f5. Configure here.

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

This seems to be true - the index links end in .md, while the deployed Docusaurus routes generally do not.

@chrisgervang

Copy link
Copy Markdown
Contributor

Thank you for this contribution! How do libraries handle pointing LLMs to the correct version of their docs? We have a pattern of maintaining release branches for each version with complete docs (e.g. https://github.com/visgl/react-map-gl/tree/7.1-release/docs)

@chrisgervang chrisgervang self-assigned this Jul 28, 2026
@tordans

tordans commented Jul 28, 2026

Copy link
Copy Markdown
Contributor Author

How do libraries handle pointing LLMs to the correct version of their docs? We have a pattern of maintaining release branches for each version with complete docs (e.g. https://github.com/visgl/react-map-gl/tree/7.1-release/docs)

I am not aware of a lot of standardization in this space, yet. I think it would be fine to have this kind of feature only for the pages that are generated to the website. AFAIK older release docs are not generated but only accessible via Github?

NextJS recently made it that each page has a ".md" version
https://nextjs.org/docs/app/guides/ai-agents => https://nextjs.org/docs/app/guides/ai-agents.md
And also older docs
https://nextjs.org/docs/13/app/building-your-application => https://nextjs.org/docs/13/app/building-your-application.md


Site note: I am now using https://github.com/FixMyBerlin/fixmyskills/tree/main/skills/react-map-gl to work with react map gl and LLM which I find give better results because it is more tailored to errors the LLM does which are not covered by the docs directly. Maybe someone can use this and set up https://tanstack.com/intent/latest to have the LLM support (entry) as part of the package.

@chrisgervang

Copy link
Copy Markdown
Contributor

A clean build still puts opposite-stack API links in the stack-specific indexes: llms-mapbox.txt links to api-reference/maplibre/map.md, while llms-maplibre.txt links to Mapbox Source and Layer. Could we add automated assertions for both index and full outputs?

@chrisgervang

Copy link
Copy Markdown
Contributor

Thanks for sharing these ideas! I'm open to publishing old versions of the docs in a more formal way.. One complication is that a lot of pages include interactive demos, which I suspect will lead to some odd compatibility issues. Oh course, not an issue for markdown files

https://nextjs.org/docs/13/app/building-your-application.md

FYI this URL returns a special 404.

@chrisgervang

Copy link
Copy Markdown
Contributor

Hey @tordans, latest-only support for the website sounds reasonable for this PR, provided the generated files identify the current release and all links are validated.

The FixMyBerlin skill contains useful lessons, though we would need to extract the library-generic guidance from the project-specific conventions. I think that deserves a separate issue to explore bundled docs or an official versioned skill, potentially using Intent.

@tordans

tordans commented Jul 29, 2026

Copy link
Copy Markdown
Contributor Author

The FixMyBerlin skill contains useful lessons, though we would need to extract the library-generic guidance from the project-specific conventions. I think that deserves a separate issue to explore bundled docs or an official versioned skill, potentially using Intent.

I created #2603 to track this.

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

Labels

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants