Skip to content

MkDocs Data Plugin

MkDocs Data Plugin is a plugin for MkDocs that allows reading data from markup files and use it in your Markdown pages.

Overview

When using this plugin, you can define data in YAML or JSON files in a separate directory and reference them in your Markdown pages.

root/
├── docs/
│   └── ...
├── data/
│   └── fruits.yml
└── mkdocs.yml
fruits.yml
- Apple
- Banana
- Strawberry

Files in this directory can be referenced in your Markdown files using the data variable.

{% for fruit in data.fruits -%}
- {{ fruit }}
{% endfor %}
  • Apple
  • Banana
  • Strawberry

Supported Formats

The plugin supports the following file formats:

  • JSON: .json
  • YAML: .yml, .yaml