- Notifications
You must be signed in to change notification settings - Fork138
A very fast implementation of tldr in Rust.
License
Apache-2.0, MIT licenses found
Licenses found
tealdeer-rs/tealdeer
Folders and files
Name | Name | Last commit message | Last commit date | |
---|---|---|---|---|
Repository files navigation
Crate | CI (Linux/macOS/Windows) |
---|---|
A very fast implementation oftldr inRust: Simplified, example based and community-driven man pages.
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 staticbinaries on theGitHub releases page!
User documentation is available athttps://tealdeer-rs.github.io/tealdeer/!
The docs are generated usingmdbook.They can be edited through the markdown files in thedocs/src/
directory.
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 theNodeJS client
- Comply with thetldr client specification
- Advanced highlighting and configuration
- Be fast
A tool liketldr
should be as frictionless as possible to use and show theoutput as fast as possible.
We think thattealdeer
reaches these goals. We put together a (more or less)reproducible benchmark that compiles a handful of clients from source andmeasures the execution times on a cold disk cache. The benchmarking is run in aDocker container using sharkdp'shyperfine
(Dockerfile).
Client (50 runs, 17.10.2021) | Programming Language | Mean in ms | Deviation in ms | Comments |
---|---|---|---|---|
outfieldr | Zig | 9.1 | 0.5 | no user configuration |
tealdeer | Rust | 13.2 | 0.5 | |
fast-tldr | Haskell | 17.0 | 0.6 | no example highlighting |
tldr-hs | Haskell | 25.1 | 0.5 | no example highlighting |
tldr-bash | Bash | 30.0 | 0.8 | |
tldr-c | C | 38.4 | 1.0 | |
tldr-python-client | Python | 87.0 | 2.4 | |
tldr-node-client | JavaScript / NodeJS | 407.1 | 12.9 |
As you can see,tealdeer
is one of the fastest of the tested clients.However, 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 theoutfieldr
developerssuggested to switch to a native TLSimplementation instead of the native libraries.
Creating a debug build with logging enabled:
$ cargo build --features logging
Release build without logging:
$ cargo build --release
To enable the log output, set theRUST_LOG
env variable:
$ export RUST_LOG=tldr=debug
To run tests:
$ cargo test
To run lints:
$ rustup component add clippy$ cargo clean && cargo clippy
When publishing a tealdeer release, the Rust version required to build itshould be stable for at least a month.
Licensed under either of
- Apache License, Version 2.0 (LICENSE-APACHE orhttp://www.apache.org/licenses/LICENSE-2.0)
- MIT license (LICENSE-MIT orhttp://opensource.org/licenses/MIT) at your option.
Unless you explicitly state otherwise, any contribution intentionally submittedfor inclusion in the work by you, as defined in the Apache-2.0 license, shallbe dual licensed as above, without any additional terms or conditions.
Thanks to @severen for coming up with the name "tealdeer"!
About
A very fast implementation of tldr in Rust.
Topics
Resources
License
Apache-2.0, MIT licenses found
Licenses found
Uh oh!
There was an error while loading.Please reload this page.
Stars
Watchers
Forks
Packages0
Uh oh!
There was an error while loading.Please reload this page.