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.2.0.tar.gz (10.2 kB view details)

Uploaded Source

Built Distribution

mkdocs_get_deps-0.2.0-py3-none-any.whl (9.5 kB view details)

Uploaded Python 3

File details

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

File metadata

  • Download URL: mkdocs_get_deps-0.2.0.tar.gz
  • Upload date:
  • Size: 10.2 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.2.0.tar.gz
Algorithm Hash digest
SHA256 162b3d129c7fad9b19abfdcb9c1458a651628e4b1dea628ac68790fb3061c60c
MD5 4144c380f8bea5be5e5da35e3d82984b
BLAKE2b-256 98f5ed29cd50067784976f25ed0ed6fcd3c2ce9eb90650aa3b2796ddf7b6870b

See more details on using hashes here.

File details

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

File metadata

File hashes

Hashes for mkdocs_get_deps-0.2.0-py3-none-any.whl
Algorithm Hash digest
SHA256 2bf11d0b133e77a0dd036abeeb06dec8775e46efa526dc70667d8863eefc6134
MD5 1c190eaf5967d4e29451a7259bea1141
BLAKE2b-256 9fd4029f984e8d3f3b6b726bd33cafc473b75e9e44c0f7e80a5b29abc466bdea

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