From 3a6ebcf3d41fd0b00e716882142a47111a5987dd Mon Sep 17 00:00:00 2001 From: pengzhanbo Date: Wed, 3 Apr 2024 02:06:26 +0800 Subject: [PATCH] feat(plugin-md-power): add `@[codesandbox](user/id)` syntax supported --- docs/.vuepress/theme.ts | 1 + .../src/client/components/CodeSandbox.vue | 64 ++++++++++++ plugins/plugin-md-power/src/client/config.ts | 4 + .../src/node/features/codeSandbox.ts | 97 +++++++++++++++++++ plugins/plugin-md-power/src/node/plugin.ts | 6 ++ .../plugin-md-power/src/shared/codeSandbox.ts | 12 +++ plugins/plugin-md-power/src/shared/index.ts | 2 + plugins/plugin-md-power/src/shared/plugin.ts | 1 + 8 files changed, 187 insertions(+) create mode 100644 plugins/plugin-md-power/src/client/components/CodeSandbox.vue create mode 100644 plugins/plugin-md-power/src/node/features/codeSandbox.ts create mode 100644 plugins/plugin-md-power/src/shared/codeSandbox.ts diff --git a/docs/.vuepress/theme.ts b/docs/.vuepress/theme.ts index 7ce369de..38ef9af1 100644 --- a/docs/.vuepress/theme.ts +++ b/docs/.vuepress/theme.ts @@ -74,6 +74,7 @@ export const theme: Theme = themePlume({ icons: true, codepen: true, replit: true, + codeSandbox: true, }, comment: { provider: 'Giscus', diff --git a/plugins/plugin-md-power/src/client/components/CodeSandbox.vue b/plugins/plugin-md-power/src/client/components/CodeSandbox.vue new file mode 100644 index 00000000..4302381a --- /dev/null +++ b/plugins/plugin-md-power/src/client/components/CodeSandbox.vue @@ -0,0 +1,64 @@ + + +