synapse-db

Synapse DB Documentation

This directory contains the source for the Synapse DB documentation, built with mdBook.

Quick Start

Building Locally

Install mdBook:

cargo install mdbook

Build the documentation:

mdbook build

Serve locally with live reload:

mdbook serve

Then open http://localhost:3000 in your browser.

Structure

book/
├── SUMMARY.md              # Table of contents (mdBook structure)
├── introduction.md         # Home page
├── getting-started/
│   ├── installation.md
│   ├── quick-start.md
│   └── configuration.md
├── guide/
│   ├── overview.md
│   ├── storage.md
│   ├── query-engine.md
│   ├── examples.md
│   └── best-practices.md
├── api/
│   ├── overview.md
│   ├── storage.md
│   └── query.md
├── development/
│   ├── contributing.md
│   ├── architecture.md
│   ├── testing.md
│   ├── release.md
│   ├── cicd.md
│   └── hooks.md
├── changelog.md            # Generated from ../CHANGELOG.md
├── faq.md
└── glossary.md

Writing Documentation

Adding a New Page

  1. Create the markdown file in the appropriate directory
  2. Add it to SUMMARY.md in the correct location
  3. Write your content
  4. Build and preview locally

Markdown Syntax

mdBook supports standard Markdown plus these features:

Code Blocks

use synapse_db::Storage;

fn main() {
    let storage = Storage::new();
}

Admonitions (Info/Warning/Note)

Not natively supported, but you can use blockquotes:

Note: This is an important note

Warning: Be careful with this

[Link to another page](/synapse-db/book/guide/overview.html)
[External link](https://rust-lang.org)

Images

![Alt text](./images/diagram.png)

Configuration

The documentation is configured in ../book.toml. Key settings:

Changelog

The changelog is automatically generated from git commits using git-cliff.

To update the changelog:

./scripts/generate-changelog.sh

This generates ../CHANGELOG.md and copies it to book/changelog.md.

Best Practices

Writing Guidelines

  1. Be concise: Get to the point quickly
  2. Use examples: Show code examples for concepts
  3. Link related content: Help readers find more information
  4. Keep it current: Update docs when code changes

Code Examples

mdBook Commands

# Build the book
mdbook build

# Serve with live reload
mdbook serve

# Serve on custom port
mdbook serve --port 8080

# Open in browser
mdbook serve --open

# Clean build directory
mdbook clean

# Test code examples (requires mdbook-test)
mdbook test

CI/CD

Documentation is automatically built and deployed via GitHub Actions:

See .github/workflows/docs.yml for details.

Troubleshooting

Build Errors

# Ensure mdBook is installed
mdbook --version

# Clean and rebuild
mdbook clean
mdbook build

Missing Pages

Check that the page is listed in SUMMARY.md.

Use mdBook’s built-in link checker:

mdbook build
# Check the build output for warnings

Resources

Contributing

See development/contributing.md for contribution guidelines.