#mdbook #ascii #block #diagram #plugin #mdbook-plugins

bin+lib badascii-mdbook

Embed badascii diagrams in your mdbook. See badascii.me for the editor.

5 unstable releases

Uses new Rust 2024

new 0.3.1 Apr 23, 2025
0.2.1 Apr 22, 2025
0.2.0 Apr 22, 2025
0.1.1 Apr 22, 2025
0.1.0 Apr 22, 2025

#1285 in Text processing

Download history

128 downloads per month

MIT license

205KB
1.5K SLoC

BadAscii-mdbook

A preprocessor for mdbook to add badascii support.

It turns a badascii diagram like this:

      +-------------+        +-------------+
      | Thing 1     |        | Thing 2     |
      |             |        |             |
 +--->|ins      outs+------->|ins      outs+----+
 |    |             |        |             |    |
 |    |             |        |             |    |
 |    +-------------+        +-------------+    |
 |                                              |
 +----------------------------------------------+

into an embedded SVG like this:

SVG of diagram

in your book.

Installation

From source

To install from source

cargo install --locked badascii-mdbook

This will install the mdbook-badascii binary from source.

Configuration

You need to configure your mdbook to use the preprocessor. This requires adding the following to your book.toml

[preprocessor.badascii]

If you also want the formal mode for diagrams, you can include a config flag in the book.toml.

[preprocessor.badascii]
formal = true

This will convert all of the diagrams using formal mode.

Then you can build your book

mdbook build path/to/book

Dependencies

~23–35MB
~556K SLoC