-
-
Notifications
You must be signed in to change notification settings - Fork 200
docs: Add wrap vs eject guides for customizing Rspress theme #2906
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Conversation
✅ Deploy Preview for rspress-v2 ready!
To edit notification comments on pull requests, go to your Netlify project configuration. |
|
|
Co-authored-by: SoonIter <[email protected]>
|
@copilot 参考文档不是让用户参考,是让你参考,结合一下参考文档的内容编写该文档 你先介绍一下 theme/index.tsx 重导出可覆盖 rspress 引用时的内置组件 再介绍一下在这个能力基础上可以有两种用法,wrap 和 eject |
Co-authored-by: SoonIter <[email protected]>
Rsdoctor Bundle Diff AnalysisFound 3 projects in monorepo, 3 projects with changes. 📊 Quick Summary
📋 Detailed Reports (Click to expand)📁 nodePath:
📦 Download Diff Report: node Bundle Diff 📁 node_mdPath:
📦 Download Diff Report: node_md Bundle Diff 📁 webPath:
📦 Download Diff Report: web Bundle Diff Generated by Rsdoctor GitHub Action |
|
@copilot 标题改为 “用 wrap 和 eject 定制主题”,同时翻译英文文档 |
|
@copilot 文风更小白一些,可使用自定义主题的部分内容 |
Co-authored-by: SoonIter <[email protected]>
Co-authored-by: SoonIter <[email protected]>
There was a problem hiding this 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 beginner-friendly documentation for customizing Rspress themes using wrap and eject approaches. The new guides simplify and clarify the two main customization paths available through theme/index.tsx re-exports.
Key changes:
- New documentation page explaining wrap (props/slots without source modifications) vs eject (copying and directly editing source code)
- Clear guidance on when to use each approach, with wrap recommended as the safer default option
- Added to both Chinese and English documentation under
guide/basic/
Reviewed changes
Copilot reviewed 4 out of 4 changed files in this pull request and generated 1 comment.
| File | Description |
|---|---|
website/docs/zh/guide/basic/wrap-and-eject.mdx |
New Chinese documentation explaining theme customization via wrap and eject approaches |
website/docs/en/guide/basic/wrap-and-eject.mdx |
New English documentation explaining theme customization via wrap and eject approaches |
website/docs/zh/guide/basic/_meta.json |
Adds the new wrap-and-eject page to Chinese navigation |
website/docs/en/guide/basic/_meta.json |
Adds the new wrap-and-eject page to English navigation |
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
| Wrap means extending the re-exported components with extra props, e.g., using `Layout` slots: | ||
|
|
||
| - No source edits: just wrap in `theme/index.tsx` and pass props/slots to built-ins. | ||
| - Great for light tweaks: style nits, slot content, or swapping a few same-name components. |
Copilot
AI
Dec 23, 2025
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
The word "nits" is typically used in code review context to mean "minor issues" or "nitpicks", but here it should be "tweaks" or "adjustments" to match the intended meaning of making small style modifications. The Chinese version uses "微调" which means "fine-tuning" or "minor adjustments".
| - Great for light tweaks: style nits, slot content, or swapping a few same-name components. | |
| - Great for light tweaks: style tweaks, slot content, or swapping a few same-name components. |
Original prompt
💬 We'd love your input! Share your thoughts on Copilot coding agent in our 2 minute survey.