A very fast implementation of tldr in Rust. https://tealdeer-rs.github.io/tealdeer/
  • Rust 94.5%
  • Dockerfile 3.7%
  • Shell 1.8%
Find a file
Danilo Bargen 84227937ae Remove some optional zip features
By getting rid of the bzip2 and time features, we reduce the number of
dependencies. The official tldr pages archive uses deflate compression,
so that should be sufficient.
2021-10-16 20:40:40 +02:00
.github/workflows Bump CI toolchain to 1.53 2021-08-29 16:11:46 +02:00
benchmarks Add Dockerfile for benchmarks 2021-07-30 15:31:17 +02:00
docs Docs: Add funtoo package to list (#208) 2021-10-03 16:10:30 +02:00
src When clearing cache, only delete pages, not entire cache dir 2021-10-16 20:09:32 +02:00
tests Switch to recommended tldr-pages archive URL 2021-10-16 20:09:32 +02:00
.editorconfig Add .editorconfig 2016-01-27 17:48:43 +01:00
.gitattributes Add Windows support 2019-02-05 09:32:13 -08:00
.gitignore release-build.sh: Strip binaries 2018-02-27 23:27:19 +01:00
bash_tealdeer Implement new --show-dirs command 2021-01-30 21:32:39 +01:00
Cargo.lock Remove some optional zip features 2021-10-16 20:40:40 +02:00
Cargo.toml Remove some optional zip features 2021-10-16 20:40:40 +02:00
CHANGELOG.md Release v1.4.1 (#140) 2020-09-04 12:25:37 +02:00
clippy.toml Bump CI toolchain to 1.53 2021-08-29 16:11:46 +02:00
deer.png Rename project (#26) 2016-04-16 10:20:16 +02:00
deer.svg Rename project (#26) 2016-04-16 10:20:16 +02:00
fish_tealdeer Implement new --show-dirs command 2021-01-30 21:32:39 +01:00
LICENSE-APACHE License under MIT/Apache-2.0 2016-01-27 17:48:43 +01:00
LICENSE-MIT Update copyright year 2021-10-16 13:06:28 +02:00
README.md Update README.md to include updated benchmark results 2021-07-30 15:31:46 +02:00
release-build.sh release-build script: Include "linux" in binary name 2020-02-28 01:44:45 +01:00
RELEASING.md Release v1.3.0 2020-02-28 01:14:39 +01:00
zsh_tealdeer zsh-completion: fix issue with [.md, add basic -L completion, remove extra _files args (#168) 2021-03-21 15:55:23 +01:00

tealdeer

teal deer

Crate CI (Linux/macOS/Windows)
Crates.io GitHub CI

A very fast implementation of tldr in Rust: Simplified, example based and community-driven man pages.

Screenshot of tldr command

If you pronounce "tldr" in English, it sounds somewhat like "tealdeer". Hence the project name :)

In case you're in a hurry and just want to quickly try tealdeer, you can find static binaries on the GitHub releases page!

Docs (Installing, Usage, Configuration)

User documentation is available at https://dbrgn.github.io/tealdeer/!

The docs are generated using mdbook. They can be edited through the markdown files in the docs/src/ directory.

Goals

High level project goals:

  • Download and cache pages
  • Don't require a network connection for anything besides updating the cache
  • Command line interface similar or equivalent to the NodeJS client
  • Comply with the tldr client specification
  • Advanced highlighting and configuration
  • Be fast

A tool like tldr should be as frictionless as possible to use and show the output as fast as possible.

We think that tealdeer reaches these goals. We put together a (more or less) reproducible benchmark that compiles a handful of clients from source and measures the execution times on a cold disk cache. The benchmarking is run in a Docker container using sharkdp's hyperfine (Dockerfile).

Client (50 runs, 29.07.2021) Programming Language Mean in ms Deviation in ms Comments
tealdeer Rust 16.2 1.2
tldr-c C 35.7 3.2
tldr-hs Haskell 23.6 1.0 no example highlighting
fast-tldr Haskell 15.2 0.7 no example highlighting
tldr-bash Bash 28.3 1.1
tldr-python-client Python 97.9 3.5
outfieldr Zig 4.7 0.5 no user configuration
tldr-node-client Javascript / Node 533.1 12.5

As you can see, tealdeer is not the fastest of the tested clients anymore. We strive for useful features and code quality over raw performance, even if that means that we don't come out on top in this friendly competition. That said, we are still optimizing the code, for example when the outfieldr developers suggested to switch to a native TLS implementation instead of the native libraries.

Development

Creating a debug build with logging enabled:

$ cargo build --features logging

Release build without logging:

$ cargo build --release

To enable the log output, set the RUST_LOG env variable:

$ export RUST_LOG=tldr=debug

To run tests:

$ cargo test

To run lints:

$ rustup component add clippy
$ cargo clean && cargo clippy

MSRV (Minimally Supported Rust Version)

When publishing a Tealdeer release, the Rust version required to build it should be stable for at least a month.

License

Licensed under either of

Contribution

Unless you explicitly state otherwise, any contribution intentionally submitted for inclusion in the work by you, as defined in the Apache-2.0 license, shall be dual licensed as above, without any additional terms or conditions.

Thanks to @severen for coming up with the name "tealdeer"!