Registry / web-framework / mkdocs-markdownextradata-plugin

mkdocs-markdownextradata-plugin

JSON →
library0.2.6pypypiunverified

A MkDocs plugin that injects the mkdocs.yml extra variables into the markdown template, also supporting external data files via jinja2 templating. Current version 0.2.6, requires Python >=3.6, maintained with sporadic releases.

pip install mkdocs-markdownextradata-plugin
INSTALL
IMPORT
SIG · MKDOCS-MARKDOWNEXT
M
mkdocs-markdownextradata-plugin
web-frameworkpythonv0.2.6
Install
2.9s avg
Import
Disk
32MB
Pass rate
10/ 10
Env Coverage10 / 10
glibc
3.93.13
musl
3.93.13
Install & Compatibility
Where this runs
tested against v0.2.6 · pip install
no network on importno background threads
Install × environment matrix
Each cell = how many times install + import succeeded across repeated harness runs. Partial = flaky.
glibc = Debian/Ubuntu slim · musl = Alpine Linux
musl
py 3.103.95 runs
installs and imports cleanly · install 0.0s · import 0.000s · 33MB
glibc
py 3.103.95 runs
installs and imports cleanly · install 2.9s · import 0.000s · 34MB
32MB installed
● package 32MB
Code
Verified usage

Verified import paths — ran on the pinned version, not inferred.

MarkdownExtraDataPlugin
from markdownextradata.plugin import MarkdownExtraDataPlugin
from markdownextradata import MarkdownExtraDataPlugin

Enable the plugin in mkdocs.yml. Create a `_data` folder with YAML/JSON files (e.g., `_data/mydata.yaml`). Reference variables as `{{ mydata_key }}` in markdown.

# mkdocs.yml plugins: - markdownextradata: data_source_folders: "_data" # Markdown file (e.g., index.md) # {{ extra['my_var'] }} or {{ my_var }} if defined in mkdocs.yml extras
Debug
Known issues
breakingThe plugin uses `on_page_markdown` hook, which causes incompatibility with other plugins that also use that hook unless ordering is manually set.
fix
Set `priority` in mkdocs.yml plugin config (e.g., priority: 50) or use `plugins: { markdownextradata: { ... }, search: { ... } }` with explicit order.
affects: >=0.1.7
gotchaVariable in template references `extra.` prefix only for values defined in mkdocs.yml `extra:`; for data files, use the filename without extension as variable name.
fix
For `_data/team.yaml` with key `members`, use `{{ team.members }}` not `{{ extra.team.members }}`.
affects: all
gotchaData source folder names starting with a number (e.g., `1_data.yaml`) are not read correctly.
fix
Upgrade to >=0.2.4 or rename files to not start with a digit.
affects: <0.2.4
Upgrade
Version history
0.2.6latest on PyPI · released Aug 22, 2024
Audit
Dependencies
mkdocsrequiredRequired plugin host
jinja2requiredTemplate rendering engine
pyyamlrequiredYAML parsing for extra files
Agent activity
16 hits · last 30 days
node
14
Resources
mkdocs-markdownextradata-plugin — pip install mkdocs-markdownextradata-plugin · libregistry