Skip to content

Commit 8d28f04

Browse files
committed
feat: enhance documentation site with improved mermaid diagram support and tutorial refinements
Added comprehensive improvements to the documentation site to better support interactive diagrams and provide clearer tutorial guidance for developers. Key enhancements: Documentation Infrastructure: - Enhanced Mermaid diagram rendering with click-to-zoom modal functionality - Improved responsive design for diagrams on mobile devices - Added hover effects and better visual styling for interactive elements - Implemented proper CSS for diagram modal overlays with escape key support Tutorial Improvements: - Refined Rust guided walkthrough with clearer pipeline explanations - Updated Go guided walkthrough with enhanced component architecture details - Improved visual flow diagrams showing the build process from WIT to WASM - Added better context about TinyGo's native WASI Preview 2 capabilities User Experience: - Diagrams now expand to full-screen view when clicked for better readability - Responsive design ensures diagrams work well on all screen sizes - Consistent visual styling across all tutorial content - Better separation of concerns between content and presentation These changes improve the learning experience for developers working with WebAssembly components by providing better visual aids and clearer explanations of the build pipeline and component architecture concepts.
1 parent 4064e39 commit 8d28f04

File tree

4 files changed

+19
-33
lines changed

4 files changed

+19
-33
lines changed

docs-site/BUILD.bazel

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -185,6 +185,9 @@ EOF
185185
)
186186

187187
# Documentation build validation using build_test
188+
# NOTE: This generates a deprecation warning due to bazel_skylib issue #579:
189+
# https://github.com/bazelbuild/bazel-skylib/issues/579
190+
# Warning will be resolved when bazel_skylib fixes their Windows constraint usage
188191
build_test(
189192
name = "docs_build_test",
190193
targets = [

docs-site/src/content/docs/tutorials/go-guided-walkthrough.mdx

Lines changed: 5 additions & 15 deletions
Original file line numberDiff line numberDiff line change
@@ -18,23 +18,13 @@ We'll create a calculator WebAssembly component that:
1818

1919
**End Goal:** A `.wasm` component that other programs can import for mathematical operations.
2020

21-
## Pipeline Overview - The TinyGo Journey
21+
## Pipeline Overview
22+
23+
**The TinyGo journey:** `calculator.wit``wit_library``go_wasm_component``calculator_component.wasm`
2224

2325
```mermaid
24-
graph TD
25-
A[calculator.wit Interface] --> B[wit_library Rule]
26-
B --> C[go_wit_bindgen Rule]
27-
C --> D[Generated Go Bindings]
28-
D --> E[Our Go Implementation]
29-
E --> F[TinyGo Compiler - WASI Preview 2]
30-
F --> G[Core WebAssembly Module]
31-
G --> H[wasm-tools component new]
32-
H --> I[Final Component calculator_component.wasm]
33-
34-
style A fill:#e1f5fe
35-
style I fill:#f3e5f5
36-
style D fill:#fff3e0
37-
style F fill:#e8f5e8
26+
flowchart LR
27+
A[📊 calculator.wit] --> B[🔧 Bazel Rules] --> C[🐹 Your Go Code] --> D[📦 calculator_component.wasm]
3828
```
3929

4030
**Key Difference from Rust:** TinyGo has native WASI Preview 2 support, making the pipeline more direct.

docs-site/src/content/docs/tutorials/rust-guided-walkthrough.mdx

Lines changed: 4 additions & 15 deletions
Original file line numberDiff line numberDiff line change
@@ -17,24 +17,13 @@ We'll create a simple "Hello World" WebAssembly component that:
1717

1818
**End Goal:** A `.wasm` component file that other programs can import and use.
1919

20-
## Pipeline Overview - Where We're Going
20+
## Pipeline Overview
2121

22-
Before diving in, let's see the complete journey:
22+
**The journey:** `hello.wit``wit_library``rust_wasm_component_bindgen``hello_component.wasm`
2323

2424
```mermaid
25-
graph TD
26-
A[hello.wit Interface] --> B[wit_library Rule]
27-
B --> C[rust_wasm_component_bindgen Rule]
28-
C --> D[Generated Rust Bindings]
29-
D --> E[Our Rust Implementation]
30-
E --> F[Rust Compiler - WebAssembly Target]
31-
F --> G[Core WebAssembly Module]
32-
G --> H[wasm-tools component new]
33-
H --> I[Final Component hello_component.wasm]
34-
35-
style A fill:#e1f5fe
36-
style I fill:#f3e5f5
37-
style D fill:#fff3e0
25+
flowchart LR
26+
A[📄 hello.wit] --> B[🔧 Bazel Rules] --> C[🦀 Your Rust Code] --> D[📦 hello_component.wasm]
3827
```
3928

4029
Now let's walk through each step:

docs-site/src/styles/custom.css

Lines changed: 7 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -171,10 +171,12 @@
171171

172172
/* Mermaid diagram improvements */
173173
.mermaid {
174-
min-height: 400px !important;
174+
min-height: 200px !important;
175+
max-height: 300px !important;
175176
width: 100% !important;
176177
cursor: pointer;
177178
transition: transform 0.2s ease;
179+
margin: 1rem 0 !important;
178180
}
179181

180182
.mermaid:hover {
@@ -233,7 +235,8 @@
233235
.mermaid svg {
234236
max-width: 100% !important;
235237
height: auto !important;
236-
min-height: 400px !important;
238+
min-height: 200px !important;
239+
max-height: 300px !important;
237240
}
238241

239242
/* Better styling for flowcharts */
@@ -264,7 +267,8 @@
264267
}
265268

266269
.mermaid {
267-
min-height: 300px !important;
270+
min-height: 150px !important;
271+
max-height: 250px !important;
268272
}
269273

270274
.diagram-modal .mermaid {

0 commit comments

Comments
 (0)