Skip to main content

Crate perga

Crate perga 

Source
Expand description

perga — a terminal Markdown browser.

The binary in main.rs is a thin wrapper: everything it does lives here, so that the whole application can be driven from integration tests without a terminal. Feed a sequence of action::Actions to app::App::update, assert on the state, and render to ratatui::backend::TestBackend for snapshots.

Modules§

action
The Action enum: the only channel through which application state changes.
app
The App struct, the blocking event loop, and top-level state transitions.
cli
Command-line argument definitions.
config
Configuration loading and the five-layer precedence chain.
doc
Document loading, parsing, rendering, outlines, and link extraction.
editor
Editing: the buffer, and the file operations around it.
event
Translation of terminal input events into Action values.
search
Search: project-wide content search, fuzzy file matching, find-in-document.
terminal
Terminal setup, teardown, and the guarantees that the terminal is restored on every exit path.
theme
Theme resolution: built-in themes, user theme files, and colour degradation.
ui
Frame composition. Rendering is a pure function of application state.
vault
The vault: the root directory, its file tree, and the backlink index.