From a55f84aebda27db0215fffde539920366206a66a Mon Sep 17 00:00:00 2001 From: Eulier Date: Thu, 7 Jul 2022 20:07:35 -0300 Subject: [PATCH] docs(guide): import & embed markdown's content --- docs/guide/markdown.md | 43 ++++++++++++++++++++++++++++++++++++++++++ 1 file changed, 43 insertions(+) diff --git a/docs/guide/markdown.md b/docs/guide/markdown.md index 39716fef..f3496948 100644 --- a/docs/guide/markdown.md +++ b/docs/guide/markdown.md @@ -388,6 +388,49 @@ You can also use a [VS Code region](https://code.visualstudio.com/docs/editor/co +## Import & Embed markdown's content + +When you need to combine multiple markdown content over a single markdown file, e.g. + +```vue + + +# Docs + +## Basics + +{{ basics }} + +## API Reference + +{{ reference }} +``` + +Replace curly brackets with `@include`, +the pathname with the extension, +surrounded by `` sintax + +```vue + + +# Docs + +## Basics + +< !--@include:./parts/basics.md--> + +## API Reference + +< !--@include:./parts/reference.md--> +``` + + ## Advanced Configuration VitePress 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 `.vitepress/config.js`: