Skip to content

Commit e0f447e

Browse files
committed
Fix Mermaid rendering
1 parent 03ebc20 commit e0f447e

File tree

5 files changed

+36
-11
lines changed

5 files changed

+36
-11
lines changed

Diff for: .github/dependabot.yml

+8
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,8 @@
1+
version: 2
2+
updates:
3+
- package-ecosystem: "github-actions"
4+
directory: "/"
5+
schedule:
6+
interval: "weekly"
7+
reviewers:
8+
- "tcpipuk"

Diff for: .github/workflows/deploy-mdbook.yml

+7-2
Original file line numberDiff line numberDiff line change
@@ -115,9 +115,9 @@ jobs:
115115
curl -sSfL -o theme/catppuccin-admonish.css \
116116
https://github.com/catppuccin/mdBook/releases/latest/download/catppuccin-admonish.css
117117
118-
# Download default theme's index.hbs for customization
118+
# Download default theme's index.hbs for customisation
119119
curl -sSfL -o theme/index.hbs \
120-
https://raw.githubusercontent.com/rust-lang/mdBook/master/src/theme/index.hbs
120+
https://raw.githubusercontent.com/rust-lang/mdBook/refs/heads/master/src/front-end/templates/index.hbs
121121
122122
# Update index.hbs theme options
123123
sed -i 's/Light/Latte/; s/Rust/Frappé/; s/Coal/Macchiato/; s/Navy/Mocha/; /Ayu/d' theme/index.hbs
@@ -149,6 +149,11 @@ jobs:
149149
-o src/assets/whichlang.js \
150150
https://raw.githubusercontent.com/phoenixr-codes/mdbook-whichlang/master/dist/whichlang.js
151151
152+
# Mermaid JS
153+
curl -sSf \
154+
-o src/assets/mermaid.min.js \
155+
https://cdn.jsdelivr.net/npm/mermaid/dist/mermaid.min.js
156+
152157
- name: Build the mdBook Site
153158
run: mdbook build
154159

Diff for: book.toml

+10-2
Original file line numberDiff line numberDiff line change
@@ -12,7 +12,7 @@ create-missing = true
1212

1313
[output.html]
1414
default-theme = "latte"
15-
preferred-dark-theme = "mocha"
15+
preferred-dark-theme = "macchiato"
1616
# URL to send visitors who click edit
1717
edit-url-template = "https://github.com/tcpipuk/tcpipuk.github.io/edit/main/{path}"
1818
# Remove numbers before each item in the sidebar
@@ -30,11 +30,19 @@ additional-css = [
3030
"./theme/catppuccin.css",
3131
"./theme/catppuccin-admonish.css",
3232
]
33-
additional-js = ["src/assets/table-of-contents.js", "src/assets/whichlang.js"]
33+
additional-js = [
34+
"src/assets/table-of-contents.js",
35+
"src/assets/whichlang.js",
36+
"src/assets/mermaid.min.js",
37+
"src/assets/mermaid-init.js",
38+
]
3439

3540
[preprocessor.footnote]
3641

3742
[preprocessor.graphviz]
3843
after = ["links"]
3944
command = "mdbook-graphviz"
4045
output-to-file = false
46+
47+
[preprocessor.mermaid]
48+
command = "mdbook-mermaid"

Diff for: src/assets/mermaid-init.js

+4
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,4 @@
1+
mermaid.initialize({
2+
securityLevel: "loose",
3+
theme: "dark",
4+
});

Diff for: src/synapse/deployment/README.md

+7-7
Original file line numberDiff line numberDiff line change
@@ -34,16 +34,16 @@ Here's a diagram of how requests should flow once we're done:
3434

3535
```mermaid
3636
graph TD;
37-
A[Client\nRequests] --> B[Client Sync &\nStream Writers];
38-
A --> C[Main\nProcess];
37+
A[Client<br>Requests] --> B[Client Sync &<br>Stream Writers];
38+
A --> C[Main<br>Process];
3939
C --> B;
40-
C --> E[Background &\nEvent Writer];
41-
A --> D[Room\nWorkers];
42-
F[Federation\nRequests] --> D;
43-
F --> G[Federation\nReader]
40+
C --> E[Background &<br>Event Writer];
41+
A --> D[Room<br>Workers];
42+
F[Federation<br>Requests] --> D;
43+
F --> G[Federation<br>Reader]
4444
G --> B;
4545
G --> E;
46-
H[Media\nRequests] --> I[Media\nRepository];
46+
H[Media<br>Requests] --> I[Media<br>Repository];
4747
```
4848

4949
- **Main Process**: Some requests can only go to the Synapse main process, but we also send client

0 commit comments

Comments
 (0)