Home

Awesome

tldr-bash-client

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

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

<img alt="tldr page gif" src="tldr-page.gif" title="tldr page" />

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

Installation

Download the tldr bash script to the install location:

L=/usr/local/bin/tldr  # elevated privileges needed for some locations
sudo wget -qO $L good4.eu/tldr
sudo chmod +x $L

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

<img alt="tldr page screenshot" src="tldr-page.jpg" title="tldr page" width="600" /> <img alt="tldr usage screenshot" src="tldr-usage.jpg" title="tldr usage" width="600" />

Prerequisites

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

<img alt="tldr search screenshot" src="tldr-search.jpg" title="tldr search" width="600" />

Output customisation

<img alt="tldr customize screenshot" src="tldr-customize.jpg" title="tldr customize" width="600" />

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):

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):

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:

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

How many days before freshly downloading a potentially stale page:

<img alt="tldr list screenshot" src="tldr-list.jpg" title="tldr list" width="600" />

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/pages # Or whatever else the location of the tldr cache is
complete -W "$(q=($cachedir/*/*); sed 's@\.md @ @g' <<<${q[@]##*/})" tldr
<img alt="tldr new markdown screenshot" src="tldr-markdown-new.jpg" title="tldr new markdown" width="600" />

tldr-lint

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
<img alt="tldr markdown screenshot" src="tldr-markdown.jpg" title="tldr markdown" width="600" />

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 gitlab page

License

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

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