class ImageConverter(BaseImageConverter):
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, LaTeX builder
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:
.Sphinx.add_post_transform
Method | convert |
Convert an image file to the expected format. |
Method | is_available |
Return the image converter is available or not. |
Class Variable | available |
Undocumented |
Class Variable | conversion_rules |
Undocumented |
Method | __init__ |
Undocumented |
Method | get_conversion_rule |
Undocumented |
Method | guess_mimetypes |
Undocumented |
Method | handle |
Undocumented |
Method | match |
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 .Sphinx object. |
Property | config |
Reference to the .Config object. |
Property | env |
Reference to the .BuildEnvironment object. |
sphinx.ext.imgconverter.ImagemagickConverter
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:str | Undocumented |
_to:str | Undocumented |
Returns | |
bool | Undocumented |
sphinx.ext.imgconverter.ImagemagickConverter
Returns | |
bool | Undocumented |
List[ Tuple[ str, str]]
=
sphinx.ext.imgconverter.ImagemagickConverter
Undocumented
Undocumented
Parameters | |
*args:Any | Undocumented |
**kwargs:Any | Undocumented |
Undocumented
Parameters | |
node:nodes.image | Undocumented |
Returns | |
Tuple[ | Undocumented |
Undocumented
Parameters | |
node:nodes.image | Undocumented |
Returns | |
List[ | Undocumented |