txtview 0.1.3

A lightweight terminal text viewer with scrolling, wrapping, line numbers, and an optional interactive scrollbar
Documentation
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
use txtview::{TxtView, TxtViewConfig};

fn main() -> std::io::Result<()> {
    let text = (1..=100)
        .map(|i| format!("Line {:>3}: The quick brown fox jumps over the lazy dog", i))
        .collect::<Vec<String>>()
        .join("\n");

    let config = TxtViewConfig {
        show_line_numbers: true,
        ..TxtViewConfig::default()
    };

    let mut viewer = TxtView::new(&text).with_config(config);
    viewer.run()
}