\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.6876792,{"description":2868,"labels":2869,"number":2873,"owner":2860,"repository":2861,"state":2874,"title":2875,"updated_at":2876,"url":2877,"score":2878},"### Describe the bug\n\nI'm writing documentation for a component library. Some components have slots.\r\n- When it's a default slot, I fill it by simply placing content in `\u003CComponent> \u003C/Component>`, it works perfectly, and the slotted content renders in the markdown page.\r\n- When it's a named slot, I have to wrap it in `\u003Ctemplate #nameoftheslot> \u003C/template>` as per [Vue slot system](https://vuejs.org/guide/components/slots.html#named-slots), and my content is not rendered. When reading Vitepress documentation, I read that `\u003Ctemplate>` is not to be used in the Markdown page, and though I understand the redundance with Vue SFC templates, we need to be able to used named slots to make these kind of component work...\r\n\r\nDid I miss something or am I trying to do this the wrong way ?\r\nIf not, it would be greatly appreciated to implement named slots in the Markdown pages.\r\n\r\n\n\n### Reproduction\n\n- Use a Vue component in your Markdown page\r\n- This component should have a named slot (eg: `\u003Cslot name=\"header\"> \u003C/slot>`)\r\n- Try to pass content to that slot (eg: `\u003Ctemplate #header> i'm slotted \u003C/template>`)\r\n\r\n=> \"i\"m slotted\" won't be rendered\n\n### Expected behavior\n\nNamed slots should be parsed and rendered correctly, we should see slotted content passed in a named slot\n\n### System Info\n\n```Text\nSystem:\r\n OS: macOS 15.0\r\n CPU: (8) arm64 Apple M2\r\n Memory: 357.16 MB / 24.00 GB\r\n Shell: 5.9 - /bin/zsh\r\n Binaries:\r\n Node: 20.10.0 - /usr/local/bin/node\r\n Yarn: 1.22.19 - /opt/homebrew/bin/yarn\r\n npm: 10.2.5 - /usr/local/bin/npm\r\n pnpm: 8.9.2 - /opt/homebrew/bin/pnpm\r\n Browsers:\r\n Safari: 18.0\r\n npmPackages:\r\n vitepress: ^1.3.4 => 1.3.4\n```\n\n\n### Additional context\n\n\u003Cimg width=\"683\" alt=\"Screenshot 2024-09-23 at 11 46 25\" src=\"https://github.com/user-attachments/assets/8989014b-486d-4361-b739-b7bd4b628c55\">\r\n\u003Cimg width=\"604\" alt=\"Screenshot 2024-09-23 at 11 47 34\" src=\"https://github.com/user-attachments/assets/3e32a1c7-02b4-413c-99e4-c9516e6d6409\">\r\n\r\n\r\n\r\nMy carousel has no slide rendered\r\n\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.",[2870],{"name":2871,"color":2872},"need more info","bdbefc",4223,"closed","Vue named slots don't work in Markdown","2024-10-01T04:45:57Z","https://github.com/vuejs/vitepress/issues/4223",0.61954355,{"description":2880,"labels":2881,"number":2882,"owner":2860,"repository":2861,"state":2874,"title":2883,"updated_at":2884,"url":2885,"score":2886},"### 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,"\"Live\" Code Blocks","2023-01-21T14:20:27Z","https://github.com/vuejs/vitepress/issues/554",0.66503835,{"description":2888,"labels":2889,"number":2893,"owner":2860,"repository":2861,"state":2874,"title":2894,"updated_at":2895,"url":2896,"score":2897},"I am looking into porting the using vue in Markdown from vuepress: \r\nhttps://vuepress.vuejs.org/guide/using-vue.html\r\n\r\nIf I understand correctly, vitepress doesn't want to auto register components by convention as Vuepress does. Is this the case? I actually liked this feature, but I understand that vitepress wants to keep the moving parts as small as possible.\r\n\r\nWhat is the recommended way to register the components? I see that in vue-router-next docs they are registered globally inside `enhanceApp`: https://github.com/vuejs/vue-router-next/search?q=HomeSponsors.\r\nSame as with this comment: https://github.com/vuejs/vitepress/issues/92#issuecomment-724645482\r\n\r\nShould we document this way in the docs?\r\n\r\nSome thoughts about this. It would be great that users that want to use the default theme as is, do not need to learn straight away about enhanceApp to be able to use a vue component in their markdown.\r\n\r\nIf auto registering by convention in a folder like `.vitepress/components` is not an option, could we import them directly in the markdown?\r\n\r\n```markdown\r\n# Docs\r\n\r\nThis is a .md using a custom component\r\n\r\n\u003CCustomComponent />\r\n\r\n## More docs\r\n\r\n...\r\n\r\n\u003Cscript setup>\r\n import CustomComponent from '../components/CustomComponent.vue'\r\n\u003C/script>\r\n```\r\n\r\nScript & style hoisting is working in vitepress: https://vuepress.vuejs.org/guide/using-vue.html#script-style-hoisting, but I tried this example to import a Component and it is not at this point.\r\n",[2890],{"name":2891,"color":2892},"docs","0075ca",157,"Recommended way to use Custom Vue components in .md","2023-01-21T16:04:10Z","https://github.com/vuejs/vitepress/issues/157",0.66642046,{"description":2899,"labels":2900,"number":2904,"owner":2860,"repository":2861,"state":2874,"title":2905,"updated_at":2906,"url":2907,"score":2908},"### 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.",[2901],{"name":2902,"color":2903},"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.68322784,{"description":2910,"labels":2911,"number":2915,"owner":2860,"repository":2861,"state":2874,"title":2916,"updated_at":2917,"url":2918,"score":2919},"### Describe the bug\r\n\r\nSome of the code markdown extensions do not work when the language is `vue`.\r\n\r\nIn particular, `[!code ++]`, `[!code --]`, `[!code warning]`, `[!code error]` and `[!code focus]` just show the comments at the end of the line.\r\n\r\nChanging the language to something else fixes this, e.g. `htmx` or `ts`.\r\n\r\nThis only seems to happen in the template tags of a `vue` code block. The highlighting works absolutely fine in the script part. Please see reproduction for code examples, I can't figure out how to escape the triple backtick code blocks here! ☹️ \r\n\r\n### Reproduction\r\n\r\nhttps://stackblitz.com/edit/vite-arupmh?file=docs%2Fexample.md\r\n\r\n### Expected behavior\r\n\r\nThe markdown extensions should work correctly and highlight the lines as per [the docs](https://vitepress.dev/guide/markdown#focus-in-code-blocks).\r\n\r\n### System Info\r\n\r\n```Text\r\nSystem:\r\n OS: macOS 14.1.2\r\n CPU: (16) x64 Intel(R) Core(TM) i9-9880H CPU @ 2.30GHz\r\n Memory: 488.47 MB / 16.00 GB\r\n Shell: 5.9 - /bin/zsh\r\nBinaries:\r\n Node: 18.12.1 - ~/.nvm/versions/node/v18.12.1/bin/node\r\n Yarn: 1.22.10 - /usr/local/bin/yarn\r\n npm: 8.19.2 - ~/.nvm/versions/node/v18.12.1/bin/npm\r\nBrowsers:\r\n Chrome: 120.0.6099.234\r\n Firefox: 112.0.2\r\n Firefox Developer Edition: 107.0\r\n Safari: 17.1.2\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] Check if you're on the [latest VitePress version](https://github.com/vuejs/vitepress/releases/latest).\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.",[2912],{"name":2913,"color":2914},"upstream","BF29ED",3503,"Markdown code extensions don't work in some situations","2025-02-01T04:42:47Z","https://github.com/vuejs/vitepress/issues/3503",0.6896373,{"description":2921,"labels":2922,"number":2924,"owner":2860,"repository":2861,"state":2874,"title":2925,"updated_at":2926,"url":2927,"score":2928},"\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 I use the components directly in markdown file, It raised a waring with `vue.js:1099 [Vue warn]: Failed to resolve componen` as:\r\n\r\n\r\n\r\nDoes vitepress auto register components in `.vitepress/components`? or where can I put the `.vue` files and how to use them? thank you.\r\n\r\n**To Reproduce**\r\nSteps to reproduce the behavior:\r\n\r\n**Expected behavior**\r\nA clear and concise description of what you expected to happen.\r\n\r\n**System Info**\r\n- vitepress version:\r\n- vite version:\r\n- Node version:\r\n- OS version:\r\n\r\n**Additional context**\r\nAdd any other context about the problem here.\r\n",[2923],{"name":2902,"color":2903},60,"Is vitepress auto register components in `.vitepress/components`?","2023-01-21T16:25:31Z","https://github.com/vuejs/vitepress/issues/60",0.69004905,{"description":2930,"labels":2931,"number":2933,"owner":2860,"repository":2861,"state":2874,"title":2934,"updated_at":2935,"url":2936,"score":2937},"**Describe the bug**\r\n\r\nWhen using vitepress with vue v3.1, we are now running into a compilation error as some vitepress components are using `\u003Ctemplate functional>`\r\n\r\nThe related change in vue-next is https://github.com/vuejs/vue-next/commit/467076361a730b7925c88c572793c78637e05ca7\r\n\r\n**To Reproduce**\r\n\r\nSee [this PR in VTU](https://github.com/vuejs/vue-test-utils-next/pull/654) (that uses vitepress for the docs) that fails because of vitepress and vue 3.1 \r\n\r\nIt can easily be reproduced in the current codebase by bumping vue to v3.1 and run `yarn docs-build`:\r\n\r\n```\r\nSyntaxError: \u003Ctemplate functional> is no longer supported in Vue 3, since functional components no longer have significant performance difference from stateful ones. Just use a normal \u003Ctemplate> instead.\r\n at /Users/ced-pro/Code/vue/vitepress/node_modules/@vue/compiler-sfc/dist/compiler-sfc.cjs.js:196:37\r\n at Array.forEach (\u003Canonymous>)\r\n at parse (/Users/ced-pro/Code/vue/vitepress/node_modules/@vue/compiler-sfc/dist/compiler-sfc.cjs.js:182:18)\r\n at createDescriptor (/Users/ced-pro/Code/vue/vitepress/node_modules/@vitejs/plugin-vue/dist/index.js:4048:62)\r\n at transformMain (/Users/ced-pro/Code/vue/vitepress/node_modules/@vitejs/plugin-vue/dist/index.js:4344:32)\r\n at Object.transform (/Users/ced-pro/Code/vue/vitepress/node_modules/@vitejs/plugin-vue/dist/index.js:4665:16)\r\n at /Users/ced-pro/Code/vue/vitepress/node_modules/rollup/dist/shared/rollup.js:19875:25 {\r\n loc: {\r\n start: { column: 11, line: 1, offset: 10 },\r\n end: { column: 21, line: 1, offset: 20 },\r\n source: 'functional'\r\n },\r\n id: '/Users/ced-pro/Code/vue/vitepress/dist/client/theme-default/com\r\n```\r\n\r\n**Expected behavior**\r\nvitepress should properly compile with Vue v3.1\r\n\r\n**System Info**\r\n- vitepress version: 0.14\r\n- vite version: 2.3.4\r\n- Node version: 14.17\r\n- OS version: macOS\r\n",[2932],{"name":2902,"color":2903},311,"Functional templates errors with vue v3.1","2023-01-21T16:22:22Z","https://github.com/vuejs/vitepress/issues/311",0.6929267,{"description":2939,"labels":2940,"number":2941,"owner":2860,"repository":2861,"state":2874,"title":2942,"updated_at":2943,"url":2944,"score":2945},"### Is your feature request related to a problem? Please describe.\r\n\r\nIn order to create good documentation of a standalone Vue component, we want to show many usage examples.\r\n\r\nEvery usage example is a Vue file.\r\n\r\nWe need to be able to import a Vue file in Vitepress, show its source code as CodeBlock.\r\n- Not just a single code block like you can already do in Vitepress, but a Codeblock with tabs on top that split up the source code in `template` / `script` / `style` tabs.\r\n- Also, another tab should say `example` rendering the actual imported Vue component.\r\n\r\n\r\n### Describe the solution you'd like\r\n\r\nThe ideal syntax would look something like this:\r\n```html\r\n\u003CCodeBlockComponent filename=\"blitz-form/Basics - Basic Example\" />\r\n```\r\nAnd here is a video of how it would render in Vitepress:\r\n\r\nhttps://user-images.githubusercontent.com/3253920/140631280-adae2d0b-47d9-4172-b105-f6f4ee5f41f4.mp4\r\n\r\n(I have styled this a little bit to fit my docs style, but of course the styling can be way more bare-bones and we can overwrite the styling with CSS.)\r\n\r\n\r\n\r\n### Describe alternatives you've considered\r\n\r\nI actually already finished this feature for VitePress. I created my custom solution.\r\n\r\nUnder the hood I'm using a combination of these import methods:\r\n```js\r\nimport(`../docs/${filename}.vue`) // for the component\r\n// and\r\nimport(`../docs/${filename}.vue?raw`) // for the source code\r\n```\r\n\r\n~~Everything works when I'm using the VitePress development server. However, as soon as I build and deploy my code to a hosting service, all the Code Blocks break.~~\r\n\r\n~~I searched a lot for solutions, but this is not my strongest point. This past week I tried a bunch of things but still haven't found out how to make it work.~~\r\n\r\n(See next comment, where I explain how I fixed it)\r\n\r\n### Additional context\r\n\r\nI would love to request for an official solution for what I'm trying to do.\r\n\r\nI believe a lot of developers who want to share a Vue component and whip up a quick VitePress documentation about their component, would love this feature.\r\n\r\n### Validations\r\n\r\n- [X] Follow our [Code of Conduct](https://vuejs.org/coc)\r\n- [X] Read the [docs](https://vitepress.vuejs.org/).\r\n- [X] Read the [Contributing Guidelines](https://github.com/vuejs/vitepress/blob/master/.github/contributing.md).\r\n- [X] Check that there isn't already an issue that reports the same bug to avoid creating a duplicate.",[],437,"FR: Code Block that renders Vue file component and source code","2023-01-29T00:04:23Z","https://github.com/vuejs/vitepress/issues/437",0.6945247,{"description":2947,"labels":2948,"number":2949,"owner":2860,"repository":2861,"state":2874,"title":2950,"updated_at":2951,"url":2952,"score":2953},"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.69815505,["Reactive",2955],{},["Set"],["ShallowReactive",2958],{"$fTRc1wZytZ_XrK4EfJfei_Sz-An4H4Yy6syhVxH_PVJc":-1,"$fhjw-U-zkdGMQzkEEKkEUtd_ogME1eTqv0XjQWLFOvAs":-1},"/vuejs/vitepress/135"]