Svgbob
Install Cargo and Rust
In terminal:
$ brew install rustup (1)
$ rustup-init (2)
1 | install rustup |
2 | install cargo and rust compiler |
Restart you terminal then verify Rust compiler, which is the rustc
command
in your terminal:
$ rustc --version (1)
rustc 1.47.0 (18bf6b4f0 2020-10-07) (2)
1 | query compiler version |
2 | if compiler has been properly installed, you should get something like this. |
Install SvgBob
In terminal:
$ cargo install svgbob_cli (1)
$ svgbob --version (2)
svgbob 0.4.2 (3)
$ sudo ln -s $(which svgbob) /usr/local/bin/svgbob (4)
1 | SvgBob installation command |
2 | verify that the SvgBob was successfully installed |
3 | SvgBob version |
4 | Add the SvgBob to executable folder |
Configure SvgBob in Hugo
Open you your configuration file, config.toml
and add the noted lines
[markup]
[markup.tableOfContents]
endLevel = 4
ordered = false
startLevel = 2
[markup.highlight]
anchorLineNos = false
codeFences = true
guessSyntax = false
hl_Lines = ""
lineAnchors = ""
lineNoStart = 1
lineNos = false
lineNumbersInTable = true
noClasses = true
style = "github"
tabWidth = 4
[markup.asciidocExt]
backend = "html5"
extensions = ["asciidoctor-html5s", "asciidoctor-diagram"] (1)
failureLevel = "fatal"
noHeaderOrFooter = true
preserveTOC = false
safeMode = "unsafe"
sectionNumbers = false
trace = true
verbose = true
workingFolderCurrent = true
[markup.asciidocExt.attributes]
my-base-url = "/static/"
source-highlighter = "pygments"
icons = "font"
1 | be sure to include the extensions |
To test, add the follwoing lines to any asciidoc and rebuild the site:
[svgbob]
....
+------------+
+->| Solution 2 |
/ +------------+
+-------------+ /
| Customer | / +------------+
| Needs and +---+----->| Solution 1 |
| Wants | \ +------------+
+-------------+ \
\ +------------+
+->| Solution 3 |
+------------+
....
and you should get this: