Include
Reuse content from other files.
Usage
Markdown
To display content from another Markdown/MDX file, specify its path relative to the file itself in the <include>
tag.
<include>./another.mdx</include>
For Markdown files, you don't need to escape for MDX syntax but note that
you'll need rehypeRaw
for HTML comments & content.
CodeBlock
For other types of files, it will become a codeblock:
<include>./script.ts</include>
<include lang="md" meta='title="lib.md"'>
page.md
</include>
cwd
Resolve relative paths from cwd instead of the Markdown file:
<include cwd lang="tsx" meta='title="lib.ts"'>
./script.ts
</include>
Section
For Markdown files, you can include a section of it:
## Hello World
<section id="test">This is included</section>
This is not included.
<include>a.mdx#test</include>
Or with heading id:
## Included Section
I'm here!
## Not Included
Some random text.
<include>a.mdx#included-section</include>
How is this guide?
Last updated on