MkDocs Include Markdown Plugin

7.2.2 · active · verified Mon Apr 13

The mkdocs-include-markdown-plugin enhances MkDocs by allowing users to include content from other Markdown files, or parts of files, directly into their pages. It supports various features like fragment inclusion, heading offset, and line ranges. The current version is 7.2.2, with active development and frequent minor releases.

Warnings

Install

Imports

Quickstart

To use the plugin, first install it. Then, enable it in your `mkdocs.yml` file under the `plugins` section. Create a Markdown file (e.g., `docs/index.md`) and use the `{!include path/to/file.md!}` syntax to embed content from another Markdown file (e.g., `docs/includes/snippet.md`).

# mkdocs.yml
site_name: My Docs
plugins:
  - include-markdown

# docs/index.md
# This is your main Markdown file
---
# Welcome

This is the main content of my document.

Here's some content included from another file:

{!include includes/snippet.md!}

---

# docs/includes/snippet.md
# This is the file to be included
---
## Included Section

This text comes from 'includes/snippet.md'.

It can contain any Markdown.

view raw JSON →