Skip to content
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

@ice/pkg-plugin-docusaurus 代码preview功能,能否支持<CodeBlock>写法 #669

Open
Alubb77 opened this issue Dec 31, 2024 · 0 comments

Comments

@Alubb77
Copy link

Alubb77 commented Dec 31, 2024

背景:
使用@ice/pkg初始化一个monorepo格式的组件库,其中每个组件对应的调试代码位于 /dev/index,
在写文档时,因为文档预览代码与调试代码相同,要将调试代码复制一份到文档中,长期维护麻烦。

```tsx preview
组件调试代码

诉求:
希望预览功能支持导入代码片段能力。

调研:
根据 docusaurus 文档,支持导入代码块的能力,但是必须用 <CodeBlock 而不是简写 ```,但是预览功能未兼容<CodeBlock,因此期望预览能力可以支持<CodeBlock 写法,或者有其他导入代码片段的能力
https://docusaurus.io/zh-CN/docs/2.x/markdown-features/react#importing-code-snippets
image

ast树及对应判断代码
image
image

@Alubb77 Alubb77 changed the title @ice/pkg-plugin-docusaurus 能否支持代码代码preview功能,能否支持<CodeBlock>写法 @ice/pkg-plugin-docusaurus 代码preview功能,能否支持<CodeBlock>写法 Dec 31, 2024
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

No branches or pull requests

1 participant