Skip to content

Commit 2a9ab62

Browse files
committed
fix doc
1 parent 12b2a32 commit 2a9ab62

3 files changed

Lines changed: 91 additions & 27 deletions

File tree

.github/workflows/docs.yml

Lines changed: 14 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -33,8 +33,19 @@ jobs:
3333

3434
- name: Build documentation
3535
run: |
36-
cargo doc --all-features --no-deps
37-
cp docs/index.html target/doc/index.html
36+
# Create directory structure for dual documentation
37+
mkdir -p target/doc-final/{cloud,embedded}
38+
39+
# Build cloud/edge documentation
40+
cargo doc --features "std,tokio-runtime,tracing,metrics" --no-deps
41+
cp -r target/doc/* target/doc-final/cloud/
42+
43+
# Build embedded documentation
44+
cargo doc --features "embedded,embassy-runtime" --no-deps
45+
cp -r target/doc/* target/doc-final/embedded/
46+
47+
# Copy main index page
48+
cp docs/index.html target/doc-final/index.html
3849
3950
- name: Setup Pages
4051
if: github.ref == 'refs/heads/main'
@@ -44,7 +55,7 @@ jobs:
4455
if: github.ref == 'refs/heads/main'
4556
uses: actions/upload-pages-artifact@v3
4657
with:
47-
path: ./target/doc
58+
path: ./target/doc-final
4859

4960
- name: Deploy to GitHub Pages
5061
if: github.ref == 'refs/heads/main'

Makefile

Lines changed: 19 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -74,16 +74,26 @@ clippy:
7474
cargo clippy --package aimdb-cli --all-targets -- -D warnings
7575

7676
doc:
77-
@printf "$(GREEN)Generating comprehensive documentation...$(NC)\n"
78-
@printf "$(YELLOW) → Documenting std components with valid features$(NC)\n"
79-
cargo doc --package aimdb-core --features "std,tokio-runtime,tracing,metrics" --no-deps
80-
cargo doc --package aimdb-tokio-adapter --features "tokio-runtime,tracing,metrics" --no-deps
81-
cargo doc --package aimdb-cli --no-deps
82-
@printf "$(YELLOW) → Documenting embassy adapter (embedded-only)$(NC)\n"
83-
cargo doc --package aimdb-embassy-adapter --features "embassy-runtime" --no-deps
77+
@printf "$(GREEN)Generating dual-platform documentation...$(NC)\n"
78+
@# Create directory structure
79+
@mkdir -p target/doc-final/{cloud,embedded}
80+
@printf "$(YELLOW) → Building cloud/edge documentation$(NC)\n"
81+
cargo doc --features "std,tokio-runtime,tracing,metrics" --no-deps
82+
@cp -r target/doc/* target/doc-final/cloud/
83+
@printf "$(YELLOW) → Building embedded documentation$(NC)\n"
84+
cargo doc --features "embedded,embassy-runtime" --no-deps
85+
@cp -r target/doc/* target/doc-final/embedded/
86+
@printf "$(YELLOW) → Creating main index page$(NC)\n"
87+
@cp docs/index.html target/doc-final/index.html
8488
@printf "$(YELLOW) → Opening documentation$(NC)\n"
85-
@# Open the main core documentation
86-
cargo doc --package aimdb-core --features "std,tokio-runtime,tracing,metrics" --no-deps --open
89+
@# Open the main documentation index
90+
@if command -v xdg-open >/dev/null 2>&1; then \
91+
xdg-open target/doc-final/index.html; \
92+
elif command -v open >/dev/null 2>&1; then \
93+
open target/doc-final/index.html; \
94+
else \
95+
printf "$(BLUE)Documentation generated at: file://$(PWD)/target/doc-final/index.html$(NC)\n"; \
96+
fi
8797

8898
clean:
8999
@printf "$(GREEN)Cleaning...$(NC)\n"

docs/index.html

Lines changed: 58 additions & 15 deletions
Original file line numberDiff line numberDiff line change
@@ -79,6 +79,27 @@
7979
font-weight: 500;
8080
}
8181

82+
.platform-card {
83+
background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
84+
color: white;
85+
border: none;
86+
}
87+
88+
.platform-card h3 {
89+
color: white;
90+
}
91+
92+
.platform-card h3 a {
93+
color: white;
94+
font-weight: bold;
95+
}
96+
97+
.platform-card .badge {
98+
background: rgba(255, 255, 255, 0.2);
99+
color: white;
100+
border: 1px solid rgba(255, 255, 255, 0.3);
101+
}
102+
82103
.footer {
83104
margin-top: 3rem;
84105
padding-top: 2rem;
@@ -99,35 +120,57 @@ <h1>AimDB Documentation</h1>
99120
class="badge">Cross-Platform</span> <span class="badge">Real-Time</span></p>
100121
</div>
101122

102-
<h2>API Documentation</h2>
123+
<h2>Platform-Specific Documentation</h2>
124+
125+
<div class="crates-grid">
126+
<div class="crate platform-card">
127+
<h3>🌐 <a href="cloud/">Cloud & Edge Documentation</a></h3>
128+
<p>Complete API documentation for cloud and edge deployments using Tokio runtime. Includes full std library
129+
support,
130+
networking, metrics, and tracing capabilities.</p>
131+
<p><span class="badge">std + Tokio</span> <span class="badge">Full Features</span> <span
132+
class="badge">Linux/Cloud</span></p>
133+
</div>
134+
135+
<div class="crate platform-card">
136+
<h3>🔧 <a href="embedded/">Embedded & MCU Documentation</a></h3>
137+
<p>API documentation for embedded and microcontroller deployments using Embassy runtime.
138+
Optimized for no_std environments with minimal resource usage.</p>
139+
<p><span class="badge">no_std + Embassy</span> <span class="badge">MCU Optimized</span> <span
140+
class="badge">Embedded</span></p>
141+
</div>
142+
</div>
143+
144+
<h2>Core Components</h2>
103145

104146
<div class="crates-grid">
105147
<div class="crate">
106-
<h3><a href="aimdb_core/">aimdb-core</a></h3>
148+
<h3>aimdb-core</h3>
107149
<p>Core database engine and fundamental data structures. Contains the async database implementation,
108150
lock-free data structures, and core APIs.</p>
151+
<p>
152+
<a href="cloud/aimdb_core/">📚 Cloud/Edge API</a> |
153+
<a href="embedded/aimdb_core/">🔧 Embedded API</a>
154+
</p>
109155
<p><span class="badge">Core Engine</span></p>
110156
</div>
111157

112158
<div class="crate">
113-
<h3><a href="aimdb_connectors/">aimdb-connectors</a></h3>
114-
<p>Protocol connectors for MQTT, Kafka, DDS and other messaging systems. Enables seamless integration with
115-
existing infrastructure.</p>
116-
<p><span class="badge">Connectors</span></p>
117-
</div>
118-
119-
<div class="crate">
120-
<h3><a href="aimdb_adapters/">aimdb-adapters</a></h3>
121-
<p>Runtime adapters for different async executors including Tokio, Embassy (embedded), and async-std.
122-
Platform abstraction layer.</p>
159+
<h3>Runtime Adapters</h3>
160+
<p>Platform-specific async runtime adapters. Tokio for cloud/edge environments, Embassy for embedded MCU
161+
targets.</p>
162+
<p>
163+
<a href="cloud/aimdb_tokio_adapter/">📚 Tokio Adapter</a> |
164+
<a href="embedded/aimdb_embassy_adapter/">🔧 Embassy Adapter</a>
165+
</p>
123166
<p><span class="badge">Runtime Support</span></p>
124167
</div>
125168

126169
<div class="crate">
127-
<h3><a href="aimdb_cli/">aimdb-cli</a></h3>
170+
<h3><a href="cloud/aimdb_cli/">aimdb-cli</a></h3>
128171
<p>Command-line interface for managing AimDB instances, configuration, and monitoring. Essential tool for
129-
operations.</p>
130-
<p><span class="badge">CLI Tools</span></p>
172+
cloud and edge operations.</p>
173+
<p><span class="badge">CLI Tools</span> <span class="badge">Cloud Only</span></p>
131174
</div>
132175
</div>
133176

0 commit comments

Comments
 (0)