$npx skillfedfor your agent

mkdocs-macros-plugin

Unleash the power of MkDocs with macros and variables

Worth itPyPI DocumentationReleased Nov 20252.5M downloads / moMITPure Python

Decision gist · record as of 2026-08-14

pure-Python wheel — mkdocs_macros_plugin-1.5.0-py3-none-any.whl
v1.5.0 · released 2025-11-13 · Python >=3.8 · 10 runtime deps: hjson, jinja2, mkdocs, packaging, pathspec, python-dateutil, pyyaml, requests

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

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
Same gist for agents: .md · .json

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.

Worth 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

LicenseMIT permissive
Python supportSupports the current Python release >=3.8
Install frictionLow. Pure-Python wheel
Runtime dependencies
10 packages
hjsonjinja2mkdocspackagingpathspecpython-dateutilpyyamlrequestssuper-collectionstermcolor
MaintenanceActively maintained 274 days since the last release
Last repo commit
First released
Downloads2,467,826 / month, #3,053 on PyPI 30-day window, as of 2026-08-14
Known vulnerabilitiesNone 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

Capabilities
mkdocs variables and macrosjinja2 templating for mkdocsdynamic markdown content generationmkdocs plugin templatingmarkdown macro expansionmkdocs custom syntaxtemplate variables in documentation
Topics
mkdocs-pluginjinja2-templatingdocumentation-automation
PyPI keywords
macrosmarkdownmkdocspython

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”

Give your agent the search over MCP, or paste the wish link into any chat.

More Documentation packages

docutils With conditions
PyPI · Software Development · released May 2026

Docutils converts plaintext documentation in reStructuredText format into multiple output formats including HTML, XML, and LaTeX using a modular processing system.

BSD-3-Clausepure Python · 3.9+
225.6Mdownloads / mo
Sphinx Worth it
PyPI · Software Development · released Dec 2025

Sphinx generates professional documentation from reStructuredText source files, producing HTML, PDF, EPUB, and other formats with automatic cross-references, code highlighting, and hierarchical navigation.

BSD-2-Clausepure Python · 3.12+
91.8Mdownloads / mo
griffe Worth it
PyPI · Software Development · released Jun 2026

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.

ISCpure Python · 3.10+
32.4Mdownloads / mo
sphinxcontrib-serializinghtml With conditions
PyPI · Utilities · released Jul 2024

A Sphinx extension that outputs documentation in serialized HTML formats (JSON and pickle) alongside standard HTML.

BSD-3-Clausepure Python · 3.9+dormant
30.5Mdownloads / mo
alabaster Worth it
PyPI · Documentation · released Jul 2024

Alabaster is a clean, responsive Sphinx theme for documentation that requires Python 3.10 or newer and Sphinx 6.2 or newer.

BSD-3-Clausepure Python · 3.10+dormant
30.4Mdownloads / mo
sphinxcontrib-htmlhelp With conditions
PyPI · Utilities · released Jul 2024

A Sphinx extension that generates HTML help files from reStructuredText documentation source.

BSD-3-Clausepure Python · 3.9+dormant
27.7Mdownloads / mo

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