tldr-bash-client/README.md

85 lines
3.5 KiB
Markdown
Raw Normal View History

# tldr-bash-client
2016-01-04 06:33:47 +01:00
* version 0.3
* https://github.com/pepa65/tldr-bash-client
2017-02-22 17:06:21 +01:00
### Bash client for tldr: community driven man-by-example
**A fully-functional [bash](https://tiswww.case.edu/php/chet/bash/bashtop.html)
client for the [tldr](https://github.com/rprieto/tldr/) project, providing
poignant examples of terminal commands.**
2016-01-04 06:33:47 +01:00
2017-02-22 06:40:02 +01:00
<img alt="tldr list screenshot" src="tldr-list.jpg" title="tldr list" width="600" />
2016-01-04 06:33:47 +01:00
This client can render both the old and the new tldr markup format.
## Installation
Download the tldr bash script to the install location:
2016-01-04 07:00:35 +01:00
```bash
location=/usr/local/bin/tldr # elevated privileges needed for some locations
sudo wget -qO $location https://raw.githubusercontent.com/pepa65/tldr-bash-client/master/tldr
sudo chmod +x $location
```
2016-01-04 07:00:35 +01:00
If the location is not in $PATH, you need to specify the path to run it.
2017-02-22 16:56:07 +01:00
Alternately, you can do `sudo bpkg-install pepa65/tldr` if you have
[bpkg](https://github.com/bpkg/bpkg) installed.
2017-02-22 06:40:02 +01:00
<img alt="tldr page gif" src="tldr-page.gif" title="tldr page" />
2017-02-22 06:46:53 +01:00
[](<img alt="tldr page screenshot" src="tldr-page.jpg" title="tldr page" width="600" />)
2017-02-06 04:28:38 +01:00
### Prerequisites
coreutils, less, grep, unzip, curl / wget
2016-01-04 06:33:47 +01:00
<img alt="tldr usage screenshot" src="tldr-usage.jpg" title="tldr usage" width="600" />
2016-01-04 06:33:47 +01:00
## Customisation
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)
2016-01-04 06:33:47 +01:00
<img alt="tldr customize screenshot" src="tldr-customize.jpg" title="tldr customize" width="600" />
2016-01-04 06:33:47 +01:00
## Contributing
2016-01-04 06:33:47 +01:00
Please file an issue for a question, a bug or a feature request.
Or even better, send a pull request!
2016-01-04 06:33:47 +01:00
2017-02-22 11:59:51 +01:00
[tldr-bash-client github page](http://github.com/pepa65/tldr-bash-client "github.com/pepa65/tldr-bash-client")
<img alt="tldr markdown screenshot" src="tldr-markdown.jpg" title="tldr markdown" width="600" />
2016-01-04 06:33:47 +01:00
### License
Original client by Ray Lee http://github.com/raylee/tldr (MIT license)
Re-licensed under GPL v3+
<img alt="tldr new markdown screenshot" src="tldr-markdown-new.jpg" title="tldr new markdown" width="600" />