\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.6468066,{"description":2868,"labels":2869,"number":2873,"owner":2860,"repository":2861,"state":2874,"title":2875,"updated_at":2876,"url":2877,"score":2878},"\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",[2870],{"name":2871,"color":2872},"bug: pending triage","e99695",60,"closed","Is vitepress auto register components in `.vitepress/components`?","2023-01-21T16:25:31Z","https://github.com/vuejs/vitepress/issues/60",0.604714,{"description":2880,"labels":2881,"number":1224,"owner":2860,"repository":2861,"state":2874,"title":2885,"updated_at":2886,"url":2887,"score":2888},"Hello!\r\n\r\nDocumentation says \"...allowing the user to freely mix Vue components inside markdown content...\" but it doesn't work as VuePress.\r\n\r\nTo reproduce init project according to documentation.\r\nCreate `.vitepress/components/NewComponent.vue` with a `\u003Ctemplate>\u003Cp>Hello VitePress\u003C/p>\u003C/template>`\r\nTry to use `\u003CNewComponent />` inside index.md\r\n\r\nExpected to see rendered component on the page see nothing.\r\nConsole says \"Failed to resolve component: NewComponent\"\r\n\r\nWhat I'm doing wrong? ",[2882],{"name":2883,"color":2884},"question","5D5FAE","Cant figure out how to use components inside .md file","2023-01-21T16:24:22Z","https://github.com/vuejs/vitepress/issues/101",0.60769063,{"description":2890,"labels":2891,"number":2892,"owner":2860,"repository":2861,"state":2874,"title":2893,"updated_at":2894,"url":2895,"score":2896},"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.6197991,{"description":2898,"labels":2899,"number":2900,"owner":2860,"repository":2861,"state":2874,"title":2901,"updated_at":2902,"url":2903,"score":2904},"### Is your feature request related to a problem? Please describe.\r\n\r\nIssue 1: Is there a way or how to get the `md` instance (per-configured by VitePress) in Vue component\r\n- I know it might be impossible or being problematic because it's supposed to be run at build-time which is in Node.js, so I'm not expecting a yes answer here, but is there any better alternative way to do so?\r\n- Note due to some reason, I don't really want to write markdown straight away, instead I want to leverage the power of yaml format, and handle the transformation just once. (Since I don't want my team to ask me how to write certain md syntax with my custom component again and again, since `Vue in markdown` is not that straight forward for them). And defining API schemas by `yaml` makes more sense to me instead of writing markdown to document.\r\n\r\nIssue 2: I noticed that by my current implementation (see below), those data are not collected by `local (minisearch)` search. This might be because data collection is happening at build-time (not sure)? Is there any way to work around this?\r\n\r\n---\r\nMy use-case:\r\n\r\nImagine a custom layout here:\r\n```md\r\n---\r\nlayout: api # my custom layout\r\nrequests:\r\n - url: /getSecurityType\r\n method: post\r\n # ....\r\n\r\n - url: /getSecurityCategory\r\n method: post\r\n # ....\r\n---\r\n```\r\nFor example, I want to map the URL to `\u003Ch2>`, and also benefit from built-in VitePress features such as `aside`.\r\n\r\nBut I found out that normal h2 won't work, since `aside` is collecting only `h2` with children, which is the `#` link on the left by default. This makes sense, but it's a little bit hard for me to manually copy the dom.\r\n\r\nA comparison could be like:\r\nWhat I want:\r\n```vue\r\n\u003Cscript setup lang=\"ts\">\r\nimport { useData } from 'vitepress';\r\nimport { md } from '???'; // This is what I want\r\nimport type { ApiFrontMatter } from '@theme/types/api';\r\nimport type { VitePressData } from 'vitepress';\r\nimport type { Ref } from 'vue';\r\n\r\nconst { frontmatter: fm } = useData() as VitePressData & { frontmatter: Ref\u003CApiFrontMatter> };\r\n\u003C/script>\r\n\r\n\u003Ctemplate>\r\n \u003Cdiv class=\"vp-doc\">\r\n \u003Ch1>{{ fm.setName }}\u003C/h1>\r\n\r\n \u003Ctemplate v-for=\"req in fm.requests\" :key=\"req.url\">\r\n \u003C!-- md instance imported from somewhere (that's what I want) -->\r\n {{ md.render(`## ${req.url}`) }}\r\n \u003C/template>\r\n \u003C/div>\r\n\u003C/template>\r\n```\r\nCurrently, I have to mimic it (although it works for styles and aside, but search data collection ignores them):\r\n```vue\r\n\u003Cscript setup lang=\"ts\">\r\nimport { useData } from 'vitepress';\r\nimport type { ApiFrontMatter } from '@theme/types/api';\r\nimport type { VitePressData } from 'vitepress';\r\nimport type { Ref } from 'vue';\r\n\r\nconst { frontmatter: fm } = useData() as VitePressData & { frontmatter: Ref\u003CApiFrontMatter> };\r\n\u003C/script>\r\n\r\n\u003Ctemplate>\r\n \u003Cdiv class=\"vp-doc\">\r\n \u003Ch1>{{ fm.setName }}\u003C/h1>\r\n\r\n \u003Ctemplate v-for=\"req in fm.requests\" :key=\"req.url\">\r\n \u003Ch2 :id=\"req.url\">\r\n {{ req.url }}\r\n \u003Ca\r\n class=\"header-anchor\"\r\n :href=\"`#${req.url}`\"\r\n :aria-label=\"`Permalink to "${req.url}"`\"\r\n >\r\n ​\r\n \u003C/a>\r\n \u003C/h2>\r\n \u003C/template>\r\n \u003C/div>\r\n\u003C/template>\r\n```\r\n\r\n### Describe alternatives you've considered\r\n\r\nThe worst case is I need to write a custom `markdown-it` plugin and wrap all those yaml into a custom block and do the transformation there... But honestly that's gonna be a huge pain...\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.",[],2605,"How to get the `md` instance (include all plugins defined) to parse my custom string in Vue component?","2023-08-15T00:04:17Z","https://github.com/vuejs/vitepress/issues/2605",0.6370134,{"description":2906,"labels":2907,"number":2908,"owner":2860,"repository":2861,"state":2874,"title":2909,"updated_at":2910,"url":2911,"score":2912},"i want use vitepress become a ui component display website. so i import my sfc in enhanceApp. But at meantime i must config my own `Layout.vue` and `notfound.vue` component. That is not what i want. i liked defaulte theme (vuepress old player) very mush. \r\n\r\n```js\r\nimport Layout from '/@theme/Layout.vue';\r\nimport Helloworld from \"../components/index\"\r\n\r\nexport default {\r\n Layout,\r\n // NotFound,\r\n enhanceApp({ app, router, siteData }) {\r\n app.use(Helloworld) \r\n }\r\n}\r\n```\r\n\r\ni think `@theme/index` should not config default layout and enhanceApp at same time or in the same file. or at least it must follow `Convention over configuration` rule.\r\n\r\nif follow [vuepress default theme file system](https://github.com/vuejs/vuepress/tree/master/packages/%40vuepress/theme-default) and `Convention over configuration`, it will be better\r\n\r\nmaybe use `@theme/layouts/`, `@theme/components/`\r\n\r\nand here is a bug, when a create emptyfile `theme` in `.vitepress` .it will crash",[],58,"want more flexibility in the customization part","2023-01-21T16:20:20Z","https://github.com/vuejs/vitepress/issues/58",0.646582,{"description":2914,"labels":2915,"number":2916,"owner":2860,"repository":2861,"state":2874,"title":2917,"updated_at":2918,"url":2919,"score":2920},"Here's the vitepress project: https://github.com/grammyjs/grammy\r\n\r\nI'm creating `/site/docs/.vuepress/components/SomeComponent.vue` and trying to import it in `/site/docs/guide/README.md` this way:\r\n\r\n```html\r\n\u003Cscript setup>\r\n import SomeComponent from '../components/SomeComponent.vue'\r\n\u003C/script>\r\n```\r\n\r\nBut I'm getting this:\r\n\r\n\r\n\r\nHow should the custom component be imported?",[],535,"How should one import an SFC in a markdown file?","2023-01-21T16:20:07Z","https://github.com/vuejs/vitepress/issues/535",0.6535652,{"description":2922,"labels":2923,"number":2924,"owner":2860,"repository":2861,"state":2874,"title":2925,"updated_at":2926,"url":2927,"score":2928},"**Is your feature request related to a problem? Please describe.**\r\nCurrently, importing Vue components (whether they are VitePress components, or components from a library for example) are influenced by VitePress's somewhat sub-optimal styles.\r\n\r\nFor example, all headings are styled, so as soon as a component uses an `h1`/`h2`/etc, it will inherit those styles, making VitePress virtually unusable for component libraries that ship their own CSS.\r\n\r\nThe only I can think of mitigating this, is to use a web component as a base for Vue components to be mounted in, as styles are local to web components if I remember correctly.\r\n\r\n**Describe the solution you'd like**\r\nSome way to render components with their own styles, and not inherit styles from the docs.\r\n\r\n**Describe alternatives you've considered**\r\nI tries unsetting all styles `* { all: unset; }` inside our demo component (the wrapper for all other components), but that also removes some of the Tailwind related styling unfortunately.\r\n\r\nI couldn't get web components to work, as the vue plugin seems to be for Vue 2 (https://github.com/vuejs/vue-web-component-wrapper).",[],248,"[Feature] - Allow local styling of components","2023-01-21T16:04:20Z","https://github.com/vuejs/vitepress/issues/248",0.66630334,{"description":2930,"labels":2931,"number":217,"owner":2860,"repository":2861,"state":2874,"title":2932,"updated_at":2933,"url":2934,"score":2935},"**Describe the bug/feature**\r\n\r\nIn both **Vitepress** and **Vuepress** the way in which the Markdown-it rule `htmlBlock` is implemented is highly subpar. This is particularly true because the primary use-case for both is documentation but currently adding in a VueJS component which takes advantage of slot content tends to break rather quickly. This is because -- by default web-components are considered _inline_ components by Markdown (as per the spec). When Markdown encounters inline components it treats the interior scope of the web-component as Markdown content and therefore tends to wreck havoc on slot content.\r\n\r\nLooking at the `src/node/markdown/plugins/component.ts` file you can start to see the problem when looking at the `HTML_SEQUENCES` symbol (some lines removed for brevity):\r\n\r\n```ts\r\n// An array of opening and corresponding closing sequences for html tags,\r\n// last argument defines whether it can terminate a paragraph or not\r\nconst HTML_SEQUENCES: [RegExp, RegExp, boolean][] = [\r\n // PascalCase Components\r\n [/^\u003C[A-Z]/, />/, true],\r\n // custom elements with hyphens\r\n [/^\u003C\\w+\\-/, />/, true],\r\n]\r\n```\r\n\r\nThe intent here is to mark the opening and closing of scope for a component but as you can see from the RegEx it is only looking for inline components not block components!\r\n\r\nFor example, the component `p-table` has several named slots which help it to render the way the user intends:\r\n\r\n```html\r\n\u003Cp-table>\r\n \r\n \u003Ctemplate #name=\"{ row }\">\r\n {{ row.name }}\r\n \u003C/template>\r\n\r\n \u003Ctemplate #age=\"{ row }\">\r\n {{ row.age }}\r\n \u003C/template>\r\n\r\n\u003C/p-table>\r\n```\r\n\r\nPut this into the template section of a Vue CLI app and it works just fine. Put it into Vuepress or Vitepress and watch the cloud of smoke start to rise as it fumbles around; particularly failing on the `#` symbols used as shorthand for named slots. This is particularly troublesome for a documentation site that is trying to document a set of VueJS components! There should be a way to ensure that this VueJS component's interior scope is left untouched by **Markdown-it** ... at least when that's what you want. \r\n\r\nThere is a second use-case that I would expect Vitepress to just handle and that is _kind of_ what it's doing today but in a hit and miss fashion currently. Let's say that I just have a default slot in my component and therefore I want my component to be seen by the Markdown engine as being an \"inline\" component and process the interior as markdown. Great, then the following should work:\r\n\r\n```md\r\n\u003Csuper-sexy>\r\n# some heading\r\n## some sub heading\r\n\u003C/super-sexy>\r\n```\r\n\r\nThis would just provide some HTML wrapper elements that would in this case make this very dull markdown sexy.\r\n\r\nFinally there is a third use-case that really should be considered required too ... this is the hybrid but it will allow for all sorts of simple but useful documentation components. The use-case presents as a component that exposes named slots -- and therefore is seen by Markdown as a block component -- but these named slots _are_ processed by markdown. An obvious example might be a `\u003Ctwo-columns>` component which provides a `left` and `right` slot and allows authors to more readily leverage their horizontal space.\r\n\r\nImagine the following:\r\n\r\n```html\r\n\u003Ctwo-columns>\r\n\r\n \u003Ctemplate #left>\r\n I'm a lumberjack and I'm ok\r\n \u003C/template>\r\n \u003Ctemplate #right>\r\n I sleep all night and I work all day\r\n \u003C/template>\r\n\r\n\u003C/two-columns>\r\n```\r\n \r\nThis will fail miserably today but it _could_ be grand!\r\n\r\n** Proposed Solution **\r\n\r\nRework the `src/node/markdown/plugins/components.ts` file in Vitepress (same change can be applied to Vuepress) to:\r\n\r\n- use more sophisticated RegEx patterns to actually capture BLOCK content not just inline components\r\n- support two modes of processing for BLOCK VueJS components: \r\n\r\n 1. Isolated - the interior scope is _not_ processed as markdown and all registered VueJS components can operate exactly like they would normally do\r\n 2. Parsed - the interior scope is processed as markdown; this will work well for default slots where the interior content is Markdown content\r\n\r\n- the Isolated mode should be seen as the _default_ as it is more powerful and allows components that work outside the context of Vitepress/Vuepress to just work here as well\r\n- the parsed mode may be popular for components designed strictly for Vitepress and Vuepress and it could be opted into in the HTML template like so:\r\n\r\n ```html\r\n \u003Cmy-crazy-idea parsed>There I was, _there I was_, in the Congo\u003C/my-crazy-idea>\r\n ```\r\n\r\nThis solution so far could pretty easily support the first two use cases which is a big step forward. The third use-case would certainly be nice but would need a bit more thought. I could imagine something as simple as adding the `md` prop to the parent component being used as a means to pass in the Markdownit object into the top-level component so it could chain the rendering into the various named slots:\r\n\r\n ```html\r\n \u003Cmy-crazy-idea md>\r\n \u003Ctemplate #left>\r\n There I was, _there I was_, \r\n \u003Ctemplate #right>\r\n I sleep all night and I work all day\r\n \u003C/template>\r\n \u003C/my-crazy-idea>\r\n ```\r\n\r\nIn all likelihood this last option should be done as an optional second step.\r\n",[],"Proper processing of Vue Component slot content","2023-01-21T14:28:50Z","https://github.com/vuejs/vitepress/issues/135",0.6691445,{"description":2937,"labels":2938,"number":2939,"owner":2860,"repository":2861,"state":2874,"title":2940,"updated_at":2941,"url":2942,"score":2943},"### Is your feature request related to a problem? Please describe.\r\n\r\nThe markdown of the component is expected to be written under the packages, not in the docs directory.\r\n\r\nLike Dumi: https://d.umijs.org/\r\n\r\nThis will make our documentation more maintainable.\r\n\r\nThis is important when developing monorepo projects.\r\n\r\n### Describe the solution you'd like\r\n\r\nThe directory structure is as follows\r\n\r\n```bash\r\n├── docs/\r\n│ ├── .vitepress/\r\n│ │ ├── dist/\r\n│ │ └── config.js\r\n│ └── index.md\r\n├── packages/\r\n│ └── package-A/\r\n│ ├── dist/\r\n│ ├── node_modules/\r\n│ ├── src/\r\n│ │ ├── ...\r\n│ │ ├── func-A/\r\n│ │ │ ├── __tests__/ # Jest\r\n│ │ │ ├── demos/ # Vue Demos\r\n│ │ │ │ ├── Basic.vue # Example Component\r\n│ │ │ │ └── Timer.vue # Example Component\r\n│ │ │ ├── index.md # API Markdown ☞☞ Expectation: Doc documentation can be written here, can be compiled by vitepress, instead of having to be written in the docs directory\r\n│ │ │ └── index.ts # Source Code\r\n│ │ ├── ...\r\n│ │ └── index.ts\r\n│ ├── README.md\r\n│ ├── package.json\r\n│ ├── tsconfig.json\r\n│ └── typings.d.ts\r\n├── .editorconfig\r\n├── .eslintignore\r\n├── .eslintrc.js\r\n├── .fatherrc.ts\r\n├── .gitignore\r\n├── .npmrc\r\n├── .prettierignore\r\n├── .prettierrc\r\n├── README.md\r\n├── lerna.json\r\n├── package.json\r\n├── pnpm-lock.yaml\r\n├── pnpm-workspace.yaml\r\n└── tsconfig.json\r\n```\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.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.",[],987,"Documentation in the same style as dumi","2023-02-04T00:04:07Z","https://github.com/vuejs/vitepress/issues/987",0.66935694,["Reactive",2945],{},["Set"],["ShallowReactive",2948],{"$fTRc1wZytZ_XrK4EfJfei_Sz-An4H4Yy6syhVxH_PVJc":-1,"$fmnHJV_WeZymgBndymFvc6fsOCz8cTyt0097ui1pdhOo":-1},"/vuejs/vitepress/157"]