You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Copy file name to clipboardexpand all lines: docs/guide/markdown.md
+7
Original file line number
Diff line number
Diff line change
@@ -226,6 +226,8 @@ export default {
226
226
227
227
## Import Code Snippets
228
228
229
+
You can import code snippets from existing files via following syntax:
230
+
229
231
**Input**
230
232
231
233
```
@@ -236,6 +238,11 @@ export default {
236
238
237
239
<<< @/test/markdown/fragments/snippet.js{2}
238
240
241
+
::: tip
242
+
Since the import of the code snippets will be executed before webpack compilation, so you can't use the path alias in webpack. the default value of `@` is `process.cwd()`.
243
+
:::
244
+
245
+
239
246
## Advanced Configuration
240
247
241
248
VuePress uses [markdown-it](https://github.com/markdown-it/markdown-it) as the markdown renderer. A lot of the extensions above are implemented via custom plugins. You can further customize the `markdown-it` instance using the `markdown` option in `.vuepress/config.js`:
0 commit comments