class ImageConverter(BaseImageConverter): (source)
Known subclasses: sphinx.ext.imgconverter.ImagemagickConverter
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 |
Undocumented |
Method | guess |
Undocumented |
Method | handle |
Undocumented |
Method | is |
Return the image converter is available or not. |
Method | match |
Undocumented |
Class Variable | available |
Undocumented |
Class Variable | conversion |
Undocumented |
Class Variable | default |
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. |
sphinx.ext.imgconverter.ImagemagickConverter
Return the image converter is available or not.
Returns | |
bool | Undocumented |