Skip to content

Commit 6f52439

Browse files
orangecmspamolloy
andcommitted
set up Mermaid integration
Co-authored-by: Philip Molloy <philip@philipmolloy.com> Signed-off-by: Daniel Maslowski <info@orangecms.org>
1 parent f3520ca commit 6f52439

5 files changed

Lines changed: 35 additions & 2 deletions

File tree

.github/workflows/gh-pages.yml

Lines changed: 8 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -18,10 +18,16 @@ jobs:
1818
- name: Setup mdBook
1919
uses: peaceiris/actions-mdbook@v2
2020
with:
21-
mdbook-version: '0.4.40'
21+
mdbook-version: '0.4.48'
2222
# mdbook-version: 'latest'
2323

24-
- run: mdbook build
24+
- name: Install mdbook-mermaid
25+
run: |
26+
cargo install mdbook-mermaid
27+
mdbook-mermaid install
28+
29+
- name: Build
30+
run: mdbook build
2531

2632
- name: Deploy
2733
uses: peaceiris/actions-gh-pages@v3

.gitignore

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -6,3 +6,4 @@ ci/vale/styles/Microsoft/
66
ci/vale/styles/proselint/
77
ci/vale/styles/RedHat/
88
ci/vale/styles/write-good/
9+
*.js

Makefile

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,10 @@
1+
build:
2+
mdbook build
3+
4+
run:
5+
mdbook serve
6+
7+
prepare:
8+
cargo install mdbook
9+
cargo install mdbook-mermaid
10+
mdbook-mermaid install

README.md

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -15,6 +15,16 @@ This book is written with [mdBook](https://github.com/rust-lang/mdBook).
1515
When installed, run `mdbook serve` and you will get a local webserver.
1616
For more details, please refer to the mdBook documentation.
1717

18+
Some pages render diagrams using [mermaid.js](https://mermaid.js.org/), which is
19+
preprocessed with [mdbook-mermaid](https://github.com/badboy/mdbook-mermaid).
20+
21+
For convenience, the `Makefile` lets you set up and run the environment:
22+
23+
```sh
24+
make prepare
25+
make run
26+
```
27+
1828
The book is linted with markdownlint and Vale. Follow the official
1929
documentation to [install
2030
markdownlint](https://github.com/markdownlint/markdownlint?tab=readme-ov-file#installation)

book.toml

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -8,3 +8,9 @@ title = "LinuxBoot"
88
[output.html]
99
cname = "book.linuxboot.org"
1010
git-repository-url = "https://github.com/linuxboot/book"
11+
additional-js = ["mermaid.min.js", "mermaid-init.js"]
12+
13+
[preprocessor]
14+
15+
[preprocessor.mermaid]
16+
command = "mdbook-mermaid"

0 commit comments

Comments
 (0)