Giter Site home page Giter Site logo

anandsudhir / tldr-bash-client Goto Github PK

View Code? Open in Web Editor NEW

This project forked from pepa65/tldr-bash-client

0.0 1.0 0.0 4.21 MB

Bash client for tldr: community driven man-by-example http://tldr-pages.github.io

License: GNU General Public License v3.0

Shell 100.00%

tldr-bash-client's Introduction

tldr-bash-client

  • version 0.39

Bash client for tldr: community driven man-by-example

A fully-functional bash client for the tldr project, providing poignant examples of terminal commands.

tldr page gif

This client can render both the old and the new tldr markup format.

Installation

Download the tldr bash script to the install location:

loc=/usr/local/bin/tldr  # elevated privileges needed for some locations
sudo wget -qO $loc https://4e4.win/tldr
sudo chmod +x $loc

If the location is not in $PATH, you need to specify the path to run it.

tldr page screenshot

tldr usage screenshot

Prerequisites

coreutils, grep, unzip, curl / wget, less (optional)

tldr find screenshot

Output customisation

tldr customize screenshot

The 5 elements in TLDR markup that can be styled with these colors and backgrounds (last one specified will be used) and modes (more can apply):

  • Colors: Black, Red, Green, Yellow, Blue, Magenta, Cyan, White
  • BG: BlackBG, RedBG, GreenBG, YellowBG, BlueBG, MagentaBG, CyanBG, WhiteBG
  • Modes: Bold, Underline, Italic, Inverse

Newline can be added to the style list to add a newline before the element and Space to add a space at the start of the line (style items are separated by space, lower/uppercase mixed allowed)

  • TLDR_TITLE_STYLE (defaults to: Newline Space Bold Yellow)
  • TLDR_DESCRIPTION_STYLE (defaults to: Space Yellow)
  • TLDR_EXAMPLE_STYLE (defaults to: Newline Space Bold Green)
  • TLDR_CODE_STYLE (defaults to: Space Bold Blue)
  • TLDR_VALUE_ISTYLE (defaults to: Space Bold Cyan)

The Value style (above) is an Inline style: doesn't take Newline or Space

Inline styles for help text: default, URL, option, platform, command, header

  • TLDR_DEFAULT_ISTYLE (defaults to: White)
  • TLDR_URL_ISTYLE (defaults to: Yellow)
  • TLDR_HEADER_ISTYLE (defaults to: Bold)
  • TLDR_OPTION_ISTYLE (defaults to: Bold Yellow)
  • TLDR_PLATFORM_ISTYLE (defaults to: Bold Blue)
  • TLDR_COMMAND_ISTYLE (defaults to: Bold Cyan)
  • TLDR_FILE_ISTYLE (defaults to: Bold Magenta)

Color/BG (Newline and Space also allowed) for error and info messages

  • TLDR_ERROR_COLOR (defaults to: Newline Space Red)
  • TLDR_INFO_COLOR (defaults to: Newline Space Green)

How many days before freshly downloading a potentially stale page

  • TLDR_EXPIRY (defaults to: 60)

Alternative location of pages cache

  • TLDR_CACHE (not set by default)

Instead of less, use cat for output (automatic if less not available)

  • TLDR_LESS (not set by default; if set to 0 cat will be used)

tldr list screenshot

Autocompletion

When the following lines are added to ~/.bashrc or run in the current session, then tldr will autocomplete, which means possible tldr page names will be suggested when tapping the Tab key twice on an incomplete tldr page name:

cachedir=~/.local/share/tldr # Or whatever else the location of the tldr cache is
complete -W "$(q=($cachedir/*/*); sed 's@\.md @ @g' <<<${q[@]##*/})" tldr

tldr new markdown screenshot

tldr-lint

  • version 0.11

Linter for new syntax tldr source files

Usage: tldr-lint [-h|--help] [-V|--version] [-q|--quiet] [<dir>] [<file>]
          - All *.md files under <dir> and subdirectories are checked
          - <file> is checked regardless of extension
          -q, --quiet:    No output means check is OK
          -V, --version:  Display version
          -h, --help:     Display this help text

tldr markdown screenshot

Prerequisites

coreutils, sed, grep, find

Contributing

Please file an issue for a question, a bug or a feature request. Or even better, send a pull request!

tldr-bash-client github page

License

Original tldr client in bash by Ray Lee http://github.com/raylee/tldr (MIT license)

The tldr-bash-client is relicensed under GPLv3+ and tldr-lint is GPLv3+ as well.

tldr-bash-client's People

Contributors

85pando avatar anandsudhir avatar flipb avatar igorshubovych avatar pbordron avatar pepa65 avatar raylee avatar susensio avatar

Watchers

 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.