#mdbook #html #break #page #insert #print #replace

app mdbook-pagebreaks

A mdbook preprocessor to insert page breaks when rendering to HTML

5 unstable releases

0.3.1 Nov 3, 2024
0.3.0 Nov 3, 2024
0.2.1 Nov 2, 2024
0.2.0 Nov 2, 2024
0.1.0 Nov 2, 2024

#186 in Text processing

Download history 335/week @ 2024-10-28 79/week @ 2024-11-04 3/week @ 2024-11-18

417 downloads per month

MIT license

21KB
341 lines

mdbooks-pagebreaks

A mdbook preprocessor that replaces {{---}} with explicit print page breaks in HTML.

https://crates.io/crates/mdbook-pagebreaks

Example

The sections Title, Section 1, Section 2, and Section 3 will all be printed on seperate pages.

# Title

Donec condimentum eros ante, eu mollis orci suscipit sit amet. Morbi semper mi turpis, eu scelerisque nibh scelerisque id.

{{---}}

## Section 1

Lorem ipsum dolor sit amet, consectetur adipiscing elit. Sed leo elit, interdum nec ante non, malesuada fringilla ligula. Vestibulum bibendum lobortis sapien, nec sodales metus porttitor quis. Vivamus fringilla luctus tincidunt. Pellentesque viverra sagittis euismod.

{{---}}

## Section 2

Proin tortor risus, viverra et tortor viverra, pretium luctus lorem. Nulla facilisi. Etiam vel ipsum quis eros sollicitudin accumsan at eu ipsum. Maecenas sed maximus urna. Phasellus eget neque vel nisl finibus scelerisque sit amet eu nunc.

{{---}}

## Section 3

Quisque nec dapibus nisi. Aliquam vehicula consequat libero eu dapibus. Curabitur nec diam suscipit, fringilla ligula et, suscipit ipsum. Sed sodales eros quis maximus faucibus. Integer sit amet pulvinar nulla.

Install

cargo install mdbook-pagebreaks --version 0.3.1

Initialize

cd path/to/book
mdbook-pagebreaks init

Configure

[preprocessor.pagebreaks]
[output.html]
additional-css = ["mdbook-pagebreaks.css"]

Dependencies

~11–22MB
~329K SLoC