This document provides an overview of the Synapse DB documentation system.
Synapse DB has three types of documentation:
Purpose: Comprehensive user-facing documentation
Technology: mdBook
Output: Static website at https://aaronberkhoff.github.io/synapse-db
# Install mdBook
cargo install mdbook
# Build and serve with live reload
mdbook serve
# Build only
mdbook build
See book/README.md for details.
Purpose: Auto-generated API documentation from doc comments
Technology: rustdoc
Output: Integrated into mdBook at /api-docs/
# Build API docs
cargo doc --no-deps --all-features
# Build and open in browser
cargo doc --no-deps --all-features --open
/// Short description of the function.
///
/// # Arguments
///
/// * `param` - Description of parameter
///
/// # Examples
///
/// ```
/// use synapse_db::Storage;
/// let storage = Storage::new();
/// ```
///
/// # Panics
///
/// When this function panics (if applicable)
///
/// # Errors
///
/// When this function returns an error (if applicable)
pub fn example_function(param: &str) -> Result<(), String> {
// implementation
}
Purpose: Explain complex code logic Guidelines:
// for line comments, /* */ for block commentsChangelogs are automatically generated from git commits using git-cliff.
Configured in cliff.toml
# Manual generation
./scripts/generate-changelog.sh
# Or directly
cargo install git-cliff
git-cliff --output CHANGELOG.md
Use Conventional Commits:
<type>[optional scope]: <description>
[optional body]
[optional footer(s)]
Types:
feat: New feature → Appears in “Features” sectionfix: Bug fix → Appears in “Bug Fixes” sectiondocs: Documentation → Appears in “Documentation” sectionperf: Performance → Appears in “Performance” sectionrefactor: Code refactoring → Appears in “Refactor” sectionstyle: Code styling → Appears in “Styling” sectiontest: Tests → Appears in “Testing” sectionchore: Maintenance → Appears in “Miscellaneous” sectionExamples:
git commit -m "feat: add query caching"
git commit -m "fix: resolve memory leak in storage"
git commit -m "docs: update API documentation"
git commit -m "perf(query): optimize query execution"
./scripts/generate-changelog.shCHANGELOG.md (root)book/changelog.md (documentation)Configured in .github/workflows/docs.yml
All the above, plus:
You can manually trigger documentation builds via:
workflow_dispatch eventWhen adding a new feature:
/// Description of new feature
pub fn new_feature() {}
book/ if major featureUpdate SUMMARY.md if you added new pages
Update CHANGELOG.md manually or wait for auto-generation
mdbook build
cargo doc
git commit -m "feat: add awesome feature"
To update existing documentation:
Edit markdown files in book/
mdbook serve
# Open http://localhost:3000
git commit -m "docs: update installation guide"
synapse-db/
├── book/ # mdBook source
│ ├── SUMMARY.md # Table of contents
│ ├── introduction.md # Home page
│ ├── getting-started/ # Tutorial content
│ ├── guide/ # Feature guides
│ ├── api/ # API overview
│ ├── development/ # Contributing docs
│ ├── changelog.md # Copy of root CHANGELOG.md
│ ├── faq.md
│ └── glossary.md
├── book.toml # mdBook configuration
├── cliff.toml # git-cliff configuration
├── CHANGELOG.md # Generated changelog
├── CONTRIBUTING.md # Contribution guide
├── DOCUMENTATION.md # This file
├── README.md # Project overview
├── src/ # Rust code with doc comments
└── .github/
└── workflows/
└── docs.yml # Documentation CI/CD
# User guide
mdbook serve
# Open http://localhost:3000
# API docs
cargo doc --open
# Ensure mdBook is installed
cargo install mdbook
# Check for syntax errors in SUMMARY.md
mdbook build
# Clean and rebuild
mdbook clean
mdbook build
# Check for doc comment syntax errors
cargo doc
# Fix clippy warnings in doc comments
cargo clippy --all-targets
# Ensure git-cliff is installed
cargo install git-cliff
# Check cliff.toml for syntax errors
git-cliff --output CHANGELOG.md
contents: write permissionMaintaining Documentation: Documentation is code. Keep it tested, reviewed, and updated just like your Rust code.