mkdocs-macros-plugin
Unleash the power of MkDocs with macros and variables
Decision gist · record as of 2026-08-14
Yes. The plugin is actively maintained, widely adopted (2K+ dependent repositories), has zero known vulnerabilities, and installs with low friction. It is production-stable and well-suited for documentation projects that benefit from templating—particularly those needing dynamic content, reusable blocks, or custom syntax. Install it if your MkDocs site requires variables, macros, or conditional rendering.AI-flagged interpretation of the facts on this page — verify before relying
Before you install
- Requires MkDocs >= 1.0 and Python >= 3.8.
- The plugin must be declared in mkdocs.yml to function.
- Low friction installation with a pure Python wheel.
License · maintenance · safety
MIT (permissive) — MIT license permits unrestricted use, modification, and distribution with minimal restrictions, making it safe for both open-source and commercial documentation projects.
last release 2025-11-13 (274 days) · last repo commit 2026-05-03 · 410 stars
0 known vulnerabilities (OSV.dev, 2026-08-14) · 2,467,826 downloads/mo, #3,053 on PyPI
Alternatives
Verify before relying
pip install mkdocs-macros-plugin
Then in mkdocs.yml:
plugins:
- search
- macros
In a markdown page:
{{ unit_price }} EUR
{{ price(unit_price, 50) }} EUR- Whether custom macro functions defined in main.py are automatically discovered or require explicit registration
- Performance impact when processing large documentation sites with many variables and macros
- Compatibility with MkDocs themes that have custom template rendering pipelines
What it is and what it does
mkdocs-macros-plugin transforms MkDocs markdown pages into Jinja2 templates, allowing you to embed variables, call Python functions as macros, and use conditional logic and loops directly in your documentation. Variables can be defined globally in mkdocs.yml or external YAML files, or locally within individual pages; macros and custom filters are written as Python functions and invoked as template directives. The plugin also supports pluglets—lightweight Python packages that extend functionality without requiring separate MkDocs plugins.
This is useful when your documentation needs dynamic content (pricing tables, version-specific instructions, generated lists), reusable content blocks, or custom HTML extensions (buttons, embeds, formatted callouts). The plugin handles undefined variables gracefully by default but can be configured to fail strictly. It integrates into the standard MkDocs build pipeline and is listed as a high-quality plugin in the official MkDocs catalog.
Use it for
- Generate pricing or product tables with formulas applied to base values using macro functions
- Maintain version-specific documentation by conditionally rendering sections based on variables
- Create reusable content snippets (e.g., common disclaimers, formatted code examples) via macros
- Embed custom HTML elements (buttons, video embeds, styled callouts) without writing raw HTML
- Build pluglets to package and share documentation extensions across multiple MkDocs projects
Worth the install?
AI-flagged interpretation of the facts on this page. Verify before relying on it.
Yes.
The plugin is actively maintained, widely adopted (2K+ dependent repositories), has zero known vulnerabilities, and installs with low friction. It is production-stable and well-suited for documentation projects that benefit from templating—particularly those needing dynamic content, reusable blocks, or custom syntax. Install it if your MkDocs site requires variables, macros, or conditional rendering.
Install
mkdocs-macros-plugin on PyPI
Before you install
Low friction installation with a pure Python wheel. Active maintenance with a recent release and 410 repository stars. Supports Python 3.8 through 3.12 and integrates cleanly into MkDocs 1.0+.
Requires MkDocs >= 1.0 and Python >= 3.8. The plugin must be declared in mkdocs.yml to function.
License in practice
MIT license permits unrestricted use, modification, and distribution with minimal restrictions, making it safe for both open-source and commercial documentation projects.
Quickstart
pip install mkdocs-macros-plugin
Then in mkdocs.yml:
plugins:
- search
- macros
In a markdown page:
{{ unit_price }} EUR
{{ price(unit_price, 50) }} EUR
Verify before relying
- Whether custom macro functions defined in main.py are automatically discovered or require explicit registration
- Performance impact when processing large documentation sites with many variables and macros
- Compatibility with MkDocs themes that have custom template rendering pipelines
Package facts
| License | MIT permissive |
| Python support | Supports the current Python release >=3.8 |
| Install friction | Low. Pure-Python wheel |
| Runtime dependencies | 10 packageshjsonjinja2mkdocspackagingpathspecpython-dateutilpyyamlrequestssuper-collectionstermcolor |
| Maintenance | Actively maintained 274 days since the last release |
| Last repo commit | |
| First released | |
| Downloads | 2,467,826 / month, #3,053 on PyPI 30-day window, as of 2026-08-14 |
| Known vulnerabilities | None known OSV.dev, checked 2026-08-14 |
| Classifiers | 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.12Programming Language :: Python :: 3.8Programming Language :: Python :: 3.9 |
Evidence: mkdocs_macros_plugin-1.5.0-py3-none-any.whl
Tags
Let your AI agent find packages like this
Example. Real query, live index.
You found this page by searching. An agent finds it by wishing: SkillFed indexes 14,416 PyPI packages by what they can do, searchable in plain language.
wish › “mkdocs variables and macros”
- mkdocs-macros-pluginExtends MkDocs with Jinja2 templating to use variables and macros in…
- mkdocs-markdownextradata-pluginInjects mkdocs.yml extra variables into markdown files before…
- mkdocs-llmstxtMkDocs plugin that generates an /llms.txt file at your documentation…
Give your agent the search over MCP, or paste the wish link into any chat.
More Documentation packages
Docutils converts plaintext documentation in reStructuredText format into multiple output formats including HTML, XML, and LaTeX using a modular processing system.
Sphinx generates professional documentation from reStructuredText source files, producing HTML, PDF, EPUB, and other formats with automatic cross-references, code highlighting, and hierarchical navigation.
Griffe extracts the complete structure and signatures of Python programs to generate API documentation or detect breaking changes in your project's public API.
Install it if you need to programmatically inspect Python code structure, generate API docs, or enforce API stability in CI.
A Sphinx extension that outputs documentation in serialized HTML formats (JSON and pickle) alongside standard HTML.
Alabaster is a clean, responsive Sphinx theme for documentation that requires Python 3.10 or newer and Sphinx 6.2 or newer.
A Sphinx extension that generates HTML help files from reStructuredText documentation source.
See also mkdocs-embed-external-markdown · mkdocs-markdownextradata-plugin · mkdocs-meta-manager · mkdocs-table-reader-plugin · mkdocs-video · copier-template-extensions · mkdocs-gen-files · mkdocs-simple-hooks · copier-templates-extensions · mkdocs