Generate llms.txt, llms-full.txt and Markdown twins of every docs page (OPTIP-478) - #838
Open
devin-ai-integration[bot] wants to merge 4 commits into
Open
Generate llms.txt, llms-full.txt and Markdown twins of every docs page (OPTIP-478)#838devin-ai-integration[bot] wants to merge 4 commits into
devin-ai-integration[bot] wants to merge 4 commits into
Conversation
Co-Authored-By: Devin AI <158243242+devin-ai-integration[bot]@users.noreply.github.com>
Runs after the static build and converts the rendered HTML to Markdown, so shared partials, generated OpenAPI pages and versioned docs are handled uniformly. Output per product (/<product>/llms.txt, /<product>/llms-full.txt) plus a root /llms.txt index and /llms-full.txt. Unmaintained Player versions (v4-v9), /contributing and /search are excluded. Co-Authored-By: Devin AI <158243242+devin-ai-integration[bot]@users.noreply.github.com>
Contributor
Author
🤖 Devin AI EngineerI'll be helping with this pull request! Here's what you should know: ✅ I will automatically:
Note: I can only respond to comments from users who have write access to this repository. ⚙️ Control Options:
|
Contributor
|
Descriptions come from each page's meta description, which for pages without front matter is a Docusaurus excerpt: drop headings, markup fragments and title repeats, and cap the rest at ~200 characters on a sentence boundary. Sections in the product indexes are now Overview first, alphabetical, with older versions last. Co-Authored-By: Devin AI <158243242+devin-ai-integration[bot]@users.noreply.github.com>
Preview builds kept the production origin with the /pr-<number>/ base URL, so every absolute URL the build emits (canonical, og:url, llms.txt and Markdown links) pointed at optiview.dolby.com/pr-<number>/..., which does not exist. Pass the preview CloudFront origin to the build as DOCUSAURUS_URL so those links resolve on the preview host. Production builds are unchanged. Co-Authored-By: Devin AI <158243242+devin-ai-integration[bot]@users.noreply.github.com>
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
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
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.
Summary
Makes the built site consumable by AI tools (ChatGPT, Claude, Cursor, Copilot, …), which today only get rendered HTML and
sitemap.xml. The build now also emits:/docs/llms.txtllms.txt/llms-full.txt(~5 KB)/docs/llms-full.txt/docs/<product>/llms.txt/docs/<product>/llms-full.txt/docs/<route>.md/docs/theoplayer/how-to-guides/web/ads/google-ima.mdProducts:
theoplayer,open-video-ui,theolive,millicast,ads,ad-engine. Excluded: Player v4–v9,/contributing,/search, 404. Kept: Player v10, Ads v1, THEOlive v1.How
Markdown is generated from the rendered HTML (not the MDX source) by
@signalwire/docusaurus-plugin-llms-txt, so shared partials,usePlatforms()card lists, generated OpenAPI pages and versioned docs are all handled uniformly. Two local pieces around it:src/plugin/llmsTxt.tswraps the SignalWire plugin and, in the samepostBuild, re-groups its output into the per-product files above (Docusaurus runs pluginpostBuildhooks in parallel, so a separate plugin could not rely on the.mdfiles existing yet). It fails the build if a top-level route has noproductsentry configured. Descriptions come from each page's<meta name="description">; heading/markup fragments and title repeats are dropped, long ones are cut at ~200 chars.src/plugin/llmsTxtMarkdown.tscleans up Docusaurus HTML before conversion: Prism token spans → fenced code with language, admonitions → blockquote with bold title, tabs (incl. OpenAPI response tabs) → label + panel in order, strips#hash-links and comments; and fixes the plugin's/docs/docs/duplicated base URL and/route/.mdlink shape.Preview builds use the preview origin
All links in
llms.txt/.mdare absolute (siteConfig.url + baseUrl). Preview builds only changedbaseUrlto/pr-<n>/, so every absolute URL the build emits (canonical,og:url, and now the llms.txt links) pointed atoptiview.dolby.com/pr-<n>/…, which does not exist. The pull-request workflow now passes the preview CloudFront origin to the build:main.ymldoes not set it, so production output is unchanged (https://optiview.dolby.com/docs/…).Verification
npm run build(prod): 1,714 pages, all internal.mdlinks resolve, no v4–v9 / contributing / search / pr-N / announcement-bar text in any output; build time unchanged (3m53–4m27 vs 4m24 baseline).DOCUSAURUS_URL=https://docs-preview.optiview.dolby.com DOCUSAURUS_BASE_URL=/pr-838/ DOCUSAURUS_PR_NUMBER=838 npm run build: all 8,007 generated absolute links usedocs-preview.optiview.dolby.com/pr-838/, canonical too; preview banner absent from.md.node serve.js:llms*.txt→text/plain,.md→text/markdown, HTML untouched. Deploy is the existingaws s3 sync(content type inferred from extension) — no deploy changes.npm run lint,npm run typecheck,npm run check-formatpass;actionlintreports nothing new on the touched workflow lines.Known limitation
OpenAPI reference pages are client-rendered, so their
.mdcontains only the summary and response codes (parameters/schemas are not in the static HTML). Follow-up tickets are raised.Link to Devin session: https://dolby.devinenterprise.com/sessions/ca62555ae6ad43d9b7be6ecdc256e68e
Open in Devin Desktop: https://dolby.devinenterprise.com/desktop/session/ca62555ae6ad43d9b7be6ecdc256e68e?variant=devin