summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorMatthias Beyer <mail@beyermatthias.de>2022-10-03 21:31:07 +0200
committerMatthias Beyer <mail@beyermatthias.de>2022-10-03 21:31:07 +0200
commitf2333c2770a6497132d8b155b090f7d0c871e9ae (patch)
tree180ae412a4f8ecf2479a5ed16478823cd060d9ef
parentce5b1df503be395c9781077768b921520bc24992 (diff)
Format
Signed-off-by: Matthias Beyer <mail@beyermatthias.de>
-rw-r--r--README.md42
1 files changed, 31 insertions, 11 deletions
diff --git a/README.md b/README.md
index 220a47b..d332bb0 100644
--- a/README.md
+++ b/README.md
@@ -1,32 +1,47 @@
# Alternative svgbob preprocessor for mdbook
+
[![Crates.io](https://img.shields.io/crates/v/mdbook-svgbob2)](https://crates.io/crates/mdbook-svgbob2)
[![GitHub last commit](https://img.shields.io/github/last-commit/matthiasbeyer/mdbook-svgbob2)](https://github.com/matthiasbeyer/mdbook-svgbob2)
[![License](https://img.shields.io/github/license/matthiasbeyer/mdbook-svgbob2)](https://github.com/matthiasbeyer/mdbook-svgbob2/blob/master/LICENSE)
-A preprocessor for [mdbook](https://github.com/rust-lang/mdBook) to convert `svgbob` codeblocks into nice SVG images using [svgbob](https://github.com/ivanceras/svgbob).
+A preprocessor for [mdbook](https://github.com/rust-lang/mdBook) to convert
+`svgbob` codeblocks into nice SVG images using
+[svgbob](https://github.com/ivanceras/svgbob).
-This crate serves as an alternative to [mdbook-svgbob](https://github.com/fzzr-/mdbook-svgbob) which was a big inspiration while writing the code for this crate.
+This crate serves as an alternative to
+[mdbook-svgbob](https://github.com/fzzr-/mdbook-svgbob) which was a big
+inspiration while writing the code for this crate.
-The reason why I created this was that the original uses outdated dependencies and seems to break tables some reason, and it requires the source to have Unix line endings as it breaks with Windows line endings. I also wanted to learn how to write mdbook preprocessors and had a usecase for an updated svgbob integration.
+The reason why I created this was that the original uses outdated dependencies
+and seems to break tables some reason, and it requires the source to have Unix
+line endings as it breaks with Windows line endings. I also wanted to learn how
+to write mdbook preprocessors and had a usecase for an updated svgbob
+integration.
## Installation
+
Install with cargo:
+
```sh
cargo install mdbook-svgbob2
```
Or to install from the git mirror:
+
```sh
cargo install --git https://github.com/matthiasbeyer/mdbook-svgbob2.git
```
## Usage
+
Add this to your cargo.toml:
```toml
[preprocessor.svgbob2]
```
-Optionally add any arguments for the [svgbob settings](https://docs.rs/svgbob/0.6.2/svgbob/buffer/fragment/struct.Settings.html):
+Optionally add any arguments for the
+[svgbob settings](https://docs.rs/svgbob/0.6.2/svgbob/buffer/fragment/struct.Settings.html):
+
```toml
[preprocessor.svgbob2]
font_size = "14"
@@ -45,10 +60,18 @@ merge_line_with_shapes = "false"
# this is a non-svgbob custom setting
font_color = "var(--fg)"
```
-The above are the default settings. Most of them are the svgbob defaults, with the exception of `background` and `stroke_color` which I have changed to better fit mdbook.\
-svgbob currently does not support changing the font color (although there are [feature requests](https://github.com/ivanceras/svgbob/issues/78) for this to be added), and because a pure black font color doesn't work well with different mdbook themes, I added the ability to change the font color.
-Then simply include `svgbob` codeblocks in some chapter:
+The above are the default settings. Most of them are the svgbob defaults, with
+the exception of `background` and `stroke_color` which have been changed to
+better fit mdbook.
+
+svgbob currently does not support changing the font color (although there are
+[feature requests](https://github.com/ivanceras/svgbob/issues/78) for this to be
+added), and because a pure black font color doesn't work well with different
+mdbook themes, the ability to change the font color was added.
+
+Simply include `svgbob` codeblocks in some chapter:
+
````md
```svgbob
.---.
@@ -60,9 +83,6 @@ Then simply include `svgbob` codeblocks in some chapter:
'
```
````
+
and it should display as a nicely rendered svg when rendered with mdbook.
-## TODO
-* there are currently no tests implemented
-* 2 consecutive svgbob blocks will currently break the second one\
- this is fixed by having anything else written between the two blocks