-
- Notifications
You must be signed in to change notification settings - Fork 1.3k
docs: enhance code block & code group #2521
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
base: main
Are you sure you want to change the base?
Conversation
✅ Deploy Preview for vue-router ready!
To edit notification comments on pull requests, go to your Netlify project configuration. |
2788482
to 31fb3fa
Compare WalkthroughIntroduces vitepress-plugin-group-icons into the docs: adds markdown and Vite plugins in shared config, imports virtual CSS in the theme, and updates multiple English and Chinese guides to use labeled code fences and file annotations. Adds the dependency in packages/docs/package.json. No runtime logic changes to examples. Changes
Sequence Diagram(s)sequenceDiagram autonumber participant Dev as VitePress (Dev/Build) participant VP as .vitepress/config (shared.ts) participant MD as Markdown Parser participant Vite as Vite participant GI as group-icons Plugin participant Theme as Theme (index.ts) Dev->>VP: Load shared config VP->>MD: markdown.config(md.use(groupIconMdPlugin)) VP->>Vite: vite.plugins += groupIconVitePlugin() Note over MD,GI: New/changed integration: group icon transforms applied Dev->>Theme: Import virtual:group-icons.css Vite->>GI: Initialize plugin hooks MD->>GI: Parse & transform group icon syntax GI-->>MD: Inject processed tokens Theme-->>Dev: Global CSS for icons available Dev-->>Dev: Render docs with annotated code fences and icons Estimated code review effort🎯 2 (Simple) | ⏱️ ~10 minutes Poem
Pre-merge checks and finishing touches✅ Passed checks (3 passed)
✨ Finishing touches
🧪 Generate unit tests (beta)
Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out. Comment |
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.
Actionable comments posted: 0
🧹 Nitpick comments (1)
packages/docs/.vitepress/config/shared.ts (1)
171-173
: LGTM! Vite plugin properly configured.The Vite plugin is correctly added to enable icon resolution and the virtual CSS module export. This is the recommended integration pattern for vitepress-plugin-group-icons.
If you need to support additional custom icons beyond the built-in mappings (for tools/frameworks specific to this project), consider using the
customIcon
option:vite: { plugins: [ groupIconVitePlugin({ customIcon: { // Add custom mappings if needed // example: 'logos:example' } }) ], }Based on learnings
📜 Review details
Configuration used: CodeRabbit UI
Review profile: CHILL
Plan: Pro
⛔ Files ignored due to path filters (1)
pnpm-lock.yaml
is excluded by!**/pnpm-lock.yaml
📒 Files selected for processing (17)
packages/docs/.vitepress/config/shared.ts
(3 hunks)packages/docs/.vitepress/theme/index.ts
(1 hunks)packages/docs/guide/advanced/lazy-loading.md
(1 hunks)packages/docs/guide/advanced/navigation-guards.md
(1 hunks)packages/docs/guide/essentials/history-mode.md
(4 hunks)packages/docs/guide/essentials/named-views.md
(1 hunks)packages/docs/guide/essentials/nested-routes.md
(2 hunks)packages/docs/guide/essentials/passing-props.md
(1 hunks)packages/docs/guide/index.md
(1 hunks)packages/docs/package.json
(1 hunks)packages/docs/zh/guide/advanced/lazy-loading.md
(1 hunks)packages/docs/zh/guide/advanced/navigation-guards.md
(1 hunks)packages/docs/zh/guide/essentials/history-mode.md
(4 hunks)packages/docs/zh/guide/essentials/named-views.md
(1 hunks)packages/docs/zh/guide/essentials/nested-routes.md
(2 hunks)packages/docs/zh/guide/essentials/passing-props.md
(1 hunks)packages/docs/zh/guide/index.md
(1 hunks)
🔇 Additional comments (8)
packages/docs/zh/guide/essentials/nested-routes.md (1)
25-55
: LGTM! Documentation formatting improvements.The addition of file annotations to code fences (e.g.,
[App.vue]
,[User.vue]
) enhances readability by clearly indicating which file each code example represents. These changes align with the vitepress-plugin-group-icons integration and are consistent with similar updates across the documentation.packages/docs/zh/guide/advanced/navigation-guards.md (1)
144-155
: LGTM! Consistent code fence labeling.The addition of the
[main.ts]
file annotation improves documentation clarity by explicitly identifying the source file for the TypeScript example.packages/docs/guide/essentials/passing-props.md (1)
12-18
: LGTM! Clear file identification.The
[User.vue]
annotation makes it immediately clear which component file is being demonstrated, improving documentation readability.packages/docs/guide/essentials/named-views.md (1)
64-71
: LGTM! Enhanced template example labeling.The
[UserSettings.vue]
annotation clearly identifies the component file for the template example, maintaining consistency with other documentation updates.packages/docs/guide/essentials/nested-routes.md (1)
25-55
: LGTM! Documentation formatting enhancements.The file annotations for code fences (
[App.vue]
,[User.vue]
) improve documentation clarity by explicitly showing which component each example belongs to. These changes are consistent with the broader documentation enhancement effort across the repository.packages/docs/.vitepress/config/shared.ts (2)
3-6
: LGTM! Correct plugin imports.The imports of
groupIconMdPlugin
andgroupIconVitePlugin
fromvitepress-plugin-group-icons
are correct and follow the plugin's standard usage pattern.Based on learnings
67-69
: LGTM! Proper markdown plugin integration.The markdown plugin is correctly applied via the
config
function, which will transform code-group blocks at markdown render time to enable icon display.Based on learnings
packages/docs/.vitepress/theme/index.ts (1)
12-12
: LGTM! Correct virtual CSS import.The import of
'virtual:group-icons.css'
is correct and necessary to include the plugin's default styles. This virtual module is provided by thegroupIconVitePlugin
and should be imported at the theme level as shown here.Based on learnings
commit: |
Codecov Report✅ All modified and coverable lines are covered by tests. Additional details and impacted files@@ Coverage Diff @@ ## main #2521 +/- ## ======================================= Coverage 89.61% 89.61% ======================================= Files 46 46 Lines 4103 4103 Branches 1089 1090 +1 ======================================= Hits 3677 3677 Misses 421 421 Partials 5 5 ☔ View full report in Codecov by Sentry. 🚀 New features to boost your workflow:
|
This PR introduces vitepress-plugin-group-icons to enhance the document's readability.
Screenshot
Summary by CodeRabbit
New Features
Documentation
Chores