Registry / devops / mkdocs-gen-files

mkdocs-gen-files

JSON →
library0.6.1pypypi✓ verified 23d ago

mkdocs-gen-files is an MkDocs plugin that allows users to programmatically generate documentation pages and modify existing ones during the MkDocs build process. It's particularly useful for creating dynamic content, API documentation from code, or custom navigation structures using Python scripts. The current version is 0.6.1, and releases are often tied to MkDocs compatibility or feature enhancements, without a strict schedule.

pip install mkdocs-gen-files
INSTALL
IMPORT
SIG · MKDOCS-GEN-FILES
M
mkdocs-gen-files
devopspythonv0.6.1
Install
3.1s avg
Import
360ms
Disk
34MB
Pass rate
10/ 10
Env Coverage10 / 10
glibc
3.93.13
musl
3.93.13
Install & Compatibility
Where this runs
tested against v0.6.1 · pip install
no network on importno background threads
Install × environment matrix
Each cell = how many times install + import succeeded across repeated harness runs. Partial = flaky.
glibc = Debian/Ubuntu slim · musl = Alpine Linux
musl
py 3.103.95 runs
installs and imports cleanly · install 0.0s · import 0.364s · 34.7MB
glibc
py 3.103.95 runs
installs and imports cleanly · install 3.1s · import 0.356s · 36MB
34MB installed
● package 34MB
Code
Verified usage

Verified import paths — ran on the pinned version, not inferred.

FilesEditor
from mkdocs_gen_files import FilesEditor
import mkdocs_gen_files
Nav
from mkdocs_gen_files import Nav
import mkdocs_gen_files

To use mkdocs-gen-files, first configure it in your `mkdocs.yml` to specify the Python scripts it should run. Then, create a Python script (e.g., `gen_pages.py`) where you can use `mkdocs_gen_files.open` to write content to new documentation pages. The quickstart demonstrates creating a basic markdown file.

### mkdocs.yml plugins: - gen-files: scripts: - gen_pages.py ### gen_pages.py import mkdocs_gen_files # Generate a simple markdown file with mkdocs_gen_files.open("generated/example.md", "w") as f: f.write("# Hello from mkdocs-gen-files!\n\n") f.write("This page was created dynamically at build time.\n") # Optional: Add to navigation (requires mkdocs-literate-nav) # from mkdocs_gen_files import nav # nav["Generated Content/Example"] = "generated/example.md" print("Successfully generated 'generated/example.md'")
mkdocs --version
Debug
Known issues
breakingStarting from v0.6.1, the plugin will issue a warning when used with the `mkdocs` executable. The project maintainers are starting a community continuation under 'ProperDocs', and future compatibility with the original `mkdocs` project might be impacted or require migration.
fix
Monitor project announcements for `ProperDocs` for future changes. Be prepared for potential migration or changes in build process if full `mkdocs` compatibility diverges.
affects: >=0.6.1
gotchaPrior to v0.4.0, scripts specified in `mkdocs.yml` were resolved relative to the current working directory, not the `mkdocs.yml` file's location. This could lead to scripts not being found when running `mkdocs` from different directories.
fix
Upgrade to `mkdocs-gen-files` v0.4.0 or newer. Scripts are now correctly resolved relative to the `mkdocs.yml` file, making builds more consistent regardless of CWD.
affects: <0.4.0
gotchaBefore v0.6.0, using MkDocs's `edit_uri_template` configuration could prevent `mkdocs_gen_files.set_edit_path()` from correctly applying custom edit URIs to generated files.
fix
Upgrade to `mkdocs-gen-files` v0.6.0 or newer to ensure `set_edit_path()` functions correctly even when `edit_uri_template` is used in your `mkdocs.yml`.
affects: <0.6.0
gotchaBefore v0.5.0 (on MkDocs 1.4+), the temporary directory used by `mkdocs-gen-files` for generated files might have been cleaned up too early, potentially affecting other plugins that expect these files to persist during the build process.
fix
Upgrade to `mkdocs-gen-files` v0.5.0 or newer. Cleanup now occurs after all other plugins (on MkDocs 1.4+), ensuring better compatibility with other plugins that might access generated files.
affects: <0.5.0
gotchaBeginning with v0.3.0, generated files no longer have an `edit_uri` by default. If you relied on MkDocs's default `repo_url` based edit links for generated content, they will disappear.
fix
Use `mkdocs_gen_files.set_edit_path(file, 'custom/path/to/edit.md')` within your generation script to explicitly define the edit URI for generated files, or `set_edit_path(file, None)` to explicitly remove it.
affects: >=0.3.0
Upgrade
Version history
0.6.1latest on PyPI · released Mar 16, 2026
Audit
Dependencies
mkdocsrequiredCore dependency as this is a plugin for MkDocs.
Agent activity
4 hits · last 30 days
node
2
OpenAI (training)
1
Resources