Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

add internal end-to-end docs #1849

Merged
merged 4 commits into from
Jan 28, 2025
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
6 changes: 6 additions & 0 deletions docs/book.toml
Original file line number Diff line number Diff line change
Expand Up @@ -6,10 +6,16 @@ src = "src"
title = "Shotover"

[output.html]
additional-js = ["mermaid.min.js", "mermaid-init.js"]

[output.linkcheck]
# Should we check links on the internet? Enabling this option adds a
# non-negligible performance impact
follow-web-links = false

warning-policy = "error"

[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.

1 change: 1 addition & 0 deletions docs/src/SUMMARY.md
Original file line number Diff line number Diff line change
Expand Up @@ -18,3 +18,4 @@
- [Shotover sidecars](./examples/cassandra-cluster-shotover-sidecar.md)
- [Contributing](./dev-docs/contributing.md)
- [Debugging](./dev-docs/debugging.md)
- [Internal End-to-End Overview](./dev-docs/end-to-end-overview.md)
596 changes: 596 additions & 0 deletions docs/src/dev-docs/end-to-end-overview.md

Large diffs are not rendered by default.

Binary file added docs/src/dev-docs/end-to-end-overview.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
9 changes: 9 additions & 0 deletions website/src/main.rs
Original file line number Diff line number Diff line change
Expand Up @@ -28,6 +28,15 @@ fn main() {
return;
}

if !Command::new("cargo")
.args(["install", "mdbook-mermaid", "--version", "0.14.0"])
.status()
.unwrap()
.success()
{
return;
}

let root = current_dir.join("website").join("root");
std::fs::remove_dir_all(&root).ok();
std::fs::create_dir_all(&root).unwrap();
Expand Down
Loading