Skip to main content

This Sphinx extension allows for automatically minimizing build dir images, most useful when only used for CI.

Project description

Sphinx Extension: Image Minimizer

PyPI PyPI - License

Description

This Sphinx extension allows for automatically minimizing build dir images, most useful when only used for CI.

Setup

  1. Add the following to your conf.py:

    import sys, os
    
    # Sphinx Minimizer [Optional] Options
    image_min_max_width = 1080  # Default
    

Usage

After a build is complete, images in build/_images/ will be compressed (lossless, if png).

Requirements

  • Python>=3.6
  • Sphinx>=1.8
  • pillow>=10.4.0

This may work with older versions, but has not been tested.

Entry Point

See setup(app) definition at sphinx_image_min.py.

Tested in

  • Windows 11 via PowerShell 7
  • Ubuntu 22.04 via ReadTheDocs (RTD) CI

Notes

  • __init__.py is required for both external pathing and to treat the directory as a pkg

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

sphinx_image_min-1.0.8.tar.gz (3.9 kB view details)

Uploaded Source

Built Distribution

If you're not sure about the file name format, learn more about wheel file names.

sphinx_image_min-1.0.8-py3-none-any.whl (4.6 kB view details)

Uploaded Python 3

File details

Details for the file sphinx_image_min-1.0.8.tar.gz.

File metadata

  • Download URL: sphinx_image_min-1.0.8.tar.gz
  • Upload date:
  • Size: 3.9 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/6.0.1 CPython/3.10.16

File hashes

Hashes for sphinx_image_min-1.0.8.tar.gz
Algorithm Hash digest
SHA256 11dd896e2f4b5fe0d0c82855458d2c3a9f687ef178b3d7552fb920f0219ed860
MD5 4f041d15f6652ac9302f33b49deb8c5f
BLAKE2b-256 69b5fcd9c0e349dd46ff0c2fd4d0d3888eb1bdee6bad10dc7c18951f9e7d6112

See more details on using hashes here.

File details

Details for the file sphinx_image_min-1.0.8-py3-none-any.whl.

File metadata

File hashes

Hashes for sphinx_image_min-1.0.8-py3-none-any.whl
Algorithm Hash digest
SHA256 487a034e156978315c894c02f0b76d47530139928d66e56d639a6e8e89c7f7cb
MD5 9819a8653cd323a551bcc02830250e2c
BLAKE2b-256 cb6a6961bdb581db18565e79d96f9e508cd61f7c3eaec59151226b1047e88a0a

See more details on using hashes here.

Supported by

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