diff --git a/Dockerfile b/Dockerfile index 93a3d6aec..3efa35134 100644 --- a/Dockerfile +++ b/Dockerfile @@ -61,7 +61,9 @@ RUN \ if [ "${WITH_PLUGINS}" = "true" ]; then \ pip install --no-cache-dir \ "mkdocs-minify-plugin>=0.3" \ - "mkdocs-redirects>=1.0"; \ + "mkdocs-redirects>=1.0" \ + "pillow>=9.0" \ + "cairosvg>=2.5"; \ fi \ && \ apk del .build \ diff --git a/docs/setup/setting-up-social-cards.md b/docs/setup/setting-up-social-cards.md index 0e64a87e4..c99f5e61b 100644 --- a/docs/setup/setting-up-social-cards.md +++ b/docs/setup/setting-up-social-cards.md @@ -118,15 +118,18 @@ The following configuration options are available: #### Dependencies -Two Python packages are installed alongside Material for MkDocs to generate the -social preview images, both of which are based on the [Cairo Graphics] library: +Two Python libraries must be installed alongside Material for MkDocs to generate +the social preview images, both of which are based on [Cairo Graphics] – +[Pillow] and [CairoSVG]: -- [Pillow] – Python imaging library -- [CairoSVG] – Converter for `*.svg` files +``` +pip install pillow cairosvg +``` -The [Docker image] comes with all dependencies pre-installed. If -you don't want to use Docker, see the following section which explains how to -install all dependencies on your system: +Both libraries are built with native extensions which need to be installed as +well. The [Docker image] comes with all dependencies pre-installed. If you don't +want to use Docker, see the following section which explains how to install all +dependencies on your system: === ":material-apple: macOS" diff --git a/material/plugins/social/plugin.py b/material/plugins/social/plugin.py index a67b1d29f..7af9a7f72 100644 --- a/material/plugins/social/plugin.py +++ b/material/plugins/social/plugin.py @@ -70,7 +70,7 @@ class SocialPlugin(BasePlugin): if not dependencies: log.error( "Required dependencies of \"social\" plugin not found. " - "Install with: pip install cairosvg pillow" + "Install with: pip install pillow cairosvg" ) sys.exit() diff --git a/src/plugins/social/plugin.py b/src/plugins/social/plugin.py index a67b1d29f..7af9a7f72 100644 --- a/src/plugins/social/plugin.py +++ b/src/plugins/social/plugin.py @@ -70,7 +70,7 @@ class SocialPlugin(BasePlugin): if not dependencies: log.error( "Required dependencies of \"social\" plugin not found. " - "Install with: pip install cairosvg pillow" + "Install with: pip install pillow cairosvg" ) sys.exit()