ImgCaptions
ImgCaptions is a preprocessor that generates visible captions for the images from alternative text descriptions of the images. The preprocessor is useful in projects built with MkDocs or another backend that provides HTML output.
Installation
$ pip install foliantcontrib.imgcaptions
Usage
To enable the preprocessor, add imgcaptions to preprocessors section in the project config:
preprocessors:
- imgcaptions
The preprocessor supports the following options:
- imgcaptions:
stylesheet_path: !path imgcaptions.css
template: <p class="image_caption">{caption}</p>
targets:
- pre
- mkdocs
- site
- ghp
stylesheet_path
: Path to the CSS stylesheet file. This stylesheet should define rules for the .image_caption class. Default path is imgcaptions.css. If stylesheet file does not exist, default built-in stylesheet will be used.
template
: Template string representing the HTML tag of the caption to be placed after the image. The template should contain the {caption} variable that will be replaced with the image caption. Default: <p class="image_caption">{caption}</p>.
targets
: Allowed targets for the preprocessor. If not specified (by default), the preprocessor applies to all targets.
Image definition example:
(leading exclamation mark here)[My Picture](picture.png)
This Markdown source will be finally transformed into the HTML code:
<p><img alt="My Picture" src="picture.png"></p>
<p class="image_caption">My Picture</p>
(Note that ImgCaptions preprocessor does not convert Markdown syntax into HTML; it only inserts HTML tags like <p class="image_caption">My Picture</p> into Markdown code after the image definitions. Empty alternative text descriptions are ignored.)
Metadata
Release files for foliantcontrib.imgcaptions 1.0.4
For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.
Source distribution (sdist)
| File | Size | Uploaded | Provenance | |
|---|---|---|---|---|
| foliantcontrib.imgcaptions-1.0.4.tar.gz | 4.0 kB | Without provenance | Details |
Built distribution (wheel)
| File | Interpreter | ABI | Platform | Reset |
|---|---|---|---|---|
| foliantcontrib.imgcaptions-1.0.4-py3-none-any.whl | Python 3 | none | any | Details |
Total release size: 8.3 kB
Release files / foliantcontrib.imgcaptions-1.0.4.tar.gz
| Download URL | foliantcontrib.imgcaptions-1.0.4.tar.gz |
|---|---|
| Size | 4.0 kB |
| Tags | Source |
|
SHA-256 checksum How to use checksums |
7e244a0a59091ead531304d93d64e2209ff165bc9d2ac4e2a3da2a1c1e2b5d33
|
|
BLAKE2b-256 checksum How to use checksums |
167f506777f748c79af693cb32d403641ddecf09d64d65b925b375980dc4f6bd
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
| Uploaded via |
twine/4.0.1 CPython/3.9.15
|
Release files / foliantcontrib.imgcaptions-1.0.4-py3-none-any.whl
| Download URL | foliantcontrib.imgcaptions-1.0.4-py3-none-any.whl |
|---|---|
| Size | 4.3 kB |
| Tags | Python 3 |
|
SHA-256 checksum How to use checksums |
29d193188b6d27d4b280dba4133468f80413b3b37db9a75442646a136f4c30a0
|
|
BLAKE2b-256 checksum How to use checksums |
c8ff3e9678bb9728c40f1efc5aa17d07963e4df44c6d022aa71ea15e18a42e3c
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
| Uploaded via |
twine/4.0.1 CPython/3.9.15
|
Security for foliantcontrib.imgcaptions 1.0.4
Provenance
Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.
No provenance found
None of the files in this release were uploaded with provenance metadata.
A note on package security
PyPI is a repository for distributing packages, not a service for auditing them. While third-party security researchers and our staff do their best to detect and remove malicious packages, PyPI cannot guarantee the quality, security or suitability of any given package.