mkdocs-data-plugin
November 25, 2024 · View on GitHub
MkDocs Data Plugin is a plugin for MkDocs that allows reading data from markup files and use it in your Markdown pages.
Currently supported formats:
- JSON:
.json - YAML:
.yml,.yaml
Documentation
This plugin documentation can be found here: https://joapuiib.github.io/mkdocs-data-plugin/
Installation
This plugin can be installed via pip:
pip install mkdocs-data-plugin
Configuration
Activate the plugin in your mkdocs.yml:
plugins:
- macros
- data
Overview
When using this plugin, you can define data in YAML or JSON files in a separate directory and reference them in your Markdown files.
root/
├── docs/
│ └── ...
├── data/
│ └── fruits.yml
└── mkdocs.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 %}