You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Copy file name to clipboardExpand all lines: .github/workflows/publish.yml
+15-9Lines changed: 15 additions & 9 deletions
Original file line number
Diff line number
Diff line change
@@ -1,5 +1,6 @@
1
-
# This workflow will upload a Python Package using Twine when a release is created
1
+
# This workflow will upload a Python Package using Trusted Publishers automatically when a release is created
2
2
# For more information see: https://help.github.com/en/actions/language-and-framework-guides/using-python-with-github-actions#publishing-to-package-registries
3
+
# and https://docs.pypi.org/trusted-publishers/using-a-publisher/.
3
4
4
5
name: Upload Python Package
5
6
@@ -8,14 +9,22 @@ on:
8
9
types: [created]
9
10
10
11
jobs:
11
-
deploy:
12
-
12
+
pypi-publish:
13
13
runs-on: ubuntu-latest
14
+
15
+
environment:
16
+
name: pypi
17
+
url: https://pypi.org/project/tldr/
18
+
19
+
permissions:
20
+
contents: read
21
+
id-token: write # Required for accessing OpenID Connect (OIDC) token for PyPI trusted publisher
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.
84
95
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`.
96
+
-`TLDR_CACHE_ENABLED` (default is `1`):
97
+
- 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.
98
+
- 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.
99
+
-`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`.
89
100
90
101
#### Cache location
91
102
92
103
In order of precedence:
93
-
*`$XDG_CACHE_HOME/tldr`
94
-
*`$HOME/.cache/tldr`
95
-
*`~/.cache/tldr`
104
+
105
+
-`$XDG_CACHE_HOME/tldr`
106
+
-`$HOME/.cache/tldr`
107
+
-`~/.cache/tldr`
96
108
97
109
If you are experiencing issues with *tldr*, consider deleting the cache files before trying other measures.
98
110
@@ -121,7 +133,7 @@ an autocomplete for `tldr` for `fish`.
121
133
122
134
For networks that sit behind a proxy, it may be necessary to disable SSL verification for the client to function. Setting the following:
123
135
124
-
*`TLDR_ALLOW_INSECURE=1`
136
+
-`TLDR_ALLOW_INSECURE=1`
125
137
126
138
will disable SSL certificate inspection. This __should be avoided__ unless absolutely necessary.
127
139
@@ -132,30 +144,34 @@ It is possible to use a different certificate store/bundle by setting:
132
144
### Colors
133
145
134
146
Values of the `TLDR_COLOR_x` variables may consist of three parts:
- Additional effects, which depend on the platform: `reverse, blink, dark, concealed, underline, bold`
138
151
139
152
You may specify as many additional effects as you want, while only one of font and background color.
140
153
141
-
Any of the values of above may be omitted. For example, you can do similar things as the following:
142
-
*`TLDR_COLOR_NAME=""` use default system font color with default background color without any effects
143
-
*`TLDR_COLOR_DESCRIPTION="white"` for white text on default system background color without any effects
144
-
*`TLDR_COLOR_NAME="cyan dark"` for dark cyan text on default system background color
145
-
*`TLDR_COLOR_NAME="on_red"` for default system font color on red background color
146
-
*`TLDR_COLOR_PARAMETER="red on_yellow underline"` for underlined red text on yellow background
147
-
*`TLDR_COLOR_NAME="bold underline"` for default system font and background colors with underline and bolded effects
154
+
Any of the values above may be omitted. For example, you can do similar things as the following:
155
+
156
+
-`TLDR_COLOR_NAME=""` use default system font color with default background color without any effects
157
+
-`TLDR_COLOR_DESCRIPTION="white"` for white text on default system background color without any effects
158
+
-`TLDR_COLOR_NAME="cyan dark"` for dark cyan text on default system background color
159
+
-`TLDR_COLOR_NAME="on_red"` for default system font color on the red background color
160
+
-`TLDR_COLOR_PARAMETER="red on_yellow underline"` for underlined red text on yellow background
161
+
-`TLDR_COLOR_NAME="bold underline"` for default system font and background colors with underline and bolded effects
148
162
149
163
### Language
150
164
151
-
The language that tldr will use is dependent on a number of factors. If you specify a language via the
165
+
The language that tldr will use is dependent on several factors. If you specify a language via the
152
166
`--language` flag, tldr will attempt to use that language and only that language. Otherwise, it will
153
167
try to use the language specified by `TLDR_LANGUAGE`. If it is not set, or the page does not exist in that language,
154
168
then tldr will use the
155
169
language set using `LANGUAGE` and `LANG` (ignoring the values `C` and `POSIX`).
156
-
If neither are set, then tldr will always attempt to get the `en` page. Finally, if `LANG` is set, it uses `LANGUAGE`, if set,
157
-
first as the priority list to try languages in, followed by `LANG` if not included in `LANGUAGE`
158
-
and `en` as fallback (assuming it does not already appear somewhere in `LANGUAGE` or `LANG`).
170
+
171
+
If neither is set, then tldr will always attempt to get the `en` page. Finally, if `LANG` is set, it uses `LANGUAGE`, if set,
172
+
first, as the priority list to try languages in, followed by `LANG` if not included in `LANGUAGE`
173
+
and `en` as a fallback (assuming it does not already appear somewhere in `LANGUAGE` or `LANG`).
174
+
159
175
All language values should be set to a value that follows [RFC 1766](https://tools.ietf.org/html/rfc1766.html),
160
176
with the special exceptions of `C` and `POSIX` which are ignored.
161
177
@@ -164,8 +180,12 @@ with the special exceptions of `C` and `POSIX` which are ignored.
164
180
If you wish to use your own instance of the tldr pages instead of the default repository, you
165
181
can either use the `--source` flag when using tldr or by specifying the following environment variables:
166
182
167
-
*`TLDR_PAGES_SOURCE_LOCATION` to control where to get individual pages from
168
-
* defaults to `https://raw.githubusercontent.com/tldr-pages/tldr/main/pages`
169
-
* it can also point to local directory using `file:///path/to/directory`
170
-
*`TLDR_DOWNLOAD_CACHE_LOCATION` to control where to pull a zip of all pages from
171
-
* defaults to `https://tldr-pages.github.io/assets/tldr.zip`
183
+
-`TLDR_PAGES_SOURCE_LOCATION` to control where to get individual pages from.
184
+
- defaults to `https://raw.githubusercontent.com/tldr-pages/tldr/main/pages`.
185
+
- it can also point to a local directory using `file:///path/to/directory`.
186
+
-`TLDR_DOWNLOAD_CACHE_LOCATION` to control where to pull a zip of all pages from.
187
+
- defaults to `https://github.com/tldr-pages/tldr/releases/latest/download/tldr.zip`.
188
+
189
+
### Command options
190
+
191
+
Pages might contain `{{[*|*]}}` patterns to let the client decide whether to show shortform or longform versions of options. This can be configured with `TLDR_OPTIONS`, which accepts values `short`, `long` and `both`
0 commit comments