skillfed

mkdocs-gen-files

MkDocs plugin to programmatically generate documentation pages during the build

mkdocs-gen-files v0.6.1 1.5M downloads/30d#3,824 on PyPI143
Permissive license MIT Active released

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-files

uv

uv add mkdocs-gen-files

poetry

poetry add mkdocs-gen-files

Installing 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

Development Status :: 5 - Production/StableEnvironment :: ConsoleEnvironment :: Web EnvironmentIntended Audience :: DevelopersLicense :: OSI Approved :: MIT LicenseOperating System :: OS IndependentProgramming Language :: PythonProgramming Language :: Python :: 3.10Programming Language :: Python :: 3.11Programming Language :: Python :: 3.12Programming Language :: Python :: 3.13Programming Language :: Python :: 3.9Topic :: DocumentationTopic :: Software Development :: DocumentationTopic :: Text Processing :: Markup :: MarkdownTyping :: Typed

Tags

mkdocs dynamic page generationmkdocs plugin programmatic docsgenerate documentation pages build timemkdocs automated content creationmkdocs build script integrationdynamic markdown generation mkdocs
mkdocs-plugincode-generation

More Documentation packages