Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion Cargo.lock

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

6 changes: 3 additions & 3 deletions Cargo.toml
Original file line number Diff line number Diff line change
@@ -1,13 +1,13 @@
[package]
name = "tread"
version = "0.2.0"
version = "0.3.0"
edition = "2021"
rust-version = "1.75"
description = "A terminal reader for markdown, CSV and JSON. Zero dependencies."
description = "A terminal reader for markdown, CSV, JSON and source code. Zero dependencies."
repository = "https://github.com/viict/tread"
license = "MIT OR Apache-2.0"
readme = "README.md"
keywords = ["pager", "markdown", "csv", "json", "tui"]
keywords = ["pager", "markdown", "csv", "json", "code"]
categories = ["command-line-utilities", "text-processing"]

[[bin]]
Expand Down
16 changes: 11 additions & 5 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -2,9 +2,11 @@

`less`, but it understands file types.

A terminal reader for markdown, CSV, JSON and JSON Lines. Collapsible
headings, banner H1s, real box-drawn tables, colored links, and navigation
across a corpus of linked documents — and for data, files far too big to load:
A terminal reader for markdown, CSV, JSON, JSON Lines and source code.
Collapsible headings, banner H1s, real box-drawn tables, colored links, and
navigation across a corpus of linked documents — in code, the same folds over
declarations and the same `Enter` over an import — and for data, files far too
big to load:
a multi-GB CSV or JSON opens in milliseconds, because nothing reads the whole
file. One static binary, no runtime, no configuration, **no dependencies at
all** — not even `libc`. Every format is compiled in; nothing is ever loaded at
Expand Down Expand Up @@ -107,8 +109,12 @@ $ tread --index ~/notes
| CSV | `.csv`, `.tsv` | any size; sniffed delimiter, `sep=` directive |
| JSON | `.json` | any size; foldable tree, source-faithful values |
| JSON Lines | `.jsonl`, `.ndjson` | any size; one record per line, lenses |
| Code | `.rs`, `.ts` `.tsx` `.js` `.jsx` `.mjs` `.cjs`, `.py` `.pyi`, `.java` | folds over declarations, `Enter` follows an import |
| Plain text | `.txt`, `.text`, and any extension naming no parser | the file's lines, verbatim |

Anything unnamed — a pipe — is sniffed. `--format` forces the choice.
Anything unnamed — a pipe — is sniffed. `--format` forces the choice among
`md`, `csv`, `json`, `jsonl` and `text`; code is chosen by extension, since a
file that does not lex cleanly falls back to plain source on its own.

## Build from source

Expand Down Expand Up @@ -563,7 +569,7 @@ every syscall is a hand-written `extern "C"` declaration.

```
$ cargo tree
tread v0.2.0
tread v0.3.0
```

All `unsafe` lives in the platform backends under [`src/sys/`](src/sys/); every
Expand Down
2 changes: 1 addition & 1 deletion src/cli.rs
Original file line number Diff line number Diff line change
Expand Up @@ -78,7 +78,7 @@ impl fmt::Display for CliError {
pub fn help_text() -> String {
format!(
"\
{BIN} {VERSION} — a terminal reader for markdown, CSV and JSON
{BIN} {VERSION} — a terminal reader for markdown, CSV, JSON and code

USAGE
{BIN} [OPTIONS] [FILE]
Expand Down
Loading