Add md-react-preview for doc preview#250
Open
IzumiSy wants to merge 1 commit into
Open
Conversation
f8ebf4e to
a1a0882
Compare
commit: |
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
Integrate md-react-preview (
@izumisy/md-react-preview@^0.2.0) to provide live interactive previews for component documentation pages.Background
AppShell's component catalog is managed and published as unified documentation on
docs.tailor.tech. The data source fordocs.tailor.techis the Markdown files under thedocs/directory in this repository, which are synced to VitePress for rendering.We also want to provide Storybook-like live component previews on
docs.tailor.tech. However, since the documentation is authored in the AppShell repository but served from a separate site (docs.tailor.tech), we needed a streamlined process to deliver a consistent preview experience across both environments.To solve this, we built md-react-preview (mrp). mrp provides both a Vite plugin and a VitePress plugin that share the same preview rendering core, enabling:
pnpm docs:previewto preview documentation locallyThis allows documentation authors to simply write preview code in Markdown and get identical results both locally and in production.
Changes
@izumisy/md-react-preview(^0.2.0) and@tailwindcss/viteas dev dependenciesmrp.config.ts— configures md-react-preview to scandocs/components/**/*.mdwith AppShell's CSSdocs:previewscript — runsmrp devto start the documentation preview serverdocs/components/*.md) to use the new preview block syntax:export default (...)instead of bare JSX /;-prefixed expressions<>...</>fragmentsHow to test