diff --git "a/docs/1.\347\244\272\344\276\213/\347\244\272\344\276\213\346\226\207\347\253\2407.md" "b/docs/1.\347\244\272\344\276\213/\347\244\272\344\276\213\346\226\207\347\253\2407.md" index 8c597d58..52a83733 100644 --- "a/docs/1.\347\244\272\344\276\213/\347\244\272\344\276\213\346\226\207\347\253\2407.md" +++ "b/docs/1.\347\244\272\344\276\213/\347\244\272\344\276\213\346\226\207\347\253\2407.md" @@ -9,9 +9,7 @@ permalink: /article/5xbhl125/ ### normal 嵌入语法 -@[demo normal title="示例" desc="这是一个示例"](./normal.html) - -1 +@[demo normal title="示例" desc="这是一个示例" expanded](./normal.html) ### normal 容器语法 @@ -42,9 +40,9 @@ const app = document.querySelector('#app') app.appendChild(window.document.createElement('div')).textContent = a ``` -@tab Less +@tab SCSS -``` less +``` scss #app { font-size: 2em; text-align: center; @@ -94,7 +92,7 @@ button { ::: -### .ts + .css demo +### vue .ts + .css demo :::: demo vue ::: code-tabs @@ -128,3 +126,25 @@ export default defineComponent({ ::: :::: + +### markdown 嵌入语法 + +@[demo markdown title="示例" desc="这是一个示例"](/.vuepress/bulletin.md) + +### markdown 容器语法 + +:::: demo markdown title="示例" desc="这是一个示例" + +```md +::: center + +**QQ 交流群:** [792882761](https://qm.qq.com/q/FbPPoOIscE) + +![QQ qr_code](/images/qq_qrcode.png){width="618" height="616" style="width: 200px"} + +您在使用过程中遇到任何问题,欢迎通过 [issue](https://github.com/pengzhanbo/vuepress-theme-plume/issues/new/choose) 反馈。也欢迎加入我们的 QQ 交流群一起讨论。 + +::: +``` + +:::: diff --git a/plugins/plugin-md-power/src/client/components/VPDemoVue.vue b/plugins/plugin-md-power/src/client/components/VPDemoBasic.vue similarity index 77% rename from plugins/plugin-md-power/src/client/components/VPDemoVue.vue rename to plugins/plugin-md-power/src/client/components/VPDemoBasic.vue index e7ed82fd..117f5c7c 100644 --- a/plugins/plugin-md-power/src/client/components/VPDemoVue.vue +++ b/plugins/plugin-md-power/src/client/components/VPDemoBasic.vue @@ -1,19 +1,23 @@ ', } const IMPORT_RE = /import\s+(?:\w+\s+from\s+)?['"]([^'"]+)['"]/g diff --git a/plugins/plugin-md-power/src/node/prepareConfigFile.ts b/plugins/plugin-md-power/src/node/prepareConfigFile.ts index 2324df67..2ebf288c 100644 --- a/plugins/plugin-md-power/src/node/prepareConfigFile.ts +++ b/plugins/plugin-md-power/src/node/prepareConfigFile.ts @@ -76,9 +76,9 @@ export async function prepareConfigFile(app: App, options: MarkdownPowerPluginOp } if (options.demo) { - imports.add(`import VPDemoVue from '${CLIENT_FOLDER}components/VPDemoVue.vue'`) + imports.add(`import VPDemoBasic from '${CLIENT_FOLDER}components/VPDemoBasic.vue'`) imports.add(`import VPDemoNormal from '${CLIENT_FOLDER}components/VPDemoNormal.vue'`) - enhances.add(`app.component('VPDemoVue', VPDemoVue)`) + enhances.add(`app.component('VPDemoBasic', VPDemoBasic)`) enhances.add(`app.component('VPDemoNormal', VPDemoNormal)`) } diff --git a/plugins/plugin-md-power/src/shared/demo.ts b/plugins/plugin-md-power/src/shared/demo.ts index c8963466..2f600e1e 100644 --- a/plugins/plugin-md-power/src/shared/demo.ts +++ b/plugins/plugin-md-power/src/shared/demo.ts @@ -3,7 +3,7 @@ import type { App } from 'vuepress' import type { Markdown, MarkdownEnv } from 'vuepress/markdown' export interface DemoFile { - type: 'vue' | 'normal' | 'css' + type: 'vue' | 'normal' | 'css' | 'markdown' export?: string path: string gitignore?: boolean @@ -14,11 +14,12 @@ export interface MarkdownDemoEnv extends MarkdownEnv { } export interface DemoMeta { - type: 'vue' | 'normal' + type: 'vue' | 'normal' | 'markdown' url: string title?: string desc?: string codeSetting?: string + expanded?: boolean } export interface DemoContainerRender {