File tree Expand file tree Collapse file tree 1 file changed +25
-0
lines changed
packages/docs/docs/zh/guide Expand file tree Collapse file tree 1 file changed +25
-0
lines changed Original file line number Diff line number Diff line change @@ -346,6 +346,31 @@ module.exports = {
346346由于代码段的导入将在 webpack 编译之前执行,因此你无法使用 webpack 中的路径别名,此处的 ` @ ` 默认值是 ` process.cwd() ` 。
347347:::
348348
349+
350+ 为了只导入对应部分的代码,你也可运用 [ VS Code region] ( https://code.visualstudio.com/docs/editor/codebasics#_folding ) 。你可以在文件路径后方的 ` # ` 紧接着提供一个自定义的区域名称(预设为 ` snippet ` )
351+
352+ ** 输入**
353+
354+ ``` md
355+ <<< @/../@vuepress/markdown/__tests__/fragments/snippet-with-region.js#snippet{1}
356+ ```
357+
358+ ** 代码文件**
359+
360+ <!-- lint disable strong-marker-->
361+
362+ <<< @/../@vuepress/markdown /__ tests__ /fragments/snippet-with-region.js
363+
364+ <!-- lint enable strong-marker-->
365+
366+ ** 输出**
367+
368+ <!-- lint disable strong-marker-->
369+
370+ <<< @/../@vuepress/markdown /__ tests__ /fragments/snippet-with-region.js#snippet{1}
371+
372+ <!-- lint enable strong-marker-->
373+
349374## 进阶配置
350375
351376VuePress 使用 [ markdown-it] ( https://github.com/markdown-it/markdown-it ) 来渲染 Markdown,上述大多数的拓展也都是通过自定义的插件实现的。想要进一步的话,你可以通过 ` .vuepress/config.js ` 的 ` markdown ` 选项,来对当前的 ` markdown-it ` 实例做一些自定义的配置:
You can’t perform that action at this time.
0 commit comments