\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.",[2867],{"name":2868,"color":2869},"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.6973834,{"description":2879,"labels":2880,"number":2881,"owner":2871,"repository":2872,"state":2873,"title":2882,"updated_at":2883,"url":2884,"score":2885},"### Is your feature request related to a problem? Please describe.\n\nWhen using Vue templates, the Markdown renderer processes them correctly and compiles them. However, in the title, sidenav, and local search (path), the Vue templates are not rendered and are displayed as raw templates.\n\n\u003Cimg width=\"537\" alt=\"Image\" src=\"https://github.com/user-attachments/assets/db835d1f-1084-41c9-bf1c-aa329f4609eb\" />\n\n\u003Cimg width=\"308\" alt=\"Image\" src=\"https://github.com/user-attachments/assets/0e1beb6b-d06b-436c-b106-c924fead87ab\" />\n\n\u003Cimg width=\"931\" alt=\"Image\" src=\"https://github.com/user-attachments/assets/aef6f71a-fa28-4b7c-b512-e6386e18159a\" />\n\n### Describe the solution you'd like\n\nIn my [pull request](https://github.com/vuejs/vitepress/pull/4630), I've introduced custom components that can be overridden in the `enhanceApp` function. In these custom components, I can add custom logic for rendering text, such as using the Vue compile function. \n\nAdditionally, I added a flag to skip the title update, allowing for custom logic implementation. \n\nPlease also see my PR: [https://github.com/vuejs/vitepress/pull/4630](https://github.com/vuejs/vitepress/pull/4630).\n\n### Describe alternatives you've considered\n\n_No response_\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] 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.",[],4637,"Sidenav Components / Skip title update","2025-03-20T12:17:14Z","https://github.com/vuejs/vitepress/issues/4637",0.71814793,{"description":2887,"labels":2888,"number":2889,"owner":2871,"repository":2872,"state":2890,"title":2891,"updated_at":2892,"url":2893,"score":2894},"### Is your feature request related to a problem? Please describe.\n\nwhen we write a guide docs.\r\nWe need a goup of code blocks to tell user how to do something.\r\nIf surpport code group I will become quite convenient.\n\n### Describe the solution you'd like\n\nI prefer nuxt's solution like the following\r\n\r\nUI:\r\nhttps://v3.nuxtjs.org/guide/directory-structure/layouts#overriding-a-layout-on-a-per-page-basis\r\n\r\n\r\nGrammar:\r\nhttps://github.com/nuxt/framework/blob/d135608ef0d607259c0ae6f5156c8f46ff78ddc3/docs/content/2.guide/3.directory-structure/7.layouts.md?plain=1#L140-L175\n\n### Describe alternatives you've considered\n\n_No response_\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.",[],1043,"closed","code group surpport","2023-01-21T14:30:14Z","https://github.com/vuejs/vitepress/issues/1043",0.66735166,{"description":2896,"labels":2897,"number":2898,"owner":2871,"repository":2872,"state":2890,"title":2899,"updated_at":2900,"url":2901,"score":2902},"### 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.6739273,{"description":2904,"labels":2905,"number":2906,"owner":2871,"repository":2872,"state":2890,"title":2907,"updated_at":2908,"url":2909,"score":2910},"### Is your feature request related to a problem? Please describe.\r\n\r\nCode block title requires a code group. I like to put for example a file name as the title.\r\n\r\n### Describe the solution you'd like\r\n\r\nAllow specifying titles for code blocks outside of code groups, using the existing syntax.\r\n\r\n```\r\n```js [main.js]\r\nconsole.log(\"Hello World\")\r\n````\r\n\r\n(do code blocks not work here?)\r\n\r\n### Describe alternatives you've considered\r\n\r\n_No response_\r\n\r\n### Additional context\r\n\r\nI saw support for single code block titles being mentioned in the comments of an old issue discussing the implementation of the feature for code groups, but as far as I can tell, it never made it.\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.",[],4027,"Code block title without code group","2024-07-16T04:42:13Z","https://github.com/vuejs/vitepress/issues/4027",0.67881274,{"description":2912,"labels":2913,"number":2914,"owner":2871,"repository":2872,"state":2890,"title":2915,"updated_at":2916,"url":2917,"score":2918},"### 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.680931,{"description":2920,"labels":2921,"number":2925,"owner":2871,"repository":2872,"state":2890,"title":2926,"updated_at":2927,"url":2928,"score":2929},"### 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.",[2922],{"name":2923,"color":2924},"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.68750435,{"description":2931,"labels":2932,"number":2933,"owner":2871,"repository":2872,"state":2890,"title":2934,"updated_at":2935,"url":2936,"score":2937},"### Is your feature request related to a problem? Please describe.\n\n1.希望code代码块在切换暗黑模式下,没有任何色差变化。\r\n而整个页面都发生了变化,就连自定义容器都发生了变化,唯独代码块没有任何变化。\r\nvue官方文档中,切换时,背景颜色发生变化了。\r\n2.切换模式下,背景颜色变化过快\n\n### Describe the solution you'd like\n\n1.加上颜色差的变化,因为整个页面的color颜色都变化 就code代码块未发生变化,最好字体 color 颜色也加上个色差变化\r\n2.加入下淡入淡出的动画效果,点击切换过快的颜色变化,眼睛有极大伤害\n\n### Describe alternatives you've considered\n\n_No response_\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] 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.",[],2763,"vitepress在暗黑模式中code代码块希望也加入暗黑模式","2023-08-17T00:04:10Z","https://github.com/vuejs/vitepress/issues/2763",0.70087045,{"description":2939,"labels":2940,"number":2944,"owner":2871,"repository":2872,"state":2890,"title":2945,"updated_at":2946,"url":2947,"score":2948},"### Describe the bug\n\nI found in `vue-html` code blocks + line number mode, there is no `line-numbers-mode` CSS class on the div wrapper, which leads to the layout bug like below:\r\n\r\n\r\n\r\n\r\n\n\n### Reproduction\n\n`index.md`:\r\n\r\n```\r\n\\```html\r\n\u003Cdiv id=\"event-handling\">\r\n \u003Cp>{{ message }}\u003C/p>\r\n \u003Cbutton v-on:click=\"reverseMessage\">Reverse Message\u003C/button>\r\n\u003C/div>\r\n\\```\r\n\r\n\\```vue-html\r\n\u003Cdiv id=\"event-handling\">\r\n \u003Cp>{{ message }}\u003C/p>\r\n \u003Cbutton v-on:click=\"reverseMessage\">Reverse Message\u003C/button>\r\n\u003C/div>\r\n\\```\r\n```\r\n\r\n`.vitepress/config.js`:\r\n\r\n```\r\nmodule.exports = () => ({\r\n markdown: {\r\n lineNumbers: true\r\n }\r\n})\r\n```\n\n### Expected behavior\n\nBy manually adding the CSS class in devtools, it goes normal.\r\n\r\n\r\n\r\n\r\n\n\n### System Info\n\n```shell\nSystem:\r\n OS: macOS 13.0\r\n CPU: (8) arm64 Apple M1\r\n Memory: 130.56 MB / 8.00 GB\r\n Shell: 5.8.1 - /bin/zsh\r\n Binaries:\r\n Node: 16.14.2 - ~/.nvm/versions/node/v16.14.2/bin/node\r\n Yarn: 1.22.18 - ~/.yarn/bin/yarn\r\n npm: 8.5.0 - ~/.nvm/versions/node/v16.14.2/bin/npm\r\n Browsers:\r\n Chrome: 103.0.5060.134\r\n Safari: 16.0\r\n npmPackages:\r\n vitepress: 1.0.0-alpha.4 => 1.0.0-alpha.4\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.vuejs.org).\n- [X] Check that there isn't already an issue that reports the same bug to avoid creating a duplicate.",[2941],{"name":2942,"color":2943},"build","377ba8",1105,"The layout of vue-html code block in line number mode","2023-01-21T14:28:55Z","https://github.com/vuejs/vitepress/issues/1105",0.71034545,{"description":2950,"labels":2951,"number":2955,"owner":2871,"repository":2872,"state":2890,"title":2956,"updated_at":2957,"url":2958,"score":2959},"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",[2952],{"name":2953,"color":2954},"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.71108544,["Reactive",2961],{},["Set"],["ShallowReactive",2964],{"$fTRc1wZytZ_XrK4EfJfei_Sz-An4H4Yy6syhVxH_PVJc":-1,"$f009g9BiXL2gMMtlcJTmGgqorivW71KKOai8Hkf6a_VQ":-1},"/vuejs/vitepress/728"]