mkdocs-gen-files
MkDocs plugin to programmatically generate documentation pages during the build
What it is and what it does
mkdocs-gen-files is a MkDocs plugin that lets you generate documentation pages on the fly during the build process. Instead of manually creating every markdown file, you write a Python script that runs at build time and creates pages programmatically. This is useful when your documentation structure is repetitive, data-driven, or needs to be generated from code, APIs, or other sources.
The plugin works by executing Python scripts you specify in your mkdocs.yml configuration. These scripts use the plugin's API to create markdown files that become part of your site without needing to exist in your source repository. It depends on mkdocs and properdocs, and requires Python 3.9 or later. The plugin is production-stable, actively maintained, and has no known security vulnerabilities.
Use it for:
- Generate API reference documentation from code introspection or OpenAPI specs automatically.
- Create index pages or table-of-contents pages that aggregate content from multiple sources.
- Build documentation for large projects where page structure mirrors code structure or database schemas.
- Dynamically generate changelog or release notes pages from version control or issue tracking data.
- Create multi-language or multi-variant documentation from a single source template.
Worth the install?
AI-flagged interpretation of the facts on this page — verify before relying
MkDocs plugin that generates documentation pages programmatically during the build process by executing Python scripts to create content dynamically.
Yes. The plugin is production-stable (Development Status 5), actively maintained with recent commits, has no security vulnerabilities, and carries a permissive MIT license. Install friction is low. It solves a real problem—automating repetitive documentation generation—and integrates cleanly into the MkDocs build pipeline. Suitable for projects where documentation structure is data-driven or code-generated.
Install
mkdocs-gen-files on PyPI
pip
pip install mkdocs-gen-filesuv
uv add mkdocs-gen-filespoetry
poetry add mkdocs-gen-filesInstalling mkdocs-gen-files
Before you install
Low friction installation as a pure Python wheel. Actively maintained with recent commits and a stable release cadence; last commit 2026-04-17 and latest release 2026-03-16 indicate ongoing support.
License in practice
MIT license is permissive, allowing use in commercial and private projects with minimal restrictions—only requiring attribution.
Quickstart
pip install mkdocs-gen-files
# In mkdocs.yml:
plugins:
- gen-files:
scripts:
- gen_pages.py
# In gen_pages.py:
import mkdocs_gen_files
with mkdocs_gen_files.open("foo.md", "w") as f:
print("Hello, world!", file=f)
Requires MkDocs to be installed and configured; scripts must be valid Python and located relative to mkdocs.yml.
Verify before relying
- Whether the plugin supports conditional page generation or filtering based on build parameters.
- Performance characteristics when generating large numbers of pages in a single build.
- Compatibility with other MkDocs plugins that also modify the site structure.
Package facts
| License | MIT (permissive) |
| Python support | supports the current Python release (>=3.9) |
| Install friction | low — pure-Python wheel |
| Runtime dependencies | 2 — mkdocs, properdocs |
| Maintenance | actively maintained — 151 days since the last release |
| Last repo commit | |
| First released | |
| Downloads | 1,513,759/month — #3,824 on PyPI (30-day window, as of 2026-08-14) |
| Known vulnerabilities | none known (OSV.dev, checked 2026-08-14) |
Evidence: mkdocs_gen_files-0.6.1-py3-none-any.whl
Keywords: mkdocs, mkdocs-plugin
Tags
More Documentation packages
Docutils converts plaintext documentation in…
unclear · top 1,000 on PyPI
SphinxSphinx generates professional documentation…
permissive · top 1,000 on PyPI
griffeGriffe extracts the complete structure and…
permissive · top 1,000 on PyPI
sphinxcontrib-serializinghtmlA Sphinx extension that outputs documentation…
permissive · top 1,000 on PyPI
alabasterAlabaster is a clean, responsive Sphinx theme…
permissive · top 1,000 on PyPI
sphinxcontrib-htmlhelpA Sphinx extension that generates HTML help…
permissive · top 1,000 on PyPI
mkdocsMkDocs generates static HTML documentation…
permissive · top 5,000 on PyPI
mkdocs-llmstxtMkDocs plugin that generates an /llms.txt file…
permissive · top 15,000 on PyPI
mkdocs-task-collectorA MkDocs plugin that scans Markdown files for…
permissive · top 15,000 on PyPI
mkdocs-redirectsA MkDocs plugin that generates HTTP redirects…
permissive · top 5,000 on PyPI
mkdocs-meta-managerA MkDocs plugin that automatically applies meta…
permissive · top 5,000 on PyPI
mkdocstringsAn MkDocs plugin that automatically generates…
permissive · top 5,000 on PyPI
mkdocs-macros-pluginExtends MkDocs with Jinja2 templating to use…
permissive · top 5,000 on PyPI
mkdocs-clickGenerates API documentation for Click…
permissive · top 5,000 on PyPI
mkdocs-autorefsA MkDocs plugin that automatically creates…
permissive · top 5,000 on PyPI
mkdocs-videoA MkDocs plugin that embeds videos in…
permissive · top 15,000 on PyPI