skillfed

mkdocs-markdownextradata-plugin

A MkDocs plugin that injects the mkdocs.yml extra variables into the markdown template

mkdocs-markdownextradata-plugin v0.2.6 119.5K downloads/30d#12,071 on PyPI91
Permissive license MIT DORMANT released

What it is and what it does

This is a MkDocs plugin that makes the `extra:` variables defined in your mkdocs.yml available as Jinja2 template variables directly within your markdown files. Instead of only being able to use variables in HTML templates, you can now reference them in your .md content—useful for inserting client names, URLs, image paths, or other dynamic values that should vary across documentation builds.

The plugin supports both inline `extra:` configuration and external YAML/JSON data files. You can point it to one or more directories containing data files, and it will automatically load them and make their contents available as nested template variables. It also allows customization of Jinja2 delimiters and comment syntax, which helps when your markdown itself contains Jinja-like syntax that would otherwise collide with the template engine.

Use it for:

  • Build multi-tenant documentation where client names, domains, or branding vary per build by storing them in extra variables.
  • Maintain a single markdown source with placeholder variables for URLs, API endpoints, or configuration values that differ per environment.
  • Organize large documentation projects by splitting context data into multiple YAML files in a _data directory and referencing them in markdown.
  • Avoid duplicating content across documentation versions by using variables to swap out version-specific URLs or feature names.
  • Customize Jinja2 syntax to prevent template conflicts when your markdown contains code examples or documentation about Jinja2 itself.

Worth the install?

AI-flagged interpretation of the facts on this page — verify before relying

Injects mkdocs.yml extra variables into markdown files before rendering to HTML, allowing you to use template variables like {{ customer.name }} directly in your markdown content.

Yes, if you need to inject dynamic values into markdown content during MkDocs builds. The package is stable, has low install friction, and solves a real gap in MkDocs' templating model. Dormant maintenance is a minor concern—test compatibility with your MkDocs version before relying on it for production, but the simple scope and lack of security issues make it a low-risk choice.

Install

mkdocs-markdownextradata-plugin on PyPI

pip

pip install mkdocs-markdownextradata-plugin

uv

uv add mkdocs-markdownextradata-plugin

poetry

poetry add mkdocs-markdownextradata-plugin

Installing mkdocs-markdownextradata-plugin

Before you install

Low friction: pure Python wheel with only mkdocs and pyyaml as runtime dependencies. Maintenance is dormant (last release 722 days ago), but the repository remains active and the package is marked Production/Stable.

License in practice

MIT license permits commercial and private use with minimal restrictions; you must include a copy of the license and retain copyright notices.

Quickstart

pip install mkdocs-markdownextradata-plugin

# In mkdocs.yml:
plugins:
  - markdownextradata: {}

extra:
  customer:
    name: Your name

# In your .md file:
{{ customer.name }}

Requires MkDocs version 0.17 or higher.

Verify before relying

  • Whether the plugin works correctly with recent MkDocs versions (last release was 722 days ago).
  • Performance characteristics when loading large external data files or many YAML/JSON files from the data directory.

Package facts

License MIT (permissive)
Python support supports the current Python release (>=3.6)
Install friction low — pure-Python wheel
Runtime dependencies 2 — mkdocs, pyyaml
Maintenance dormant — 722 days since the last release
Last repo commit
First released
Downloads 119,509/month — #12,071 on PyPI (30-day window, as of 2026-08-14)
Known vulnerabilities none known (OSV.dev, checked 2026-08-14)

Evidence: mkdocs_markdownextradata_plugin-0.2.6-py3-none-any.whl

Keywords: mkdocs, python, markdown, extra, values

Development Status :: 5 - Production/StableIntended Audience :: DevelopersIntended Audience :: Information TechnologyLicense :: OSI Approved :: MIT LicenseProgramming Language :: PythonProgramming Language :: Python :: 3 :: OnlyProgramming Language :: Python :: 3.10Programming Language :: Python :: 3.11Programming Language :: Python :: 3.6Programming Language :: Python :: 3.7Programming Language :: Python :: 3.8Programming Language :: Python :: 3.9

Tags

mkdocs template variables in markdownmkdocs extra variables plugininject yaml data into markdownmkdocs markdown templatingmkdocs jinja2 markdownmkdocs dynamic content variablesmkdocs data file integration
mkdocs-plugintemplate-variablesstatic-site-generation

More Documentation packages

docutils

Docutils converts plaintext documentation in…

unclear · top 1,000 on PyPI

Sphinx

Sphinx generates professional documentation…

permissive · top 1,000 on PyPI

griffe

Griffe extracts the complete structure and…

permissive · top 1,000 on PyPI

sphinxcontrib-serializinghtml

A Sphinx extension that outputs documentation…

permissive · top 1,000 on PyPI

alabaster

Alabaster is a clean, responsive Sphinx theme…

permissive · top 1,000 on PyPI

sphinxcontrib-htmlhelp

A Sphinx extension that generates HTML help…

permissive · top 1,000 on PyPI

mkdocs-macros-plugin

Extends MkDocs with Jinja2 templating to use…

permissive · top 5,000 on PyPI

mkdocs-table-reader-plugin

A MkDocs plugin that inserts tables from…

permissive · top 15,000 on PyPI

mkdocs-embed-external-markdown

A MkDocs plugin that fetches and embeds…

permissive · top 15,000 on PyPI

mkdocs-video

A MkDocs plugin that embeds videos in…

permissive · top 15,000 on PyPI

mkdocs-include-markdown-plugin

A MkDocs plugin that includes content from…

permissive · top 15,000 on PyPI

yte

YTE is a YAML template engine that embeds…

permissive · top 15,000 on PyPI

markdown-exec

Executes code blocks embedded in Markdown files…

permissive · top 5,000 on PyPI

mkdocs-meta-manager

A MkDocs plugin that automatically applies meta…

permissive · top 5,000 on PyPI

mkdocs-awesome-pages-plugin

A plugin for MkDocs that lets you customize…

permissive · top 5,000 on PyPI

mkdocs-open-in-new-tab

A MkDocs plugin that injects JavaScript to…

permissive · top 15,000 on PyPI