Include

Attention 💥

Support since v0.2.12.

The include app is for including source file and wrapped it as markdown code block.

The language is automatically detected by the file name extension. You can override it by passing lang option. The file path should be relative to book root directory.

Options

OptionDescriptionRequiredDefault
fileFile to include, relative to book root directoryYes- -
langThis will override the automatically detected languageNo- -
rangeRange of lines to include, e.g. 1-10 or 1- or -10No- -
typeInclude type, cloud be raw or codeblockNocodeblock

Attention 💥

  • When range is used, it will insert the specified lines starts from 1.
  • The raw type will insert the raw file content into the markdown file directly, while the codeblock type will wrap it as a code block.

Example

{% embed include file="src/SUMMARY.md" %}

This will include the src/SUMMARY.md file and wrap it as a markdown code block which is the source code of this book’s summary.

# Summary

# Basics

- [Intro](index.md)
- [Usage](usage.md)
- [More Apps](more-apps.md)
- [Global Embedding](global-embedding.md)
- [Ignore Embeds](ignore-embeds.md)

# Apps

- [Third Party Apps](third-party/index.md)
  - [Gist](third-party/gist.md)
  - [Vimeo](third-party/vimeo.md)
  - [Giscus](third-party/giscus.md)
  - [Youtube](third-party/youtube.md)
  - [Codepen](third-party/codepen.md)
  - [Stackblitz](third-party/stackblitz.md)
  - [Codesandbox](third-party/codesandbox.md)
  - [Bilibili](third-party/bilibili.md)
- [Local Apps](local/index.md)
  - [Footer](local/footer.md)
  - [Include](local/include.md)
  - [Scroll to Top](local/scroll-to-top.md)
  - [Announcement Banner](local/announcement-banner.md)

Copyright © 2025 • Created with ❤️ by MR-Addict