Add "Copy page" dropdown and Markdown alternate link - #856
Merged
Merged
Conversation
Co-Authored-By: Mattias Buelens <mattias.buelens@dolby.com>
Co-Authored-By: Mattias Buelens <mattias.buelens@dolby.com>
Contributor
🤖 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:
|
MattiasBuelens
temporarily deployed
to
preview
September 10, 2026 10:08 — with
GitHub Actions
Inactive
This comment has been minimized.
This comment has been minimized.
Co-Authored-By: Mattias Buelens <mattias.buelens@dolby.com>
Co-Authored-By: Mattias Buelens <mattias.buelens@dolby.com>
MattiasBuelens
commented
Sep 10, 2026
Co-Authored-By: Mattias Buelens <mattias.buelens@dolby.com>
Danesz
approved these changes
Sep 10, 2026
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
Adds a "Copy page" dropdown (top right of the breadcrumbs row) on every docs page that gets a companion
.mdfile from thellmsTxtplugin, plus a<link rel="alternate" type="text/markdown">in the<head>. Resolves OPTIP-479.Which pages get it. The
llmsTxtplugin wrapper now publishes itsexcludeRoutesglobs as plugin global data, compiled with the samemicromatch.makeRethe upstream plugin uses:A client hook
useMarkdownUrl()(src/plugin/llmsTxtClient.ts) tests the current pathname against that regex and returns${siteUrl}${pathname without trailing slash}.md, orundefinedfor excluded routes (old THEOplayer versions, contributing, search, 404). So the UI and the generated files stay in sync from a single config.UI.
CopyPageDropdown(react-aria-componentsMenuTrigger/Menu/Popover) takesmarkdownUrlas a prop:MenuItem href target="_blank"fetch(markdownUrl)thennavigator.clipboard.writeText, button shows "Copied" for 2sEach item has a
titletooltip with a longer description.MenuItemdoes not forwardtitleto the DOM, so it is set on an inner<span>.It is rendered from the swizzled
DocBreadcrumbs, which also covers OpenAPI pages (their layout renders@theme/DocBreadcrumbs).DocBreadcrumbsnow renders when either breadcrumbs or a Markdown URL exist, and emits the<Head>alternate link.Note: the
.mdfiles are only produced by the post-build step, so the links 404 onnpm start. That is expected; they work on a built site.Link to Devin session: https://dolby.devinenterprise.com/sessions/d14704b107234c32af5b8625eff5474a
Open in Devin Desktop: https://dolby.devinenterprise.com/desktop/session/d14704b107234c32af5b8625eff5474a?variant=devin
Requested by: @MattiasBuelens