Skip to content

Commit 6ef070d

Browse files
kirdatatjanampokejmalicevic
authored
docs: Add docs for block syncing (#33)
* Added Sync specs * Added Sync specs image * add more context for ValueSync * replace image with Mermaid diagram * Update docs/specs/Syncing.md Co-authored-by: Jasmina Malicevic <jasmina.dustinac@gmail.com> * update sync request handling * move Syncing to the docs * update sync response handling * update sync request and add TODO * add todo * update example flow * update reth sync overview * ProcessSyncedValue no longer calls newPayload * update sync request handling * update example flow * add config details * update headers * explain why getPayloadBodiesByRange uses count of 1 * Update docs/operational-docs/src/architecture/syncing.md Co-authored-by: Jasmina Malicevic <jasmina.dustinac@gmail.com> * Update docs/operational-docs/src/architecture/syncing.md Co-authored-by: Jasmina Malicevic <jasmina.dustinac@gmail.com> * Update docs/operational-docs/src/architecture/syncing.md Co-authored-by: Jasmina Malicevic <jasmina.dustinac@gmail.com> --------- Co-authored-by: Marius Poke <marius.poke@posteo.de> Co-authored-by: Jasmina Malicevic <jasmina.dustinac@gmail.com>
1 parent 05f9f1d commit 6ef070d

5 files changed

Lines changed: 2817 additions & 0 deletions

File tree

docs/operational-docs/book.toml

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -10,11 +10,15 @@ create-missing = true
1010

1111
[preprocessor.links]
1212

13+
[preprocessor.mermaid]
14+
command = "mdbook-mermaid"
15+
1316
[output.html]
1417
default-theme = "light"
1518
preferred-dark-theme = "navy"
1619
git-repository-url = "https://github.com/informalsystems/emerald"
1720
additional-css = ["theme/custom.css"]
21+
additional-js = ["mermaid.min.js", "mermaid-init.js"]
1822

1923
[output.html.search]
2024
enable = true
Lines changed: 39 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,39 @@
1+
// This Source Code Form is subject to the terms of the Mozilla Public
2+
// License, v. 2.0. If a copy of the MPL was not distributed with this
3+
// file, You can obtain one at https://mozilla.org/MPL/2.0/.
4+
5+
(() => {
6+
const darkThemes = ['ayu', 'navy', 'coal'];
7+
const lightThemes = ['light', 'rust'];
8+
9+
const classList = document.getElementsByTagName('html')[0].classList;
10+
11+
let lastThemeWasLight = true;
12+
for (const cssClass of classList) {
13+
if (darkThemes.includes(cssClass)) {
14+
lastThemeWasLight = false;
15+
break;
16+
}
17+
}
18+
19+
const theme = lastThemeWasLight ? 'default' : 'dark';
20+
mermaid.initialize({ startOnLoad: true, theme });
21+
22+
// Simplest way to make mermaid re-render the diagrams in the new theme is via refreshing the page
23+
24+
for (const darkTheme of darkThemes) {
25+
document.getElementById(darkTheme).addEventListener('click', () => {
26+
if (lastThemeWasLight) {
27+
window.location.reload();
28+
}
29+
});
30+
}
31+
32+
for (const lightTheme of lightThemes) {
33+
document.getElementById(lightTheme).addEventListener('click', () => {
34+
if (!lastThemeWasLight) {
35+
window.location.reload();
36+
}
37+
});
38+
}
39+
})();

0 commit comments

Comments
 (0)