\n\n### Reproduction\n\n{\n \"devDependencies\": {\n \"vitepress\": \"2.0.0-alpha.2\"\n },\n \"scripts\": {\n \"docs:dev\": \"vitepress dev docs\",\n \"docs:build\": \"vitepress build docs\",\n \"docs:preview\": \"vitepress preview docs\"\n }\n}\n\n### Expected behavior\n\n在被注释的代码行后面添加 `// [!code highlight]` 高亮的位置错误。\n\n```js\nexport default {\n data () {\n return {\n // msg1: '1 Highlighted!' // [!code highlight]\n }\n }\n}\n```\n\n\u003Cimg width=\"705\" alt=\"Image\" src=\"https://github.com/user-attachments/assets/f1f5e3ce-3bc6-4939-b199-d9ac120ffab8\" />\n\n\n### System Info\n\n```Text\nChrome: 132.0.6834.160\n```\n\n### Additional context\n\n_No response_\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.",[3080],{"name":3081,"color":3082},"upstream","BF29ED",4546,"代码高亮渲染异常","2025-02-23T04:43:37Z","https://github.com/vuejs/vitepress/issues/4546",0.70214087,{"description":3089,"labels":3090,"number":3091,"owner":3023,"repository":3024,"state":3042,"title":3092,"updated_at":3093,"url":3094,"score":3095},"### Is your feature request related to a problem? Please describe.\r\n\r\nMake configuration easier.\r\n\r\n### Describe the solution you'd like\r\n\r\nSame as [vite](https://vitejs.dev/config/#config-intellisense) :\r\n\r\n```ts\r\nimport { defineConfig } from 'vitepress'\r\n\r\nexport default defineConfig({\r\n lang: 'en-US',\r\n // ...\r\n}) \r\n``` \r\n\r\nBut we need to improve the support for theme config:\r\n\r\nBy default, `defineConfig` helper leverages the theme config type from default theme:\r\n\r\n```js\r\nimport { defineConfig } from 'vitepress'\r\n\r\nexport default defineConfig({\r\n themeConfig: {\r\n // Type is `DefaultTheme.Config` \r\n }\r\n})\r\n```\r\n\r\nIf you use a custom theme, you'll be able to pass the generics type for your custom theme, and you need overload it with the second parameter of `defineConfig` helper:\r\n\r\n```js\r\nimport { defineConfig } from 'vitepress'\r\nimport { ThemeConfig } from 'your-theme'\r\n\r\nexport default defineConfig\u003CThemeConfig>({\r\n themeConfig: {\r\n // Type is `ThemeConfig` \r\n }\r\n}, true); // declare `usingCustomTheme` and discard usage of the default theme.\r\n```\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/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.",[],464,"[Feature Request] Improve TypeScript support for config file.","2023-01-21T16:20:21Z","https://github.com/vuejs/vitepress/issues/464",0.70334667,{"description":3097,"labels":3098,"number":3099,"owner":3023,"repository":3024,"state":3042,"title":3100,"updated_at":3101,"url":3102,"score":3103},"- Add a new command: `vitepress init`\n - Users can invoke this after installing `vitepress` with `npx vitepress init`\n- Ask a few CLI questions:\n - Root of your markdown files (default: `cwd`)\n - Site title / description\n - Use the default theme / default theme + customization / complete custom theme?\n - Inject npm scripts? (should be based on root)\n- Scaffold the project in desired root\n - `.vitepress/config.js` with title, description, and a comment with link to app config docs\n - `example.md` with examples of built-in markdown features\n - If default theme:\n - `index.md` w/ example home page frontmatter\n - Example nav / sidebar config with links to `example.md` and VitePress docs\n - If default theme + customization: add `.vitepress/theme/index.js` and `.vitepress/theme/style.css` with theme slot and CSS var customization exmaples\n - If custom theme:\n - add `.vitepress/theme/index.s` + `.vitepress/theme/Layout.vue` for a simple custom theme example",[],1252,"Add initialization command","2023-03-10T00:04:39Z","https://github.com/vuejs/vitepress/issues/1252",0.7035142,{"description":3105,"labels":3106,"number":3107,"owner":3023,"repository":3024,"state":3042,"title":3108,"updated_at":3109,"url":3110,"score":3111},"Hi there,\r\n\r\nThe example in the documentation for customizing the theme does not work. It fails as the file/package cannot be found. This is the [specific line](https://github.com/vuejs/vitepress/blob/ea6cb00c3e9099d45fc236bff0f7c42a65d558dc/docs/guide/theming.md?plain=1#L97) that I am referring to, but I believe that the other lines that use this same thing will also fail.\r\n\r\nThe specific import that fails\r\n```javascript\r\nimport DefaultTheme from 'vitepress/theme'\r\n```\r\n\r\nI found an alternative import that works by looking into the downloaded node_module folder directly\r\n```javascript\r\nimport DefaultTheme from \"vitepress/dist/client/theme-default\";\r\n```\r\n\r\nIm not sure if this is the intended use or? If this is an actual issue, I can help with making a PR to update the docs, else if it is something that needs to be fixed with the deployment process so that the `DefaultTheme` can be exported from vitepress/theme then it would probably need help from someone else familiar with the process.\r\n\r\nThanks alot for your time!",[],442,"Example provided in theme documentation does not work","2023-01-21T16:20:15Z","https://github.com/vuejs/vitepress/issues/442",0.70667684,["Reactive",3113],{},["Set"],["ShallowReactive",3116],{"$fTRc1wZytZ_XrK4EfJfei_Sz-An4H4Yy6syhVxH_PVJc":-1,"$fCPn9f3e34LUtCm-YY8Mm5Hfv_Qc3Ed7BMctZet_reoM":-1},"/vuejs/vitepress/4806"]