2个不稳定版本
0.2.1 | 2024年7月18日 |
---|---|
0.1.0 | 2023年11月27日 |
#862 在 文本处理
每月131次下载
19KB
230 行
mdbook-image-size
支持图像大小语法的mdbook预处理器
大小
宽度 & 高度
从

到
<p><img src="path/to/your/image" alt="the alt" title="the title" width="500" height="400"></p>
仅宽度
从

到
<p><img src="path/to/your/image" alt="the alt" title="the title" width="500"></p>
仅高度
从

到
<p><img src="path/to/your/image" alt="the alt" title="the title" height="400"></p>
[!TIP] 无alt或title也可以。
对齐
左
默认为左对齐
居中
从

到
<p style="text-align:center"><img src="path/to/your/image" alt="the alt" title="the title" width="500" height="400"></p>
右
从

到
<p style="text-align:right"><img src="path/to/your/image" alt="the alt" title="the title" width="500" height="400"></p>
安装
cargo install mdbook-image-size
在book.toml中将它作为预处理器添加
[preprocessor.image-size]
command = "mdbook-image-size"
依赖项
~12–26MB
~333K SLoC