# jlucfarias/toth architecture

> Architecture diagram of the GitHub repository jlucfarias/toth, generated by GitDiagram from its file tree, README and a sample of source files (last updated 2026-10-16). It is an AI-made overview: check details against the source.

- Interactive diagram: https://gitdiagram.com/jlucfarias/toth
- Repository: https://github.com/jlucfarias/toth

## Overview

Toth is a Rust CLI for preparing book exports from a Markdown-book project. The observed workflow reads `book.toml`, parses book metadata, selects EPUB, derives an output filename and prints the planned destination. The sampled code does not read Markdown chapters or write an EPUB, so those generation stages are not represented as implemented components. The README also describes book-structure and presentation customization, but the sampled core model exposes only a title; its implementation is therefore uncertain.

Main entry points: [`crates/cli/src/main.rs`](https://github.com/jlucfarias/toth/blob/master/crates/cli/src/main.rs) (CLI command), [`crates/core/src/format.rs`](https://github.com/jlucfarias/toth/blob/master/crates/core/src/format.rs) (Export format), [`crates/core/src/book.rs`](https://github.com/jlucfarias/toth/blob/master/crates/core/src/book.rs) (Book metadata)

## Diagram (Mermaid)

```mermaid
flowchart TD

subgraph group_cli["CLI workflow"]
  node_cli_app["CLI command<br/>[main.rs]"]
end

subgraph group_book["Book domain"]
  node_book_model["Book metadata<br/>[book.rs]"]
  node_export_format["Export format<br/>[format.rs]"]
  node_book_customization["Book customization"]
end

node_user(("CLI user"))
node_config["book.toml"]

node_user -->|"invokes"| node_cli_app
node_cli_app -->|"reads"| node_config
node_cli_app -->|"parses metadata"| node_book_model
node_cli_app -->|"selects format"| node_export_format
node_cli_app -->|"gets extension"| node_export_format

click node_cli_app "https://github.com/jlucfarias/toth/blob/master/crates/cli/src/main.rs"
click node_book_model "https://github.com/jlucfarias/toth/blob/master/crates/core/src/book.rs"
click node_export_format "https://github.com/jlucfarias/toth/blob/master/crates/core/src/format.rs"
click node_book_customization "https://github.com/jlucfarias/toth/tree/master/crates/core/src"

classDef toneNeutral fill:#f8fafc,stroke:#334155,stroke-width:1.5px,color:#0f172a
classDef toneBlue fill:#dbeafe,stroke:#2563eb,stroke-width:1.5px,color:#172554
classDef toneAmber fill:#fef3c7,stroke:#d97706,stroke-width:1.5px,color:#78350f
classDef toneMint fill:#dcfce7,stroke:#16a34a,stroke-width:1.5px,color:#14532d
classDef toneRose fill:#ffe4e6,stroke:#e11d48,stroke-width:1.5px,color:#881337
classDef toneIndigo fill:#e0e7ff,stroke:#4f46e5,stroke-width:1.5px,color:#312e81
classDef toneTeal fill:#ccfbf1,stroke:#0f766e,stroke-width:1.5px,color:#134e4a
class node_cli_app,node_user toneBlue
class node_book_model,node_export_format,node_book_customization toneAmber
class node_config toneIndigo
```

## Components

### CLI workflow

- [CLI command](https://github.com/jlucfarias/toth/blob/master/crates/cli/src/main.rs): `crates/cli/src/main.rs`

### Book domain

- [Book metadata](https://github.com/jlucfarias/toth/blob/master/crates/core/src/book.rs): `crates/core/src/book.rs`
- [Export format](https://github.com/jlucfarias/toth/blob/master/crates/core/src/format.rs): `crates/core/src/format.rs`
- [Book customization](https://github.com/jlucfarias/toth/tree/master/crates/core/src): `crates/core/src`

### Other components

- **CLI user**
- **book.toml**

## Connections

- CLI user → CLI command: invokes (evidence: `crates/cli/src/main.rs`)
- CLI command → book.toml: reads (evidence: `crates/cli/src/main.rs`)
- CLI command → Book metadata: parses metadata (evidence: `crates/cli/src/main.rs`)
- CLI command → Export format: selects format (evidence: `crates/cli/src/main.rs`)
- CLI command → Export format: gets extension (evidence: `crates/cli/src/main.rs`)
