Skip to content

Commit a0237ef

Browse files
committed
Add mdBook documentation site
- Add docs/ directory with mdBook configuration - Include INTEGRATION_GUIDE.md, BENCHMARKING.md as book chapters - Add documentation modules to lib.rs for docs.rs - Update GitHub Actions to build mdBook + rustdoc Signed-off-by: Zvi Schneider <z2357@outlook.com>
1 parent c258428 commit a0237ef

8 files changed

Lines changed: 72 additions & 5 deletions

File tree

.github/workflows/docs.yml

Lines changed: 21 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -22,17 +22,33 @@ jobs:
2222

2323
- name: Setup Rust
2424
uses: dtolnay/rust-toolchain@stable
25+
26+
- name: Setup mdBook
27+
uses: peaceiris/actions-mdbook@v2
28+
with:
29+
mdbook-version: 'latest'
2530

26-
- name: Build docs
31+
- name: Build rustdoc
2732
run: cargo doc --no-deps --document-private-items
28-
29-
- name: Add redirect
30-
run: echo '<meta http-equiv="refresh" content="0;url=keyspace_tracker/index.html">' > target/doc/index.html
33+
34+
- name: Build mdBook
35+
run: mdbook build docs
36+
37+
- name: Merge documentation
38+
run: |
39+
# Use mdBook as the main site
40+
mkdir -p target/site
41+
cp -r target/book/* target/site/
42+
# Add rustdoc under /api/
43+
mkdir -p target/site/api
44+
cp -r target/doc/* target/site/api/
45+
# Add redirect for API docs
46+
echo '<meta http-equiv="refresh" content="0;url=keyspace_tracker/index.html">' > target/site/api/index.html
3147
3248
- name: Upload artifact
3349
uses: actions/upload-pages-artifact@v3
3450
with:
35-
path: target/doc
51+
path: target/site
3652

3753
deploy:
3854
needs: build

docs/book.toml

Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,12 @@
1+
[book]
2+
title = "keyspace_tracker"
3+
authors = ["Zvi Schneider"]
4+
description = "High-performance bitmap-based existence tracking"
5+
src = "src"
6+
7+
[build]
8+
build-dir = "../target/book"
9+
10+
[output.html]
11+
git-repository-url = "https://github.com/zvi-code/keyspace_tracker"
12+
edit-url-template = "https://github.com/zvi-code/keyspace_tracker/edit/mainline/docs/{path}"

docs/src/README.md

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,3 @@
1+
# keyspace_tracker
2+
3+
{{#include ../../README.md}}

docs/src/SUMMARY.md

Lines changed: 13 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,13 @@
1+
# Summary
2+
3+
[Introduction](./README.md)
4+
5+
# User Guide
6+
7+
- [Integration Guide](./integration-guide.md)
8+
- [Benchmarking](./benchmarking.md)
9+
10+
# Reference
11+
12+
- [API Documentation](../api/keyspace_tracker/index.html)
13+
- [Specification](./spec.md)

docs/src/benchmarking.md

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
{{#include ../../BENCHMARKING.md}}

docs/src/integration-guide.md

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
{{#include ../../INTEGRATION_GUIDE.md}}

docs/src/spec.md

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
{{#include ../../prefix_tracker_spec.md}}

src/lib.rs

Lines changed: 20 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -211,6 +211,26 @@ pub use iterators::{
211211
};
212212
pub use tracker::PrefixTracker;
213213

214+
// =============================================================================
215+
// Documentation Modules
216+
// =============================================================================
217+
218+
/// Integration guide for keyspace_tracker.
219+
///
220+
/// This module contains the full integration specification for using
221+
/// keyspace_tracker with database benchmarking tools.
222+
#[cfg(doc)]
223+
#[doc = include_str!("../INTEGRATION_GUIDE.md")]
224+
pub mod integration_guide {}
225+
226+
/// Benchmarking guide for keyspace_tracker.
227+
///
228+
/// This module contains performance tuning and benchmarking guidance
229+
/// for achieving maximum performance on various platforms.
230+
#[cfg(doc)]
231+
#[doc = include_str!("../BENCHMARKING.md")]
232+
pub mod benchmarking {}
233+
214234
use std::sync::Arc;
215235

216236
use ahash::RandomState as AHasher;

0 commit comments

Comments
 (0)