Skip to content

Conversation

@bgravenorst
Copy link
Contributor

@bgravenorst bgravenorst commented Nov 3, 2025

Description

Add copy page button to Main product content and tutorial pages.

Preview

Checklist

  • If this PR updates or adds documentation content that changes or adds technical meaning, it has received an approval from an engineer or DevRel from the relevant team.
  • If this PR updates or adds documentation content, it has received an approval from a technical writer.

Note

Adds a dropdown "Copy page" button that builds page Markdown to copy or view, integrated into docs (next to H1) and tutorials, with supporting styles and wrapper.

  • UI/Feature:
    • src/components/CopyPageButton: New component with dropdown actions to copy page as Markdown or open a Markdown preview; includes DOM-to-Markdown builder (handles headings, lists, code blocks, blockquotes, tables), outside-click close, and mobile alignment.
    • CopyPageButton.module.css: Styles for button, dropdown, and H1 wrapper; hides button on small screens.
    • DocH1CopyPageWrapper: Positions the button alongside article h1 on docs by wrapping the H1.
  • Integration:
    • Docs: Injects DocH1CopyPageWrapper and CopyPageButton into src/theme/DocItem/Layout/index.jsx.
    • Tutorials: Adds CopyPageButton to src/theme/MDXPage/index.tsx with .copyButtonWrapper.
    • Styling tweaks: Updates src/theme/MDXPage/styles.module.css (overflow/margins) and adds .copyButtonWrapper layout.

Written by Cursor Bugbot for commit aee8759. This will update automatically on new commits. Configure here.

@vercel
Copy link

vercel bot commented Nov 3, 2025

The latest updates on your projects. Learn more about Vercel for GitHub.

Project Deployment Preview Comments Updated (UTC)
metamask-docs Ready Ready Preview Comment Nov 3, 2025 10:17pm

Signed-off-by: bgravenorst <[email protected]>
Signed-off-by: bgravenorst <[email protected]>
Signed-off-by: bgravenorst <[email protected]>
@socket-security
Copy link

socket-security bot commented Nov 3, 2025

No dependency changes detected. Learn more about Socket for GitHub.

👍 No dependency changes detected in pull request

@bgravenorst bgravenorst marked this pull request as ready for review November 3, 2025 21:24
@bgravenorst bgravenorst requested review from a team as code owners November 3, 2025 21:24
cursor[bot]

This comment was marked as outdated.

cursor[bot]

This comment was marked as outdated.

@bgravenorst bgravenorst merged commit bff6326 into main Nov 3, 2025
15 checks passed
@bgravenorst bgravenorst deleted the add-copy-button branch November 3, 2025 22:28
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