Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
10 changes: 10 additions & 0 deletions .github/renovate.json
Original file line number Diff line number Diff line change
Expand Up @@ -13,6 +13,16 @@
"depNameTemplate": "mdbook",
"packageNameTemplate": "rust-lang/mdBook",
"datasourceTemplate": "github-releases"
},
{
"customType": "regex",
"fileMatch": ["(^|/)\\.github/workflows/(deploy|ci)\\.yaml$"],
"matchStrings": [
"#\\s?renovate: badboy/mdbook-mermaid\\s*MDBOOK_MERMAID_VERSION:\\s*\"(?<currentValue>\\d+\\.\\d+\\.\\d+)\""
],
"depNameTemplate": "mdbook-mermaid",
"packageNameTemplate": "badboy/mdbook-mermaid",
"datasourceTemplate": "github-releases"
}
]
}
7 changes: 7 additions & 0 deletions .github/workflows/ci.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -14,6 +14,8 @@ jobs:
env:
# renovate: rust-lang/mdBook
MDBOOK_VERSION: "0.5.1"
# renovate: badboy/mdbook-mermaid
MDBOOK_MERMAID_VERSION: "0.17.1"
steps:
- name: Checkout
uses: actions/checkout@v7
Expand All @@ -28,6 +30,11 @@ jobs:
with:
mdbook-version: ${{ env.MDBOOK_VERSION }}

- name: Install mdbook-mermaid
run: |
curl -fsSL "https://github.com/badboy/mdbook-mermaid/releases/download/v${MDBOOK_MERMAID_VERSION}/mdbook-mermaid-v${MDBOOK_MERMAID_VERSION}-x86_64-unknown-linux-gnu.tar.gz" \
| tar -xz -C /usr/local/bin mdbook-mermaid

- name: Run fmt
run: |
deno task format:check
Expand Down
7 changes: 7 additions & 0 deletions .github/workflows/deploy.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -20,6 +20,8 @@ jobs:
env:
# renovate: rust-lang/mdBook
MDBOOK_VERSION: "0.5.3"
# renovate: badboy/mdbook-mermaid
MDBOOK_MERMAID_VERSION: "0.17.1"
steps:
- name: Checkout
uses: actions/checkout@v7
Expand All @@ -32,6 +34,11 @@ jobs:
with:
mdbook-version: ${{ env.MDBOOK_VERSION }}

- name: Install mdbook-mermaid
run: |
curl -fsSL "https://github.com/badboy/mdbook-mermaid/releases/download/v${MDBOOK_MERMAID_VERSION}/mdbook-mermaid-v${MDBOOK_MERMAID_VERSION}-x86_64-unknown-linux-gnu.tar.gz" \
| tar -xz -C /usr/local/bin mdbook-mermaid

- name: Build with mdbook
run: mdbook build

Expand Down
10 changes: 10 additions & 0 deletions book.toml
Original file line number Diff line number Diff line change
Expand Up @@ -7,3 +7,13 @@ authors = ["Pulsate Project Team <info@pulsate.dev>"]
[build]
build-dir = "build"
create-missing = false

[preprocessor]

[preprocessor.mermaid]
command = "mdbook-mermaid"

[output]

[output.html]
additional-js = ["mermaid.min.js", "mermaid-init.js"]
45 changes: 45 additions & 0 deletions mermaid-init.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,45 @@
// This Source Code Form is subject to the terms of the Mozilla Public
// License, v. 2.0. If a copy of the MPL was not distributed with this
// file, You can obtain one at https://mozilla.org/MPL/2.0/.

(() => {
const darkThemes = ["ayu", "navy", "coal"];
const lightThemes = ["light", "rust"];

const classList = document.getElementsByTagName("html")[0].classList;

let lastThemeWasLight = true;
for (const cssClass of classList) {
if (darkThemes.includes(cssClass)) {
lastThemeWasLight = false;
break;
}
}

const theme = lastThemeWasLight ? "default" : "dark";
mermaid.initialize({ startOnLoad: true, theme });

// Simplest way to make mermaid re-render the diagrams in the new theme is via refreshing the page

for (const darkTheme of darkThemes) {
document.getElementById("mdbook-theme-" + darkTheme).addEventListener(
"click",
() => {
if (lastThemeWasLight) {
window.location.reload();
}
},
);
}

for (const lightTheme of lightThemes) {
document.getElementById("mdbook-theme-" + lightTheme).addEventListener(
"click",
() => {
if (!lastThemeWasLight) {
window.location.reload();
}
},
);
}
})();
2,609 changes: 2,609 additions & 0 deletions mermaid.min.js

Large diffs are not rendered by default.

1 change: 1 addition & 0 deletions src/SUMMARY.md
Original file line number Diff line number Diff line change
Expand Up @@ -11,6 +11,7 @@
- [Drive モジュール](./model/drive.md)
- [List モジュール](./model/list.md)
- [Notification モジュール](./model/notification.md)
- [ドメインイベント](./model/event.md)
- [API エンドポイント](./endpoint.md)
- [アカウントAPI](./endpoint/account.md)
- [ドライブAPI](./endpoint/drive.md)
Expand Down
1 change: 1 addition & 0 deletions src/model.md
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,7 @@ Pulsate
- [Drive モジュール編](./model/drive.md)
- [List モジュール編](./model/list.md)
- [Notification モジュール編](./model/notification.md)
- [ドメインイベント](./model/event.md)

## ID

Expand Down
Loading
Loading