# 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
```bash
$ pip install foliantcontrib.imgcaptions
```
## Usage
To enable the preprocessor, add `imgcaptions` to `preprocessors` section in the project config:
```yaml
preprocessors:
- imgcaptions
```
The preprocessor supports the following options:
```yaml
- imgcaptions:
stylesheet_path: !path imgcaptions.css
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.
`targets`
: Allowed targets for the preprocessor. If not specified (by default), the preprocessor applies to all targets.
Image definition example:
```markdown
(leading exclamation mark here)[My Picture](picture.png)
```
This Markdown source will be finally transformed into the HTML code:
```html
<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 `<p class="image_caption">My Picture</p>` into Markdown code after the image definitions. Empty alternative text descriptions are ignored.)
PyPI 官网下载 | foliantcontrib.imgcaptions-1.0.0.tar.gz
版权申诉
115 浏览量
2022-01-11
20:22:17
上传
评论
收藏 3KB GZ 举报
挣扎的蓝藻
- 粉丝: 13w+
- 资源: 15万+
最新资源
- 基于Vue的medical-vue医疗挂号系统设计源码
- Python解析网页.xmind
- PMV185XN-VB一款N-Channel沟道SOT23的MOSFET晶体管参数介绍与应用说明
- PMV170UN-VB一款N-Channel沟道SOT23的MOSFET晶体管参数介绍与应用说明
- 基于Java的长理教务管理系统设计源码
- PMV16UN-VB一款N-Channel沟道SOT23的MOSFET晶体管参数介绍与应用说明
- 永磁同步电机-用STM32F103C8T6实现PMSM矢量控制.rar
- PMV160UP-VB一款P-Channel沟道SOT23的MOSFET晶体管参数介绍与应用说明
- 3dmax超级弯曲 暴力弯曲插件
- candence原理图批量换网络的快捷操作
资源上传下载、课程学习等过程中有任何疑问或建议,欢迎提出宝贵意见哦~我们会及时处理!
点击此处反馈