mkdocs-get-deps is an extra command-line tool for MkDocs that simplifies dependency management by inferring required PyPI packages from `plugins`, `themes`, and `markdown_extensions` listed in an `mkdocs.yml` configuration file. It outputs the names of these packages, making it easy to pipe them directly to `pip install`. The current version is 0.2.2. It's a low-cadence utility, typically updated in sync with MkDocs or its dependency catalog.
pip install mkdocs-get-depsNo compatibility data collected yet for this library.
This quickstart demonstrates how to use `mkdocs get-deps` to identify and then install the Python packages required by your MkDocs project based on its `mkdocs.yml` configuration. It's often chained with `pip install` to automate the setup of a documentation environment.
Run `mkdocs get-deps > requirements.txt` and then `pip install -r requirements.txt`. Manually review and pin versions in `requirements.txt` for production builds.
Manually identify and add the PyPI packages for custom components to your `requirements.txt` file. You can contribute to the MkDocs catalog to include widely used projects.
Before installing or running `mkdocs get-deps`, create and activate a virtual environment (e.g., `python -m venv venv` then `source venv/bin/activate` on Linux/macOS or `.\venv\Scripts\activate` on Windows).
Execute `mkdocs get-deps` in your terminal. If you need to run it programmatically from a Python script, use `import subprocess; subprocess.run(['mkdocs', 'get-deps'], check=True, text=True, capture_output=True)`.
Execute `mkdocs get-deps` directly in your shell or, if within a Python script, use `import subprocess; subprocess.run(['mkdocs', 'get-deps'], check=True)`.
Ensure `mkdocs-get-deps` is installed in your active Python environment. If it is, activate your virtual environment or ensure your PATH includes the Python scripts directory (e.g., `pip install mkdocs-get-deps`). Alternatively, you might try running it as a subcommand of `mkdocs` if available: `mkdocs get-deps`.
Install the missing dependency: `pip install mergedeep`.
Manually identify the missing plugin and install it, for example: `pip install mkdocs-material-extensions` (replace `mkdocs-material-extensions` with the actual missing plugin package name). Then, re-run `mkdocs-get-deps` to ensure all other dependencies are captured.
Install the missing Markdown extension package: `pip install pymdown-extensions` (the `pymdownx` module is provided by the `pymdown-extensions` package). Then, re-run `mkdocs-get-deps` to ensure all dependencies are captured and installed.