feat(docs): add copy-to-llm button for easy AI tool integration - #2541
Conversation
Add mkdocs-copy-to-llm plugin to documentation pages, enabling users to easily copy page content for use with AI coding tools like ChatGPT, Claude, and Cursor. - Add mkdocs-copy-to-llm dependency to docs group - Configure plugin with repo URL and button options - Add dark mode styling for the copy button to match Material theme - Disable broken link features until upstream plugin fix (issue vibrantlabsai#24)
anistark
left a comment
There was a problem hiding this comment.
It might be due to my browser cache. But the copy button only appears when I refresh page. And not when navigating.
Maybe test it out more and confirm.
Looks good overall.
| /* Copy to LLM button - dark mode styling */ | ||
| [data-md-color-scheme="slate"] .copy-to-llm-split-container { | ||
| --mystic: #404040; | ||
| --white: #2d2d2d; |
There was a problem hiding this comment.
Lets follow the same styling convention of dark/light. white/black will be confusing.
|
Regarding the copy button not appearing on navigation (only on refresh): This is a known issue with the PR: leonardocustodio/mkdocs-copy-to-llm#25 Root cause: The plugin was using Fix: Subscribe to Material's Once merged and released, updating the plugin version should resolve the issue. |
Rename confusing color-based variable names to semantic names that describe their purpose: - --white → --copy-llm-surface (background color) - --black → --copy-llm-text (text/foreground color) - --mystic → --copy-llm-border (border color) - --athens-gray → --copy-llm-hover-overlay (hover effect) Also refactored to actually use the CSS variables instead of hardcoding the same hex values repeatedly.
Keep both plugins: - copy-to-llm: adds "Copy page" button for easy LLM tool integration - llmstxt: generates llms.txt file for LLM-friendly documentation Both plugins serve complementary purposes.
Sounds good. Can you please open an issue to track the PR and next release to update the version ? We can merge this and track rest on the issue. |
Summary
mkdocs-copy-to-llmplugin to documentation pagesChanges
mkdocs-copy-to-llmto docs dependency groupNotes
copy_markdown_link,view_as_markdown) are temporarily disabled due to an upstream plugin bug: Incorrect raw markdown URL for non-index.md files leonardocustodio/mkdocs-copy-to-llm#24Test plan
make serve-docsand verify the "Copy page" button appears on doc pages