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

Uploaded Python 3

File details

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

File metadata

  • Download URL: sphinx_image_min-1.0.7.tar.gz
  • Upload date:
  • Size: 4.0 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.7.tar.gz
Algorithm Hash digest
SHA256 e45707f70442287737f266aeac12151e37a47ebfaffb31c5a23fc9f06038325b
MD5 b6b8a5cfa24b2aca494ac5bb534660b0
BLAKE2b-256 406d6c1b22b391debc469adafa73271ba69ba7aa09464c4f1c3303c5c02fdcb7

See more details on using hashes here.

File details

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

File metadata

File hashes

Hashes for sphinx_image_min-1.0.7-py3-none-any.whl
Algorithm Hash digest
SHA256 24c6d81ee383cbdc90091f20e29a07d8688d45533982ba6421294247baa5b007
MD5 d40fd78cc0ff7213dc54c5fe66060ef1
BLAKE2b-256 56a141c92b5c0ad381f8617ac60f97c48de392011aeac5f12859983d7b8a274f

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