\r\n```\r\n\r\nAlternatively, use the `desc` defined in the `container` to write Markdown syntax.\r\n\r\n```md\r\n::: demo src=\"../demo.vue\" title=\"Demo block\"\r\n\r\nThis is a `description` that can be written using Markdown.\r\n\r\n:::\r\n```\r\n\r\n### Describe the solution you'd like\r\n\r\nTo address this, I have created the [markdown-it-vitepress-demo](https://github.com/hairyf/markdown-it-vitepress-demo) plugin. I'm not sure if it can be helpful.\r\n\r\n### Describe alternatives you've considered\r\n\r\n_No response_\r\n\r\n### Additional context\r\n\r\n- https://github.com/vuejs/vitepress/issues/987\r\n- https://github.com/vuejs/vitepress/issues/1349\r\n\r\n### Validations\r\n\r\n- [X] Follow our [Code of Conduct](https://vuejs.org/about/coc.html)\r\n- [X] Read the [docs](https://vitepress.dev).\r\n- [X] Read the [Contributing Guidelines](https://github.com/vuejs/vitepress/blob/main/.github/contributing.md).\r\n- [X] Check that there isn't already an issue that asks for the same feature to avoid creating a duplicate.",[2856],{"name":2857,"color":2858},"stale","ededed",2432,"vuejs","vitepress","open","feat(demo): built-in markdown plugin provides support for showcasing demo capabilities.","2024-07-17T14:37:26Z","https://github.com/vuejs/vitepress/issues/2432",0.663737,{"description":2868,"labels":2869,"number":2871,"owner":2860,"repository":2861,"state":2862,"title":2872,"updated_at":2873,"url":2874,"score":2875},"### Is your feature request related to a problem? Please describe.\r\n\r\nsuch as a vue components library site……\r\nA common problem for a documentation page is to show how to use a component, both in code and with demo of live component.\r\n\r\n### Describe the solution you'd like\r\n\r\nlike this [https://github.com/flingyp/vitepress-demo-preview](https://github.com/flingyp/vitepress-demo-preview)\r\n\r\n### Describe alternatives you've considered\r\n\r\n_No response_\r\n\r\n### Additional context\r\n\r\n_No response_\r\n\r\n### Validations\r\n\r\n- [X] Follow our [Code of Conduct](https://vuejs.org/about/coc.html)\r\n- [X] Read the [docs](https://vitepress.dev).\r\n- [X] Read the [Contributing Guidelines](https://github.com/vuejs/vitepress/blob/main/.github/contributing.md).\r\n- [X] Check that there isn't already an issue that asks for the same feature to avoid creating a duplicate.",[2870],{"name":2857,"color":2858},3270,"Feature request: Vue component source code demo","2024-01-18T18:48:08Z","https://github.com/vuejs/vitepress/issues/3270",0.6826508,{"description":2877,"labels":2878,"number":2879,"owner":2860,"repository":2861,"state":2880,"title":2881,"updated_at":2882,"url":2883,"score":2884},"### Is your feature request related to a problem? Please describe.\n\nI'm using VitePress to document our coding standards and our design system. I want to show examples of the code we would use (HTML and Vue components) *and* how that code would render.\r\n\r\nI can import and use Vue components in the markdown (and HTML) without issue. But to show both the \"live\" and \"source\" views of that code, I have to copy my live code into a separate markdown code block, which means now I have *two* blocks of code to manage and synchronize for each example.\n\n### Describe the solution you'd like\n\nI'd like a new directive for \"```\" code blocks that, when viewed in VitePress, shows up as a tabbed interface with two tabs: (1) the rendered version of that code (using the normal rendering done by VitePress, supporting Vue and HTML), and (2) the normal way the code block would be otherwise rendered.\r\n\r\nI *believe* this would simply require detecting this directive, duplicating the code within the block as non-fenced code, and wrapping the pair in a simple tabbed Vue component.\r\n\r\nObviously for more complex examples, the VitePress version of the live code will differ from what needs to be shown to the user, so that is a challenge (the Vue docs themselves have this challenge). But for simple examples of using Vue components and HTML with no additional script involved, it would really help.\r\n\r\nMy suggestion would be something like \"```html:live\", where the \":live\" bit either comes before or after any row number highlights (I don't think it would matter).\n\n### Describe alternatives you've considered\n\nCopying and pasting between markdown code blocks to markdown live code, keeping them synchronized as the code is updated.\n\n### Additional context\n\n_No response_\n\n### Validations\n\n- [X] Follow our [Code of Conduct](https://vuejs.org/about/coc.html)\n- [X] Read the [docs](https://vitepress.vuejs.org).\n- [X] Read the [Contributing Guidelines](https://github.com/vuejs/vitepress/blob/main/.github/contributing.md).\n- [X] Check that there isn't already an issue that asks for the same feature to avoid creating a duplicate.",[],554,"closed","\"Live\" Code Blocks","2023-01-21T14:20:27Z","https://github.com/vuejs/vitepress/issues/554",0.58453065,{"description":2886,"labels":2887,"number":2891,"owner":2860,"repository":2861,"state":2880,"title":2892,"updated_at":2893,"url":2894,"score":2895},"### Describe the bug\n\nI referenced a globally registered component in the markdown document of vitepress. When I used it, the error was reported as follows:\r\n**[vitepress] Internal server error: At least one \u003Ctemplate> or \u003Cscript> is required in a single file component.**\r\n\r\n\r\n\n\n### Reproduction\n\nCreate vite.config.js in the vitepress root directory, the content is as follows:\r\n\r\n```\r\nimport { defineConfig } from \"vite\";\r\nimport vueJsx from \"@vitejs/plugin-vue-jsx\";\r\nimport vue from \"@vitejs/plugin-vue\"\r\nexport default defineConfig({\r\n plugins: [\r\n vue(),\r\n vueJsx(),\r\n ],\r\n});\r\n```\n\n### Expected behavior\n\nRender component content correctly\n\n### System Info\n\n```shell\nnode 16\n```\n\n\n### Additional context\n\n_No response_\n\n### Validations\n\n- [X] Follow our [Code of Conduct](https://vuejs.org/about/coc.html)\n- [X] Read the [docs](https://vitepress.dev).\n- [X] Check that there isn't already an issue that reports the same bug to avoid creating a duplicate.",[2888],{"name":2889,"color":2890},"need more info","bdbefc",2095,"vitepress not support jsx file?","2023-03-29T00:04:14Z","https://github.com/vuejs/vitepress/issues/2095",0.6522963,{"description":2897,"labels":2898,"number":2902,"owner":2860,"repository":2861,"state":2880,"title":2903,"updated_at":2904,"url":2905,"score":2906},"### Describe the bug\n\nI want to use the vue component in vitepress. I have read the documentation on the official website, but when I do it, I encounter an error like this.\r\n```bash\r\n[plugin:vite:vue] Tags with side effect (\u003Cscript> and \u003Cstyle>) are ignored in client component templates.\r\n```\r\n\r\nI don't understand what I'm encountering, I just want to achieve the effect here in this vue document\r\n\r\n> https://cn.vuejs.org/guide/reusability/composables.html#vs-react-hooks\r\n\r\n\r\n\r\n\n\n### Reproduction\n\nhttps://stackblitz.com/edit/vite-dn63jg?file=docs%2Fhooks%2FuseMouse.js,docs%2Fexample.md\n\n### Expected behavior\n\nThe documentation on the official website makes me understand the difficulty or the need for a better demo?\n\n### System Info\n\n```Text\nSystem:\r\n OS: Windows 11 10.0.22631\r\n CPU: (20) x64 13th Gen Intel(R) CoreT i7-13800H\r\n Memory: 17.07 GB / 31.74 GB\r\n Binaries:\r\n Node: 20.11.0 - ~\\AppData\\Local\\pnpm\\node.EXE\r\n npm: 10.2.4 - ~\\AppData\\Local\\pnpm\\npm.CMD\r\n pnpm: 8.14.1 - ~\\AppData\\Local\\pnpm\\pnpm.EXE\r\n Browsers:\r\n Edge: Chromium (120.0.2210.133)\r\n Internet Explorer: 11.0.22621.1\r\n npmPackages:\r\n vitepress: 1.0.0-rc.39 => 1.0.0-rc.39\n```\n\n\n### Additional context\n\nPlease tell me the correct way to write it, thank you\n\n### Validations\n\n- [X] Check if you're on the [latest VitePress version](https://github.com/vuejs/vitepress/releases/latest).\n- [X] Follow our [Code of Conduct](https://vuejs.org/about/coc.html)\n- [X] Read the [docs](https://vitepress.dev).\n- [X] Check that there isn't already an issue that reports the same bug to avoid creating a duplicate.",[2899],{"name":2900,"color":2901},"bug: pending triage","e99695",3485,"Using vue to report errors in markdown","2024-01-29T00:04:28Z","https://github.com/vuejs/vitepress/issues/3485",0.65522206,{"description":2908,"labels":2909,"number":2910,"owner":2860,"repository":2861,"state":2880,"title":2911,"updated_at":2912,"url":2913,"score":2914},"I'm new to vue and vitepress so I'm a little confused.\r\n\r\nI'm looking into adding markdown to my existing vue app. The way I imagined it would be some markdown element which would take the markdown text and render it. I'm also interested in embedding vue components inside the markdown. Something like\r\n```\r\n\u003CMarkdown>\r\n## abc\r\nefg\r\n### hij\r\nHi {{name}},\r\n\u003C/Markdown>\r\n```\r\nI was hoping vitepress would do it, but it seems like vitepress sets everything up as a standalone app. I can't simply add vitepress to my package.json and start using it's elements.\r\n\r\nAny examples of using vitepress in an existing vue as a library? Or any alternative?",[],315,"Use vitepress in an existing vue app","2023-01-21T16:22:21Z","https://github.com/vuejs/vitepress/issues/315",0.66022325,{"description":2916,"labels":2917,"number":2919,"owner":2860,"repository":2861,"state":2880,"title":2920,"updated_at":2921,"url":2922,"score":2923},"### Describe the bug\r\n\r\nwhen I update the version to `\"vitepress\": \"^1.0.0-alpha.63\",` , and run `vitepress dev docs`, The Aside component is render nothing\r\n\r\n\r\n\r\n### Reproduction\r\n\r\nupdate the vitepress version to `\"vitepress\": \"^1.0.0-alpha.63\",`\r\n\r\nrun `vitepress dev docs`\r\n\r\n`config.js`\r\n```\r\nimport { defineConfigWithTheme } from 'vitepress';\r\nimport vueJsx from '@vitejs/plugin-vue-jsx';\r\nimport baseConfig from '@vue/theme/config';\r\nimport { demoBlockPlugin } from 'vitepress-theme-demoblock';\r\nimport path from 'path';\r\n\r\nimport { i18n, nav, sidebar } from './themeConfig/index';\r\n\r\nexport default defineConfigWithTheme({\r\n extends: baseConfig,\r\n lang: 'zh-CN',\r\n title: 'SinoGear Vue',\r\n description: '',\r\n srcDir: './src',\r\n scrollOffset: 'header',\r\n ignoreDeadLinks: true,\r\n head: [['meta', { name: 'theme-color', content: '#3c8772' }]],\r\n themeConfig: {\r\n nav,\r\n sidebar,\r\n appearance: false, // 开启 light/dark 模式\r\n // Placeholder of the i18n config for @vuejs-translations.\r\n i18n,\r\n },\r\n\r\n markdown: {\r\n config(md) {\r\n md.use(demoBlockPlugin, {\r\n cssPreprocessor: 'less',\r\n scriptImports: [\r\n \"import * as AntDesignVue from 'ant-design-vue'\",\r\n ],\r\n scriptReplaces: [\r\n {\r\n searchValue: /import ({.*}) from 'ant-design-vue'/g,\r\n replaceValue: (s, s1) => `const ${s1} = AntDesignVue`\r\n },\r\n ]\r\n });\r\n }\r\n },\r\n\r\n vite: {\r\n server: {\r\n host: true,\r\n port: 3001,\r\n fs: {\r\n // for when developing with locally linked theme\r\n allow: ['../..']\r\n }\r\n },\r\n build: {\r\n chunkSizeWarningLimit: Infinity\r\n },\r\n json: {\r\n stringify: true\r\n },\r\n ssr: {\r\n noExternal: ['@wangeditor/editor', '@wangeditor/editor-for-vue', 'ant-design-vue', '@ant-design/icons-vue', '@babel/runtime']\r\n },\r\n plugins: [vueJsx()],\r\n css: {\r\n preprocessorOptions: {\r\n less: {\r\n javascriptEnabled: true\r\n }\r\n }\r\n }\r\n },\r\n\r\n vue: {\r\n reactivityTransform: path.resolve(__dirname, 'src')\r\n }\r\n});\r\n\r\n```\r\n\r\n### Expected behavior\r\n\r\nrender aside component\r\n\r\n### System Info\r\n\r\n\r\n`packages.json`\r\n```shell\r\n\r\n\"@babel/plugin-syntax-jsx\": \"^7.18.6\",\r\n \"@vitejs/plugin-vue\": \"^4.0.0\",\r\n \"@vitejs/plugin-vue-jsx\": \"^3.0.0\",\r\n \"@vue/babel-plugin-jsx\": \"^1.1.1\",\r\n \"@vue/compiler-sfc\": \"^3.0.4\",\r\n \"conventional-changelog-cli\": \"^2.1.0\",\r\n \"cross-env\": \"^7.0.2\",\r\n \"del\": \"^6.0.0\",\r\n \"gulp\": \"^4.0.2\",\r\n \"gulp-babel\": \"^8.0.0\",\r\n \"highlight.js\": \"^10.4.1\",\r\n \"less\": \"^4.1.2\",\r\n \"lint-staged\": \"^13.0.3\",\r\n \"prettier\": \"^2.7.1\",\r\n \"rimraf\": \"^3.0.0\",\r\n \"transliteration\": \"^2.2.0\",\r\n \"vitepress\": \"^1.0.0-alpha.63\",\r\n \"vitepress-plugin-search\": \"^1.0.4-alpha.17\",\r\n \"vitepress-theme-demoblock\": \"^2.0.0\"\r\n```\r\n```\r\n\r\n\r\n### Additional context\r\n\r\n_No response_\r\n\r\n### Validations\r\n\r\n- [X] Follow our [Code of Conduct](https://vuejs.org/about/coc.html)\r\n- [X] Read the [docs](https://vitepress.dev).\r\n- [X] Check that there isn't already an issue that reports the same bug to avoid creating a duplicate.",[2918],{"name":2889,"color":2890},2157,"The Aside component is render nothing","2023-04-05T00:04:02Z","https://github.com/vuejs/vitepress/issues/2157",0.66248226,{"description":2925,"labels":2926,"number":2927,"owner":2860,"repository":2861,"state":2880,"title":2928,"updated_at":2929,"url":2930,"score":2931},"\r\n**Describe the bug**\r\nvitepress dev docs working but vitepress build docs has errors.\r\n\r\n```\r\n> vitepress dev docs\r\n\r\nvitepress v0.15.3\r\nvite v2.3.7\r\nD:\\vue3-openlayers\\docs\\.vitepress\\config.js\r\n\r\n vite v2.3.7 dev server running at:\r\n\r\n > Local: http://localhost:3000/\r\n > Network: use `--host` to expose\r\n[@vue/compiler-sfc] \u003Cscript setup> is still an experimental proposal.\r\nFollow its status at https://github.com/vuejs/rfcs/pull/227.\r\n\r\n[@vue/compiler-sfc] When using experimental features,\r\nit is recommended to pin your vue dependencies to exact versions to avoid breakage.\r\n```\r\n\r\n```\r\n> vitepress build docs\r\n\r\nvitepress v0.15.3\r\nvite v2.3.7\r\n⠧ building client + server bundles...\r\n(!) Some chunks are larger than 500kb after minification. Consider:\r\n- Using dynamic import() to code-split the application\r\n- Use build.rollupOptions.output.manualChunks to improve chunking: https://rollupjs.org/guide/en/#outputmanualchunks\r\n- Adjust chunk size limit for this warning via build.chunkSizeWarningLimit.\r\n✓ building client + server bundles...\r\n✖ rendering pages...\r\nbuild error:\r\n D:\\vue3-openlayers\\node_modules\\ol\\Map.js:17\r\nimport CompositeMapRenderer from './renderer/Composite.js';\r\n^^^^^^\r\n\r\nSyntaxError: Cannot use import statement outside a module\r\n at wrapSafe (internal/modules/cjs/loader.js:1001:16)\r\n at Module._compile (internal/modules/cjs/loader.js:1049:27)\r\n at Object.Module._extensions..js (internal/modules/cjs/loader.js:1114:10)\r\n at Module.load (internal/modules/cjs/loader.js:950:32)\r\n at Function.Module._load (internal/modules/cjs/loader.js:791:14)\r\n at Module.require (internal/modules/cjs/loader.js:974:19)\r\n at require (internal/modules/cjs/helpers.js:88:18)\r\n at Module.\u003Canonymous> (D:\\vue3-openlayers\\node_modules\\vitepress\\dist\\client\\app\\temp\\app.js:25:13)\r\n at Module._compile (internal/modules/cjs/loader.js:1085:30)\r\n at Object.Module._extensions..js (internal/modules/cjs/loader.js:1114:10)\r\nnpm ERR! code ELIFECYCLE\r\nnpm ERR! errno 1\r\nnpm ERR! vue3-openlayers@0.1.0 docs:build: `vitepress build docs`\r\nnpm ERR! Exit status 1\r\n```\r\n\r\n**Expected behavior**\r\n\r\nsuccess build\r\n\r\n**System Info**\r\n- vitepress version: ^0.15.3\r\n- vite version: 2.3.7\r\n- Node version: v14.13.0\r\n- OS version: win 10\r\n\r\n",[],324,"dev works but build not (Cannot use import statement outside a module)","2023-01-21T14:28:40Z","https://github.com/vuejs/vitepress/issues/324",0.6695186,{"description":2933,"labels":2934,"number":2935,"owner":2860,"repository":2861,"state":2880,"title":2936,"updated_at":2937,"url":2938,"score":2939},"\u003C!--\r\nNOTE:\r\nVitePress is still WIP, and it is not compatible with VuePress.\r\nPlease do not open issue about default theme missing features or something doesn't work like VuePress.\r\n-->\r\n\r\n**Describe the bug**\r\nWhen using a custom theme, importing composables like `useRoute` from `\"vitepress\"` in the Layout component also imports the styles for the default theme.\r\n\r\n**To Reproduce**\r\n\r\n1. Follow the [Getting Started guide](https://vitepress.vuejs.org/guide/getting-started.html) to create a new site\r\n2. Create `docs/.vitepress/theme/Layout.vue` with the following contents:\r\n\r\n```vue\r\n\u003Ctemplate>\r\n \u003CContent />\r\n\u003C/template>\r\n\r\n\u003Cscript setup>\r\n// import { useRoute } from \"vitepress\";\r\n// const route = useRoute();\r\n\u003C/script>\r\n```\r\n\r\n3. Create `docs/.vitepress/theme/index.js` with the following contents:\r\n\r\n```js\r\nimport Layout from \"./Layout.vue\";\r\n\r\nexport default {\r\n Layout,\r\n};\r\n```\r\n\r\n4. Run `yarn docs:dev` and open http://localhost:3000. Note the heading doesn't have any styles applied to it:\r\n\r\n\r\n\r\n5. Uncomment the lines in the `\u003Cscript setup>` section in `docs/.vitepress/theme/Layout.vue`. Note the heading now has the default styles applied to it, even though we only imported `useRoute`:\r\n\r\n\r\n\r\n**Expected behavior**\r\nThe heading should remain unstyled since we aren't explicitly importing any styles.\r\n\r\n**System Info**\r\n- vitepress version: v0.9.2\r\n- vite version: v1.0.0-rc.13\r\n- Node version: v12.20.0\r\n- OS version: macOS Catalina 10.15.7\r\n\r\n**Additional context**\r\nI had a quick look at the Vitepress code and it looks like the problem might be to do with this line: https://github.com/vuejs/vitepress/blob/309aa7a8d0e7ab08c1c9db258c74709a66b295cb/src/client/app/exports.ts#L29\r\n\r\nAdding the following to `docs/.vitepress/config.js`:\r\n\r\n```javascript\r\nmodule.exports = {\r\n alias: {\r\n \"/@default-theme/index\": \"/@theme/empty.js\",\r\n },\r\n};\r\n```\r\n\r\n...and creating an empty file `docs/.vitepress/theme/empty.js` prevents the default styles being applied.\r\n",[],182,"Importing default composables also imports default theme's styles","2023-01-21T16:23:59Z","https://github.com/vuejs/vitepress/issues/182",0.6728743,{"description":2941,"labels":2942,"number":2946,"owner":2860,"repository":2861,"state":2880,"title":2947,"updated_at":2948,"url":2949,"score":2950},"### Is your feature request related to a problem? Please describe.\r\n\r\nVueJS community is moving from JS to TS now. Hence, we have to provide both TS & JS code.\r\n\r\nI already started using VitePress alpha in my OSS project but for another project, I prefer providing TS & JS code via code groups like VuePress.\r\n\r\n### Describe the solution you'd like\r\n\r\nProvide code blocks via markdown (using component is bit ugly for markdown only content). We can inspire from Nuxt content 2 for new syntax\r\n\r\n\u003Cpre>\r\n:::code group\r\n\r\n:::group{ts}\r\n\r\n```ts\r\nconst a: number = 1\r\n```\r\n\r\n:::\r\n\r\n:::group{js}\r\n\r\n```js\r\nconst a = 1\r\n```\r\n\r\n:::\r\n\r\n:::\r\n\u003C/pre>\r\n\r\n### Describe alternatives you've considered\r\n\r\nNone\r\n\r\n### Additional context\r\n\r\nhttps://content.nuxtjs.org/guide/writing/mdc\r\n\r\n### Validations\r\n\r\n- [X] Follow our [Code of Conduct](https://vuejs.org/about/coc.html)\r\n- [X] Read the [docs](https://vitepress.vuejs.org).\r\n- [X] Read the [Contributing Guidelines](https://github.com/vuejs/vitepress/blob/main/.github/contributing.md).\r\n- [X] Check that there isn't already an issue that asks for the same feature to avoid creating a duplicate.",[2943],{"name":2944,"color":2945},"theme","0754FB",728,"Support code groups and allow adding title to code blocks","2023-01-21T14:17:14Z","https://github.com/vuejs/vitepress/issues/728",0.6735376,["Reactive",2952],{},["Set"],["ShallowReactive",2955],{"$fTRc1wZytZ_XrK4EfJfei_Sz-An4H4Yy6syhVxH_PVJc":-1,"$f9w3KyUX3979PN74aeEVs-DOdOZQDJ-tKP0cZhKwgG5A":-1},"/vuejs/vitepress/437"]