Skip to content

Commit

Permalink
feat(doc): #919 mermaid support
Browse files Browse the repository at this point in the history
- Add mermaid support

Signed-off-by: Kevin Amado <[email protected]>
  • Loading branch information
kamadorueda committed Sep 23, 2022
1 parent 01c63fb commit ab04ec4
Show file tree
Hide file tree
Showing 6 changed files with 15 additions and 1 deletion.
1 change: 1 addition & 0 deletions docs/.gitignore
Original file line number Diff line number Diff line change
@@ -1 +1,2 @@
/book
/mermaid.min.js
4 changes: 4 additions & 0 deletions docs/book.toml
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,7 @@ src = "src"
title = "Makes"

[output.html]
additional-js = ["mermaid.min.js", "mermaid-init.js"]
default-theme = "ayu"
edit-url-template = "https://github.com/fluidattacks/makes/edit/main/docs/{path}"
preferred-dark-theme = "ayu"
Expand All @@ -19,3 +20,6 @@ site-url = "/makes"
[output.html.fold]
enable = false
level = 0

[preprocessor.mermaid]
command = "mdbook-mermaid"
4 changes: 4 additions & 0 deletions docs/mermaid-init.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
mermaid.initialize({
startOnLoad: true,
theme: "dark",
});
1 change: 1 addition & 0 deletions makes.nix
Original file line number Diff line number Diff line change
Expand Up @@ -50,6 +50,7 @@
bin = [
inputs.nixpkgs.just
inputs.nixpkgs.mdbook
inputs.nixpkgs.mdbook-mermaid
inputs.nixpkgs.reuse
];
source = [outputs."/cli/pypi"];
Expand Down
1 change: 1 addition & 0 deletions makes/docs/entrypoint.sh
Original file line number Diff line number Diff line change
Expand Up @@ -4,4 +4,5 @@

# shellcheck shell=bash

mdbook-mermaid install docs/
mdbook build docs
5 changes: 4 additions & 1 deletion makes/docs/main.nix
Original file line number Diff line number Diff line change
Expand Up @@ -9,5 +9,8 @@
makeScript {
name = "docs";
entrypoint = ./entrypoint.sh;
searchPaths.bin = [inputs.nixpkgs.mdbook];
searchPaths.bin = [
inputs.nixpkgs.mdbook
inputs.nixpkgs.mdbook-mermaid
];
}

0 comments on commit ab04ec4

Please sign in to comment.