Skip to content
Merged
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
5 changes: 5 additions & 0 deletions .github/workflows/docs.yml
Original file line number Diff line number Diff line change
Expand Up @@ -40,6 +40,11 @@ jobs:
curl -sSL https://github.com/rust-lang/mdBook/releases/download/v0.4.40/mdbook-v0.4.40-x86_64-unknown-linux-gnu.tar.gz | tar -xz --directory=bin
echo "$GITHUB_WORKSPACE/bin" >> $GITHUB_PATH

- name: Install mdbook-mermaid
run: |
curl -sSL https://github.com/badboy/mdbook-mermaid/releases/download/v0.14.0/mdbook-mermaid-v0.14.0-x86_64-unknown-linux-gnu.tar.gz | tar -xz --directory=bin
echo "$GITHUB_WORKSPACE/bin" >> $GITHUB_PATH

- name: Setup Pages
id: pages
uses: actions/configure-pages@983d7736d9b0ae728b81ab479565c72886d7745b # v5.0.0
Expand Down
5 changes: 5 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -7,3 +7,8 @@

# mdbook output
/docs/book
mdbook
mdbook-mermaid

# typos binary
typos
1 change: 1 addition & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -17,6 +17,7 @@ The format is based on [Keep a Changelog](https://keepachangelog.com/en/1.1.0/),

- `wassette secret set` now returns a clear error message when the component ID is not found, preventing silent failures and providing better user feedback
- Fixed invalid `workflows` permission in dependabot-automerge workflow file that caused GitHub Actions validation error
- Fixed Mermaid sequence diagram rendering in documentation by adding mdbook-mermaid preprocessor configuration

## [v0.3.0] - 2025-10-03

Expand Down
2 changes: 2 additions & 0 deletions _typos.toml
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,8 @@
extend-exclude = [
"**/*.wit",
"**/*.wit.go",
"**/mermaid.min.js",
"**/mermaid-init.js",
]

[default.extend-words]
Expand Down
7 changes: 6 additions & 1 deletion docs/book.toml
Original file line number Diff line number Diff line change
Expand Up @@ -9,8 +9,8 @@ title = "Wassette Documentation"
build-dir = "book"

[output.html]
additional-js = ["mermaid.min.js", "mermaid-init.js", "theme/version-picker.js"]
additional-css = ["theme/version-picker.css"]
additional-js = ["theme/version-picker.js"]
smart-punctuation = true
git-repository-url = "https://github.com/microsoft/wassette"
edit-url-template = "https://github.com/microsoft/wassette/edit/main/docs/{path}"
Expand All @@ -25,3 +25,8 @@ boost-hierarchy = 1
boost-paragraph = 1
expand = true
heading-split-level = 3

[preprocessor]

[preprocessor.mermaid]
command = "mdbook-mermaid"
35 changes: 35 additions & 0 deletions docs/mermaid-init.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,35 @@
(() => {
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(darkTheme).addEventListener('click', () => {
if (lastThemeWasLight) {
window.location.reload();
}
});
}

for (const lightTheme of lightThemes) {
document.getElementById(lightTheme).addEventListener('click', () => {
if (!lastThemeWasLight) {
window.location.reload();
}
});
}
})();
2,186 changes: 2,186 additions & 0 deletions docs/mermaid.min.js

Large diffs are not rendered by default.

Loading