@@ -9,11 +9,12 @@ tags: [color, github, docs, client, markdown, bash]
9
9
10
10
* Source code repo: https://github.com/pepa65/tldr-bash-client
11
11
* Author: pepa65
< [email protected] >
12
+ * Version: 0.3
12
13
13
14
# tldr-bash-client
14
15
15
16
** A fully-functional [ bash] ( https://tiswww.case.edu/php/chet/bash/bashtop.html )
16
- client for the [ tldr] ( https://github.com/rprieto/ tldr/ ) project, providing
17
+ client for the [ tldr] ( https://github.com/tldr-pages/tldr ) project, providing
17
18
poignant examples of terminal commands.**
18
19
19
20
## Installation
@@ -27,55 +28,79 @@ sudo chmod +x $location
27
28
```
28
29
29
30
If the location is not in $PATH, you need to specify the path to run it.
31
+ Alternately, you can do ` sudo bpkg-install pepa65/tldr ` if you have
32
+ [ bpkg] ( https://github.com/bpkg/bpkg ) installed.
30
33
31
34
### Prerequisites
32
35
coreutils, less, grep, unzip, curl / wget
33
36
34
37
## Usage
35
38
36
39
```
37
- USAGE: tldr [option] [platform/]< command>
40
+ USAGE: tldr [option] [platform/]command
38
41
39
- platform/command: Show page for command (from platform)
42
+ [ platform/] command: Show page for command (from platform)
40
43
41
44
platform is optionally one of: common, linux, osx, sunos
42
45
43
46
option is optionally one of:
44
47
-l, --list [platform]: Show all available pages (from platform)
45
- -r, --render < file>: Render a local file as tldr markdown
46
- -m, --markdown < command>: Show the markdown source for command
48
+ -r, --render file: Render a local file as tldr markdown
49
+ -m, --markdown command: Show the markdown source for command
47
50
-c, --cache: Cache all pages by downloading archive from repo
48
51
-u, --update: Re-download index file from repo
49
-
50
52
-v, --version: Version number and repo location
51
53
[-h, -?, --help]: This help overview
52
54
53
- All pages and the index are cached locally under ~/.config /tldr
54
- By default, the cached copies will be re- downloaded after 60 days
55
+ All pages and the index are cached locally under $HOME/.local/share /tldr
56
+ By default, the cached copies will be freshly downloaded after 60 days.
55
57
```
56
58
57
59
## Customisation
58
60
59
- The colors and other styling of the 5 elements of tldr pages can be modified
60
- either by editing the first few lines of the scipt, or by setting the following
61
- environment variables:
61
+ The 5 elements in TLDR markup that can be styled with these colors and
62
+ backgrounds (last one specified will be used) and modes (more can apply):
63
+ * Colors: Black, Red, Green, Yellow, Blue, Magenta, Cyan, White
64
+ * BG: BlackBG, RedBG, GreenBG, YellowBG, BlueBG, MagentaBG, CyanBG, WhiteBG
65
+ * Modes: Bold, Underline, Italic, Inverse
62
66
67
+ ` Newline ` can be added to the style list to add a newline before the element
68
+ and ` Space ` to add a space at the start of the line
69
+ (style items are separated by space, lower/uppercase mixed allowed)
63
70
* TLDR_TITLE_STYLE (defaults to: Newline Space Bold Yellow)
64
71
* TLDR_DESCRIPTION_STYLE (defaults to: Space Yellow)
65
- * TLDR_EXAMPLE_STYLE (defaults to: Newline Bold Green)
72
+ * TLDR_EXAMPLE_STYLE (defaults to: Newline Space Bold Green)
66
73
* TLDR_CODE_STYLE (defaults to: Space Bold Blue)
67
- * TLDR_VALUE_STYLE (defaults to: Bold Cyan)
74
+ * TLDR_VALUE_ISTYLE (defaults to: Space Bold Cyan)
75
+
76
+ The Value style (above) is an Inline style: doesn't take Newline or Space
77
+
78
+ Inline styles for help text: default, URL, option, platform, command, header
79
+ * TLDR_DEFAULT_ISTYLE (defaults to: White)
80
+ * TLDR_URL_ISTYLE (defaults to: Yellow)
81
+ * TLDR_HEADER_ISTYLE (defaults to: Bold)
82
+ * TLDR_OPTION_ISTYLE (defaults to: Bold Yellow)
83
+ * TLDR_PLATFORM_ISTYLE (defaults to: Bold Blue)
84
+ * TLDR_COMMAND_ISTYLE (defaults to: Bold Cyan)
85
+ * TLDR_FILE_ISTYLE (defaults to: Bold Magenta)
68
86
69
- Also the error color and page expiry can easily be set:
87
+ Color/BG (Newline and Space also allowed) for error and info messages
88
+ * TLDR_ERROR_COLOR (defaults to: Newline Space Red)
89
+ * TLDR_INFO_COLOR (defaults to: Newline Space Green)
70
90
71
- * TLDR_ERROR_COLOR (defaults to: Space Red)
91
+ How many days before freshly downloading a potentially stale page
72
92
* TLDR_EXPIRY (defaults to: 60)
73
93
94
+ Alternative location of pages cache
95
+ * TLDR_CACHE (not set by default)
96
+
74
97
## Contributing
75
98
76
99
Please file an issue for a question, a bug or a feature request.
77
100
Or even better, send a pull request!
78
101
79
102
### License
80
103
81
- Relicensed under GPL v3+
104
+ Original client by Ray Lee http://github.com/raylee/tldr (MIT license)
105
+
106
+ Relicensed under GPLv3+
0 commit comments