class documentation

A base class for image converters. An image converter is kind of Docutils transform module. It is used to convert image files which are not supported by a builder to the appropriate format for that builder. For example, :py:class:`LaTeX builder <.LaTeXBuilder>` supports PDF, PNG and JPEG as image formats. However it does not support SVG images. For such case, using image converters allows to embed these unsupported images into the document. One of the image converters; :ref:`sphinx.ext.imgconverter <sphinx.ext.imgconverter>` can convert a SVG image to PNG format using Imagemagick internally. There are three steps to make your custom image converter: 1. Make a subclass of ``ImageConverter`` class 2. Override ``conversion_rules``, ``is_available()`` and ``convert()`` 3. Register your image converter to Sphinx using :py:meth:`.Sphinx.add_post_transform`

Method __init__ Undocumented
Method convert Convert an image file to the expected format.
Method get_conversion_rule Undocumented
Method guess_mimetypes Undocumented
Method handle Undocumented
Method is_available Return the image converter is available or not.
Method match Undocumented
Class Variable available Undocumented
Class Variable conversion_rules Undocumented
Class Variable default_priority Undocumented

Inherited from BaseImageConverter:

Method apply Undocumented
Property imagedir Undocumented

Inherited from SphinxTransform (via BaseImageConverter):

Property app Reference to the :class:`.Sphinx` object.
Property config Reference to the :class:`.Config` object.
Property env Reference to the :class:`.BuildEnvironment` object.
def __init__(self, *args, **kwargs): (source)

Undocumented

Parameters
*args:AnyUndocumented
**kwargs:AnyUndocumented
def convert(self, _from, _to): (source)

Convert an image file to the expected format. *_from* is a path of the source image file, and *_to* is a path of the destination file.

Parameters
_from:strUndocumented
_to:strUndocumented
Returns
boolUndocumented
def get_conversion_rule(self, node): (source)

Undocumented

Parameters
node:nodes.imageUndocumented
Returns
tuple[str, str]Undocumented
def guess_mimetypes(self, node): (source)

Undocumented

Parameters
node:nodes.imageUndocumented
Returns
list[str]Undocumented
def handle(self, node): (source)

Undocumented

Parameters
node:nodes.imageUndocumented
def is_available(self): (source)

Return the image converter is available or not.

Returns
boolUndocumented
def match(self, node): (source)

Undocumented

Parameters
node:nodes.imageUndocumented
Returns
boolUndocumented

Undocumented

conversion_rules: list[tuple[str, str]] = (source)
default_priority: int = (source)

Undocumented