GithubHelp home page GithubHelp logo

ydx-2147483647 / tealdeer Goto Github PK

View Code? Open in Web Editor NEW

This project forked from dbrgn/tealdeer

0.0 0.0 0.0 2.5 MB

A very fast implementation of tldr in Rust.

Home Page: https://dbrgn.github.io/tealdeer/

License: Apache License 2.0

Shell 2.61% Rust 91.96% Dockerfile 5.43%

tealdeer's Introduction

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, 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 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"!

tealdeer's People

Contributors

0ndorio avatar anderejd avatar bagohart avatar bl-ue avatar black7375 avatar cosmichorrordev avatar cyqsimon avatar das-g avatar dbrgn avatar dmaahs2017 avatar equal-l2 avatar gagarine avatar ilai-deutel avatar invakid404 avatar jcgruenhage avatar jdvr avatar korrat avatar michaeldel avatar natpen avatar newsch avatar niklasmohrin avatar olavhaasie avatar rithvikvibhu avatar severen avatar simplydanny avatar sondr3 avatar tomasfarias avatar tranzystorekk avatar voultapher avatar wesleyklop avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.