Skip to content

Copy button and markdown docs feature#612

Merged
georgephillips merged 12 commits intomainfrom
markdown-docs
Apr 2, 2026
Merged

Copy button and markdown docs feature#612
georgephillips merged 12 commits intomainfrom
markdown-docs

Conversation

@georgephillips
Copy link
Copy Markdown
Contributor

This pull request introduces a standardized toMarkdown export for many UI components, enabling each to serialize itself into Markdown format. This provides a foundation for rendering or exporting documentation content as clean Markdown, and ensures consistent Markdown output across various custom components. The changes also include the addition of a new CopyPageDropdown component, which allows users to copy the current page as Markdown, URL, or a prompt-ready format for LLMs.

Markdown serialization support for components:

  • Added toMarkdown functions to most components in the _components directory, each returning a Markdown representation of the component's content or an empty string if not applicable. This includes components such as Annotation, CodeBlock, CodeTab, CommonParam, DataReference, DataReferenceRow, DocShot, DocsImage, DocsVideo, Example, GlossaryTerm, GuideGrid, ImageWrapper, InteractiveTree, and LanguageIcon. [1] [2] [3] [4] [5] [6] [7] [8] [9] [10] [11] [12] [13] [14] [15]

  • Updated MultiCodeBlock.tsx to re-export the toMarkdown function from CodeBlock.tsx for consistency and backward compatibility.

New feature: CopyPageDropdown component

  • Introduced a new CopyPageDropdown component, which provides a UI for copying the current page as Markdown, as a URL, or as a context-wrapped prompt for LLMs. The component fetches the Markdown source of the page and supports user feedback via a toast notification.

Minor type and prop improvements:

  • Fixed the GlossaryTermProps type to allow children to be of type unknown, aligning with the usage in other components.

Comment thread _components/CodeBlock.tsx Outdated
Comment thread _includes/styles/copy-page.scss Outdated
Comment thread _includes/styles/copy-page.scss Outdated
Comment thread _includes/styles/copy-page.scss Outdated
georgephillips and others added 3 commits April 2, 2026 13:46
Co-authored-by: Ross Phillips <12723297+rphillips-cc@users.noreply.github.com>
Co-authored-by: Ross Phillips <12723297+rphillips-cc@users.noreply.github.com>
Co-authored-by: Ross Phillips <12723297+rphillips-cc@users.noreply.github.com>
@georgephillips georgephillips merged commit 76c850e into main Apr 2, 2026
2 checks passed
@georgephillips georgephillips deleted the markdown-docs branch April 2, 2026 00:48
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.

3 participants