# montaro2017/bili_novel_packer architecture

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

- Interactive diagram: https://gitdiagram.com/montaro2017/bili_novel_packer
- Repository: https://github.com/montaro2017/bili_novel_packer

## Overview

This Dart application packages novels from Bili Novel and Wenku8 into EPUBs, documented as including illustrations and a table of contents. The README describes running the executable or using a command prompt, but no source excerpts or SOURCE INDEX were provided. Accordingly, the graph shows documented capabilities and marks inferred internal handoffs as unverified rather than claiming source-level call relationships.

Main entry points: [`lib/light_novel/base/light_novel_model.dart`](https://github.com/montaro2017/bili_novel_packer/blob/master/lib/light_novel/base/light_novel_model.dart) (Novel model), [`lib/epub_packer/epub_packer.dart`](https://github.com/montaro2017/bili_novel_packer/blob/master/lib/epub_packer/epub_packer.dart) (EPUB packer), [`bin/main.dart`](https://github.com/montaro2017/bili_novel_packer/blob/master/bin/main.dart) (CLI entry), [`lib/light_novel/bili_novel/bili_novel_source.dart`](https://github.com/montaro2017/bili_novel_packer/blob/master/lib/light_novel/bili_novel/bili_novel_source.dart) (Bili adapter)

## Diagram (Mermaid)

```mermaid
flowchart TD

subgraph group_interaction["User interaction"]
  node_cli["CLI entry<br/>[main.dart]"]
  node_console["Console prompts"]
end

subgraph group_sources["Novel sources"]
  node_bili_source["Bili adapter"]
  node_wenku_source["Wenku adapter"]
end

subgraph group_domain["Novel domain"]
  node_novel_model["Novel model"]
  node_cover_detect["Cover detection"]
  node_chapter_restore["Chapter restore"]
end

subgraph group_output["EPUB output"]
  node_packer["EPUB packer<br/>[epub_packer.dart]"]
  node_navigation["EPUB navigation"]
  node_opf["EPUB package metadata<br/>[epub_opf.dart]"]
  node_epub_file["EPUB with images and TOC"]
end

node_user(("Reader"))
node_bili_site["Bili Novel"]
node_wenku_site["Wenku8"]

node_user -->|"runs"| node_cli
node_cli -.->|"uses prompts"| node_console
node_bili_site -->|"supported source"| node_bili_source
node_wenku_site -->|"supported source"| node_wenku_source
node_bili_source -.->|"provides novel data"| node_novel_model
node_wenku_source -.->|"provides novel data"| node_novel_model
node_novel_model -.->|"cover handling"| node_cover_detect
node_novel_model -.->|"chapter handling"| node_chapter_restore
node_novel_model -.->|"packages novel"| node_packer
node_packer -.->|"creates navigation"| node_navigation
node_packer -.->|"writes metadata"| node_opf
node_packer -->|"produces EPUB"| node_epub_file

click node_cli "https://github.com/montaro2017/bili_novel_packer/blob/master/bin/main.dart"
click node_console "https://github.com/montaro2017/bili_novel_packer/tree/master/lib/console"
click node_bili_source "https://github.com/montaro2017/bili_novel_packer/blob/master/lib/light_novel/bili_novel/bili_novel_source.dart"
click node_wenku_source "https://github.com/montaro2017/bili_novel_packer/blob/master/lib/light_novel/wenku_novel/wenku_novel_source.dart"
click node_novel_model "https://github.com/montaro2017/bili_novel_packer/blob/master/lib/light_novel/base/light_novel_model.dart"
click node_cover_detect "https://github.com/montaro2017/bili_novel_packer/blob/master/lib/light_novel/base/light_novel_cover_detector.dart"
click node_chapter_restore "https://github.com/montaro2017/bili_novel_packer/blob/master/lib/light_novel/bili_novel/bili_novel_restore.dart"
click node_packer "https://github.com/montaro2017/bili_novel_packer/blob/master/lib/epub_packer/epub_packer.dart"
click node_navigation "https://github.com/montaro2017/bili_novel_packer/blob/master/lib/epub_packer/epub_navigator_ncx.dart"
click node_opf "https://github.com/montaro2017/bili_novel_packer/blob/master/lib/epub_packer/epub_opf.dart"

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,node_console toneBlue
class node_bili_source,node_wenku_source toneAmber
class node_novel_model,node_cover_detect,node_chapter_restore toneMint
class node_packer,node_navigation,node_opf,node_epub_file toneRose
class node_user,node_bili_site,node_wenku_site toneIndigo
```

## Components

### User interaction

- [CLI entry](https://github.com/montaro2017/bili_novel_packer/blob/master/bin/main.dart): `bin/main.dart`
- [Console prompts](https://github.com/montaro2017/bili_novel_packer/tree/master/lib/console): `lib/console`

### Novel sources

- [Bili adapter](https://github.com/montaro2017/bili_novel_packer/blob/master/lib/light_novel/bili_novel/bili_novel_source.dart): `lib/light_novel/bili_novel/bili_novel_source.dart`
- [Wenku adapter](https://github.com/montaro2017/bili_novel_packer/blob/master/lib/light_novel/wenku_novel/wenku_novel_source.dart): `lib/light_novel/wenku_novel/wenku_novel_source.dart`

### Novel domain

- [Novel model](https://github.com/montaro2017/bili_novel_packer/blob/master/lib/light_novel/base/light_novel_model.dart): `lib/light_novel/base/light_novel_model.dart`
- [Cover detection](https://github.com/montaro2017/bili_novel_packer/blob/master/lib/light_novel/base/light_novel_cover_detector.dart): `lib/light_novel/base/light_novel_cover_detector.dart`
- [Chapter restore](https://github.com/montaro2017/bili_novel_packer/blob/master/lib/light_novel/bili_novel/bili_novel_restore.dart): `lib/light_novel/bili_novel/bili_novel_restore.dart`

### EPUB output

- [EPUB packer](https://github.com/montaro2017/bili_novel_packer/blob/master/lib/epub_packer/epub_packer.dart): `lib/epub_packer/epub_packer.dart`
- [EPUB navigation](https://github.com/montaro2017/bili_novel_packer/blob/master/lib/epub_packer/epub_navigator_ncx.dart): `lib/epub_packer/epub_navigator_ncx.dart`
- [EPUB package metadata](https://github.com/montaro2017/bili_novel_packer/blob/master/lib/epub_packer/epub_opf.dart): `lib/epub_packer/epub_opf.dart`
- **EPUB with images and TOC**

### Other components

- **Reader**
- **Bili Novel**
- **Wenku8**

## Connections

- Reader → CLI entry: runs (evidence: `README.md`)
- CLI entry → Console prompts: uses prompts
- Bili Novel → Bili adapter: supported source (evidence: `README.md`)
- Wenku8 → Wenku adapter: supported source (evidence: `README.md`)
- Bili adapter → Novel model: provides novel data
- Wenku adapter → Novel model: provides novel data
- Novel model → Cover detection: cover handling
- Novel model → Chapter restore: chapter handling
- Novel model → EPUB packer: packages novel
- EPUB packer → EPUB navigation: creates navigation
- EPUB packer → EPUB package metadata: writes metadata
- EPUB packer → EPUB with images and TOC: produces EPUB (evidence: `README.md`)
