Skip to content

Conversation

@yslpn
Copy link
Contributor

@yslpn yslpn commented Nov 11, 2025

Summary

  • Add “View as Markdown” button next to the GitHub icon.
  • Compute mdPath from the current URL via useComputed$; hide on /api/.
  • Cleanup MarkdownIcon: viewBox 48×48, remove extra wrappers/ids, inherit color via currentColor.

Why

  • Manually tweaking the URL to get the .md view is inconvenient; this button makes it one click to copy/share with an LLM agent.
  • Improves discoverability: many users don't know the Markdown view exists; placing the button next to GitHub surfaces the feature.

Checks

  • Visual: button shows on docs pages and is hidden on /api/.

Copilot AI review requested due to automatic review settings November 11, 2025 19:12
@vercel
Copy link

vercel bot commented Nov 11, 2025

@yslpn is attempting to deploy a commit to the Valibot Team on Vercel.

A member of the Team first needs to authorize it.

@dosubot dosubot bot added size:M This PR changes 30-99 lines, ignoring generated files. enhancement New feature or request labels Nov 11, 2025
Copilot finished reviewing on behalf of yslpn November 11, 2025 19:13
Copy link
Contributor

Copilot AI left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull Request Overview

This PR adds a "View as Markdown" button to documentation pages, positioned next to the existing GitHub source code link. The button provides quick access to the raw Markdown version of documentation pages.

  • Introduced a new MarkdownIcon component following the existing icon pattern
  • Added computed mdPath logic to hide the button on the /api/ landing page only
  • Passed mdPath through to NavButtons component and rendered conditionally

Reviewed Changes

Copilot reviewed 3 out of 3 changed files in this pull request and generated 1 comment.

File Description
website/src/icons/index.ts Exports the new MarkdownIcon component
website/src/icons/MarkdownIcon.tsx Defines the SVG icon component for markdown with proper accessibility attributes
website/src/components/DocsLayout.tsx Adds mdPath computation and passes it to NavButtons; renders markdown link button conditionally

💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

@pkg-pr-new
Copy link

pkg-pr-new bot commented Nov 21, 2025

Open in StackBlitz

npm i https://pkg.pr.new/valibot@1352

commit: ad8e388

@fabian-hiller
Copy link
Member

Great idea! Thank you for creating this PR!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

enhancement New feature or request size:M This PR changes 30-99 lines, ignoring generated files.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants