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.9.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.9-py3-none-any.whl (4.6 kB view details)

Uploaded Python 3

File details

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

File metadata

  • Download URL: sphinx_image_min-1.0.9.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.9.tar.gz
Algorithm Hash digest
SHA256 cb3d1dd81904d04d554671c63a57d9f60ab219453e9a4f3255c7352a3be2c5b1
MD5 419cacd02be23132b6ced0e69a61ebcf
BLAKE2b-256 6a8c534f76435217bbd1f33cba34cd2780afd1746e04835c0d68c5b0cf875e60

See more details on using hashes here.

File details

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

File metadata

File hashes

Hashes for sphinx_image_min-1.0.9-py3-none-any.whl
Algorithm Hash digest
SHA256 c23bc0fe88323c819578e86ea359a72156c0caf187b908f690ea7d62c874bba0
MD5 f9fbe25ef1e0d97ed54b9f3b7f885900
BLAKE2b-256 65c02573a844947028bda6ee5bed9f57c9ee5bcfb0637b527c79c598403aab95

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