18 releases (4 breaking)

0.4.2 May 23, 2023
0.4.1 Apr 18, 2023
0.3.1 Apr 11, 2023
0.2.2 Apr 8, 2023
0.0.6 Mar 21, 2023

#380 in Text processing

Download history 68/week @ 2023-03-14 138/week @ 2023-03-21 43/week @ 2023-03-28 75/week @ 2023-04-04 93/week @ 2023-04-11 42/week @ 2023-04-18 10/week @ 2023-04-25 3/week @ 2023-05-02 46/week @ 2023-05-09 6/week @ 2023-05-16 25/week @ 2023-05-23

80 downloads per month


183 lines


This is a preprocessor for mdbook.

We plan to take some more time before a major release 🐣

🔺It includes some issues as noted in Issues.


The following warnings in PageSpeed Insights can be eliminated by using this preprocessor.


Explicitly setting the width and height of image elements will reduce layout deviations and improve CLS.

Corresponding image file

The image files that this project can handle depend on Imaging library.

An Image Processing Library

It supports PNG, JPEG, GIF, WebP etc. as generally used in web pages 😉

🔺AVIF is not currently supported.


  1. Use cargo to install.
cargo install mdbook-tailor
  1. Add the following to book.toml.


  1. Use markdown notation as usual.
  1. Do the mdbook build as usual.
mdbook build

The HTML generated from the above steps should contain the image size as measured by the mdbook-tailor. In addition, a delayed loading setting will be added!

<img src="example.webp" alt="example" width="789" height="456" loading="lazy">


🔺Currently, tailor is not able to handle multiple image files on a single line.


![left](l.webp) ![right](r.webp)

🔺Images in markdown tables are not detected.



Naturally I would like to be able to detect and process this as well, but I must admit I am out of my depth...❗😿


This is actually a site I am producing myself ☺️


Licensed under either of

at your option.


Unless you explicitly state otherwise, any contribution intentionally submitted for inclusion in the work by you, as defined in the Apache-2.0 license, shall be dual licensed as above, without any additional terms or conditions.


~820K SLoC