Skip to content

Commit e273503

Browse files
authored
cleanup: update README
1 parent f029e67 commit e273503

File tree

1 file changed

+47
-34
lines changed

1 file changed

+47
-34
lines changed

README.md

+47-34
Original file line numberDiff line numberDiff line change
@@ -9,7 +9,12 @@ Python command-line client for [tldr pages](https://github.com/tldr-pages/tldr).
99

1010
## Installation
1111

12-
[![Packaging status](https://repology.org/badge/vertical-allrepos/tldr-python-client.svg)](https://repology.org/project/python-tldr-client/versions)
12+
<details open>
13+
<summary>Check Repology Packaging Status!</summary>
14+
<a href="https://repology.org/project/tldr-python-client/versions">
15+
<img src="https://repology.org/badge/vertical-allrepos/tldr-python-client.svg" alt="Packaging status">
16+
</a>
17+
</details>
1318

1419
### from PyPI
1520

@@ -38,27 +43,31 @@ sudo snap install tldr
3843
## Usage
3944

4045
```
41-
usage: tldr [-u] [-p PLATFORM] [-s SOURCE] [-c] [-r] [-L LANGUAGE] command
46+
usage: tldr command [options]
4247
4348
Python command line client for tldr
4449
4550
positional arguments:
4651
command command to lookup
4752
48-
optional arguments:
53+
options:
4954
-h, --help show this help message and exit
5055
-v, --version show program's version number and exit
51-
-u, --update_cache Update the local cache of pages and exit
56+
--search "KEYWORDS" Search for a specific command from a query
57+
-u, --update, --update_cache
58+
Update the local cache of pages and exit
5259
-p PLATFORM, --platform PLATFORM
53-
Override the operating system [linux, osx, sunos,
54-
windows, common]
60+
Override the operating system [linux, osx, sunos, windows, common]
61+
-l, --list List all available commands for operating system
5562
-s SOURCE, --source SOURCE
5663
Override the default page source
5764
-c, --color Override color stripping
5865
-r, --render Render local markdown files
59-
-l, --list List all available commands for operating system
6066
-L LANGUAGE, --language LANGUAGE
6167
Override the default language
68+
-m, --markdown Just print the plain page file.
69+
--print-completion {bash,zsh,tcsh}
70+
print shell completion script
6271
```
6372

6473
## Configuration
@@ -82,17 +91,17 @@ export TLDR_DOWNLOAD_CACHE_LOCATION="https://tldr-pages.github.io/assets/tldr.zi
8291

8392
Cache is downloaded from `TLDR_DOWNLOAD_CACHE_LOCATION` (defaults to the one described in [the client specification](https://github.com/tldr-pages/tldr/blob/main/CLIENT-SPECIFICATION.md#caching)), unzipped and extracted into the [local cache directory](#cache-location). Pages are loaded directly from `TLDR_PAGES_SOURCE_LOCATION` if `tldr <command>` is used.
8493

85-
* `TLDR_CACHE_ENABLED` (default is `1`):
86-
* If set to `1`, the client will first try to load from cache, and fall back to fetching from the internet if the cache doesn't exist or is too old.
87-
* If set to `0`, the client will fetch from the internet, and fall back to the cache if the page cannot be fetched from the internet.
88-
* `TLDR_CACHE_MAX_AGE` (default is `168` hours, which is equivalent to a week): maximum age of the cache in hours to be considered as valid when `TLDR_CACHE_ENABLED` is set to `1`.
94+
- `TLDR_CACHE_ENABLED` (default is `1`):
95+
- If set to `1`, the client will first try to load from cache, and fall back to fetching from the internet if the cache doesn't exist or is too old.
96+
- If set to `0`, the client will fetch from the internet, and fall back to the cache if the page cannot be fetched from the internet.
97+
- `TLDR_CACHE_MAX_AGE` (default is `168` hours, which is equivalent to a week): maximum age of the cache in hours to be considered as valid when `TLDR_CACHE_ENABLED` is set to `1`.
8998

9099
#### Cache location
91100

92101
In order of precedence:
93-
* `$XDG_CACHE_HOME/tldr`
94-
* `$HOME/.cache/tldr`
95-
* `~/.cache/tldr`
102+
- `$XDG_CACHE_HOME/tldr`
103+
- `$HOME/.cache/tldr`
104+
- `~/.cache/tldr`
96105

97106
If you are experiencing issues with *tldr*, consider deleting the cache files before trying other measures.
98107

@@ -121,37 +130,41 @@ an autocomplete for `tldr` for `fish`.
121130

122131
For networks that sit behind a proxy, it may be necessary to disable SSL verification for the client to function. Setting the following:
123132

124-
* `TLDR_ALLOW_INSECURE=1`
133+
- `TLDR_ALLOW_INSECURE=1`
125134

126135
will disable SSL certificate inspection. This __should be avoided__ unless absolutely necessary.
127136

128137
### Colors
129138

130139
Values of the `TLDR_COLOR_x` variables may consist of three parts:
131-
* Font color: `blue, green, yellow, cyan, magenta, white, grey, red`
132-
* Background color: `on_blue, on_cyan, on_magenta, on_white, on_grey, on_yellow, on_red, on_green`
133-
* Additional effects, which depends on platform: `reverse, blink, dark, concealed, underline, bold`
140+
141+
- Font color: `blue, green, yellow, cyan, magenta, white, grey, red`
142+
- Background color: `on_blue, on_cyan, on_magenta, on_white, on_grey, on_yellow, on_red, on_green`
143+
- Additional effects, which depend on the platform: `reverse, blink, dark, concealed, underline, bold`
134144

135145
You may specify as many additional effects as you want, while only one of font and background color.
136146

137-
Any of the values of above may be omitted. For example, you can do similar things as the following:
138-
* `TLDR_COLOR_NAME=""` use default system font color with default background color without any effects
139-
* `TLDR_COLOR_DESCRIPTION="white"` for white text on default system background color without any effects
140-
* `TLDR_COLOR_NAME="cyan dark"` for dark cyan text on default system background color
141-
* `TLDR_COLOR_NAME="on_red"` for default system font color on red background color
142-
* `TLDR_COLOR_PARAMETER="red on_yellow underline"` for underlined red text on yellow background
143-
* `TLDR_COLOR_NAME="bold underline"` for default system font and background colors with underline and bolded effects
147+
Any of the values above may be omitted. For example, you can do similar things as the following:
148+
149+
- `TLDR_COLOR_NAME=""` use default system font color with default background color without any effects
150+
- `TLDR_COLOR_DESCRIPTION="white"` for white text on default system background color without any effects
151+
- `TLDR_COLOR_NAME="cyan dark"` for dark cyan text on default system background color
152+
- `TLDR_COLOR_NAME="on_red"` for default system font color on the red background color
153+
- `TLDR_COLOR_PARAMETER="red on_yellow underline"` for underlined red text on yellow background
154+
- `TLDR_COLOR_NAME="bold underline"` for default system font and background colors with underline and bolded effects
144155

145156
### Language
146157

147-
The language that tldr will use is dependent on a number of factors. If you specify a language via the
158+
The language that tldr will use is dependent on several factors. If you specify a language via the
148159
`--language` flag, tldr will attempt to use that language and only that language. Otherwise, it will
149160
try to use the language specified by `TLDR_LANGUAGE`. If it is not set, or the page does not exist in that language,
150161
then tldr will use the
151162
language set using `LANGUAGE` and `LANG` (ignoring the values `C` and `POSIX`).
152-
If neither are set, then tldr will always attempt to get the `en` page. Finally, if `LANG` is set, it uses `LANGUAGE`, if set,
153-
first as the priority list to try languages in, followed by `LANG` if not included in `LANGUAGE`
154-
and `en` as fallback (assuming it does not already appear somewhere in `LANGUAGE` or `LANG`).
163+
164+
If neither is set, then tldr will always attempt to get the `en` page. Finally, if `LANG` is set, it uses `LANGUAGE`, if set,
165+
first, as the priority list to try languages in, followed by `LANG` if not included in `LANGUAGE`
166+
and `en` as a fallback (assuming it does not already appear somewhere in `LANGUAGE` or `LANG`).
167+
155168
All language values should be set to a value that follows [RFC 1766](https://tools.ietf.org/html/rfc1766.html),
156169
with the special exceptions of `C` and `POSIX` which are ignored.
157170

@@ -160,8 +173,8 @@ with the special exceptions of `C` and `POSIX` which are ignored.
160173
If you wish to use your own instance of the tldr pages instead of the default repository, you
161174
can either use the `--source` flag when using tldr or by specifying the following environment variables:
162175

163-
* `TLDR_PAGES_SOURCE_LOCATION` to control where to get individual pages from
164-
* defaults to `https://raw.githubusercontent.com/tldr-pages/tldr/main/pages`
165-
* it can also point to local directory using `file:///path/to/directory`
166-
* `TLDR_DOWNLOAD_CACHE_LOCATION` to control where to pull a zip of all pages from
167-
* defaults to `https://tldr-pages.github.io/assets/tldr.zip`
176+
- `TLDR_PAGES_SOURCE_LOCATION` to control where to get individual pages from.
177+
- defaults to `https://raw.githubusercontent.com/tldr-pages/tldr/main/pages`.
178+
- it can also point to a local directory using `file:///path/to/directory`.
179+
- `TLDR_DOWNLOAD_CACHE_LOCATION` to control where to pull a zip of all pages from.
180+
- defaults to `https://github.com/tldr-pages/tldr/releases/latest/download/tldr.zip`.

0 commit comments

Comments
 (0)