#pre-processor #size #image #syntax

bin+lib mdbook-image-size

A mdbook preprocessor which support image size syntax

2 unstable releases

0.2.1 Jul 18, 2024
0.1.0 Nov 27, 2023

#1160 in Text processing

Download history 13/week @ 2024-07-22 47/week @ 2024-07-29 15/week @ 2024-08-05 16/week @ 2024-08-12 7/week @ 2024-08-19 12/week @ 2024-09-09 23/week @ 2024-09-16 47/week @ 2024-09-23 15/week @ 2024-09-30 9/week @ 2024-10-07 18/week @ 2024-10-14 31/week @ 2024-10-28 43/week @ 2024-11-04

93 downloads per month

MIT license

19KB
230 lines

mdbook-image-size

A mdbook preprocessor which support image size syntax

size

width & height

From

![the alt](path/to/your/image "the title" =500x400)

To

<p><img src="path/to/your/image" alt="the alt" title="the title" width="500" height="400"></p>

width only

From

![the alt](path/to/your/image "the title" =500x)

To

<p><img src="path/to/your/image" alt="the alt" title="the title" width="500"></p> 

height only

From

![the alt](path/to/your/image "the title" =x400)

To

<p><img src="path/to/your/image" alt="the alt" title="the title" height="400"></p>

[!TIP] No alt or title is ok.

align

left

left is default

center

From

![the alt](path/to/your/image "the title" =500x400 center)

To

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

right

From

![the alt](path/to/your/image "the title" =500x400 right)

To

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

Installation

cargo install mdbook-image-size

add it as a preprocessor in book.toml

[preprocessor.image-size]
command = "mdbook-image-size"

Dependencies

~13–24MB
~351K SLoC