File Include
About 120 wordsLess than 1 minute
2026-08-31
The file include syntax allows embedding entire external files, specified line ranges, or named regions directly into your Markdown document.
Include Whole File
Use the HTML comment directive format:
<!-- @include: ../snippets/prerequisites.md -->Include Specific Line Ranges
Import only lines 10 through 25 of a source file:
<!-- @include: ../../src/config/siteConfig.ts{10-25} -->Include Named Regions
Mark code blocks with #region and #endregion comments:
src/example.ts
// #region auth-config
export const authConfig = {
enabled: true,
provider: 'github',
};
// #endregionReference the region in your document:
<!-- @include: ../../src/example.ts#auth-config -->Build Characteristics
- Includes resolve statically at compile time with zero runtime JavaScript footprint.
- Syntax highlighting and line numbers preserve full fidelity.
Copyright
Copyright Ownership:matsuzaka-yuki
License under:Attribution 4.0 International (CC-BY-4.0)