Skip to main content

MkDocs extension that lists all dependencies according to a mkdocs.yml file

Project description

mkdocs-get-deps

An extra command for MkDocs that infers required PyPI packages from plugins in mkdocs.yml.

PyPI GitHub GitHub Workflow Status

Installation:Alternatively through MkDocs itself:
pip install mkdocs-get-deps
pip install mkdocs

This command guesses the Python dependencies that a MkDocs site requires in order to build. It simply prints the PyPI packages that need to be installed. In the terminal it can be combined directly with a pip install command, as per the last example below:

Usage:Alternatively through MkDocs itself:
# Print dependencies of the current project
mkdocs-get-deps
# Save them into a file
mkdocs-get-deps > requirements.txt
# Install dependencies on the fly
pip install $(mkdocs-get-deps)
mkdocs get-deps

mkdocs get-deps > requirements.txt
pip install -r requirements.txt

pip install $(mkdocs get-deps)

The idea is that right after running this command, you can directly follow it up with mkdocs build and it will almost always "just work", without needing to think which dependencies to install.

The way it works is by scanning mkdocs.yml for themes:, plugins:, markdown_extensions: items and doing a reverse lookup based on a large list of known projects (catalog, see below).

Of course, you're encouraged to use a "virtualenv" with such a command. Also note that for environments that require stability (for example CI) directly installing deps in this way is not a very reliable approach as it precludes dependency pinning.

The command allows overriding which config file is used (instead of mkdocs.yml in the current directory) as well as which catalog of projects is used (instead of downloading it from the default location). See mkdocs get-deps --help.

MkDocs' official catalog of plugins

Check out https://github.com/mkdocs/catalog and add all your general-purpose plugins, themes and extensions there, so that they can be looked up through mkdocs get-deps.

Project details


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

mkdocs_get_deps-0.1.0.tar.gz (10.0 kB view details)

Uploaded Source

Built Distribution

mkdocs_get_deps-0.1.0-py3-none-any.whl (9.3 kB view details)

Uploaded Python 3

File details

Details for the file mkdocs_get_deps-0.1.0.tar.gz.

File metadata

  • Download URL: mkdocs_get_deps-0.1.0.tar.gz
  • Upload date:
  • Size: 10.0 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? Yes
  • Uploaded via: twine/4.0.2 CPython/3.11.6

File hashes

Hashes for mkdocs_get_deps-0.1.0.tar.gz
Algorithm Hash digest
SHA256 ea4edf4f8caf042490cd870efd31f25141470d6f957f2b7384ef8ec298078d29
MD5 a83c9ae51d7b5a6fb39db087a6e3e8ad
BLAKE2b-256 7d906e74c05f74ad890b3fe3048df03c1a255417aa7b6a71b71eb0b9efab9a1f

See more details on using hashes here.

File details

Details for the file mkdocs_get_deps-0.1.0-py3-none-any.whl.

File metadata

File hashes

Hashes for mkdocs_get_deps-0.1.0-py3-none-any.whl
Algorithm Hash digest
SHA256 3a3117dbd8a5a61390e7ca4bcc6ecfdffa47cd7db67b3c15e22b5f8d2bae4d20
MD5 6fd7246c54fe60f653f3877115d80408
BLAKE2b-256 586d01beed916a237b8d97ef441b0ad2cbbdb4f798a8218ec773bdfbb35e6c76

See more details on using hashes here.

Supported by

AWS AWS Cloud computing and Security Sponsor Datadog Datadog Monitoring Fastly Fastly CDN Google Google Download Analytics Microsoft Microsoft PSF Sponsor Pingdom Pingdom Monitoring Sentry Sentry Error logging StatusPage StatusPage Status page