How pouuup/docshelf works
DocShelf is a terminal document reader: a user supplies a URL, the app fetches and parses the page into titled sections and text/code blocks, saves or updates it under data, then presents it for keyboard-driven reading. The map follows the sampled entry point, import, parser, storage, and TUI code. The README is empty and several TUI modules are represented only by the tree, so uncertain internal calls are omitted.
Main entry points: parser.go Page parser · main.go CLI entry · import.go Import workflow · storage.go JSON storage
Components 16
Import and parsing
- Import workflow
internal/app/import.go - Page parser
internal/parser/parser.go - Document model
internal/models/document.go - Section model
internal/models/section.go - Block model
internal/models/block.go
Document storage
- JSON storage
internal/storage/storage.go - Document files
data
Terminal reader
- Reader state
internal/tui/model.go - Key handling
internal/tui/update.go - Screen rendering
internal/tui/view.go - Content formatting
internal/tui/content.go - Code highlighting
internal/tui/code.go - Terminal runtime
Other components
- User
- CLI entry
cmd/docshelf/main.go - Web page
Connections 19
- User → CLI entry: enters URL
- CLI entry → Import workflow: imports URL
- Import workflow → Page parser: parses URL
- Page parser → Web page: fetches HTML
- Page parser → Document model: builds document
- Page parser → Section model: builds sections
- Page parser → Block model: builds blocks
- Import workflow → JSON storage: checks, saves or updates
- JSON storage → Document files: reads and writes
- Import workflow → CLI entry: returns document
- CLI entry → Reader state: creates reader state
- CLI entry → Terminal runtime: starts program
- Terminal runtime → Key handling: dispatches input
- Key handling → Reader state: updates state
- Terminal runtime → Screen rendering: requests view
- Screen rendering → Content formatting: formats section content
- Content formatting → Code highlighting: highlights code
- Terminal runtime → User: shows screen
- User → Terminal runtime: presses keys