MCPcopy Create free account
hub / github.com/anixe/doku

github.com/anixe/doku @main

Chat with this repo
repository ↗ · DeepWiki ↗ · + Follow
596 symbols 1,240 edges 270 files ⚖ MIT 29 documented · 5% updated 3y ago★ 873 open issues

Browse by type

Functions 354 Types & classes 242
What it actually does AI analysis from the code graph — generated when you open this
loading…
README

Doku   crates-badge docs-badge

Doku is a framework for documenting Rust data structures - it allows to generate aesthetic, human-friendly descriptions of configuration types, requests / responses, and so on.

Say goodbye to stale, hand-written documentation - with Doku, code is the documentation!

Example

[dependencies]
doku = "0.21"
use doku::Document;
use serde::Deserialize;

#[derive(Deserialize, Document)]
struct Config {
    /// Database's engine
    db_engine: DbEngine,

    /// Database's host
    #[doku(example = "localhost")]
    db_host: String,

    /// Database's port
    #[doku(example = "5432")]
    db_port: usize,
}

#[derive(Deserialize, Document)]
enum DbEngine {
    #[serde(rename = "pgsql")]
    PostgreSQL,

    #[serde(rename = "mysql")]
    MySQL,
}

fn main() {
    println!("```json");
    println!("{}", doku::to_json::<Config>());
    println!("```");
    println!();
    println!("```toml");
    println!("{}", doku::to_toml::<Config>());
    println!("```");
}
{
  // Database's engine
  "db_engine": "pgsql" | "mysql",
  // Database's host
  "db_host": "localhost",
  // Database's port
  "db_port": 5432
}
# Database's engine
db_engine = "pgsql" | "mysql"

# Database's host
db_host = "localhost"

# Database's port
db_port = 5432

You'll find more examples in ./doku/examples; there's also a documentation at https://docs.rs/doku/.

Contributing

Found a bug, have an idea? Please let us know on GitHub - patches are welcome, too!

If you want to try hacking on Doku, the entry points are:

There are also integration tests at ./doku/tests.

License

Licensed under the MIT license.

Extension points exported contracts — how you extend this code

browse all types & interfaces →

Core symbols most depended-on inside this repo

browse all functions →

Shape

Method 266
Class 158
Function 88
Enum 80
Interface 4

Languages

Rust100%

Modules by API surface

doku/src/objects/value/serializer.rs44 symbols
doku/src/printers/toml/output.rs20 symbols
doku/src/printers/toml/ctxt.rs19 symbols
doku/src/printers/json/output.rs15 symbols
doku/src/printers/json/ctxt.rs13 symbols
doku/src/objects/type.rs11 symbols
doku/src/objects/meta.rs9 symbols
doku/src/printers/toml.rs8 symbols
doku/src/printers/json.rs8 symbols
doku/src/printers/common/output.rs8 symbols
doku/src/lib.rs8 symbols
doku/src/printers/toml/print_scalar.rs7 symbols

For agents

$ claude mcp add doku \
  -- python -m otcore.mcp_server <graph>

⬇ download graph artifact

Ask about this repo answers extend the page