Commit graph

218 commits

Author SHA1 Message Date
Niklas Mohrin
942c67c3d2
Update ARCHIVE_URL
When this code was written, the client specification instructed clients
that they MUST download pages from the tldr.sh domain. However, this
domain was deprecated and shut down in December 2025.
2026-01-24 01:05:42 +01:00
Blair Noctis
fb7492b0b5
Upgrade yansi: 0.5.1 -> 1.0.1 (#389)
- Adapt to `thing.paint(style)` API; was `style.paint(thing)`
- Remove `yansi::Paint::enable_windows_ascii()` in style usage decision;
  removed in yansi commit b186eb5bfb, which introduced "automatic"
  support for Windows: "If support is not available, styling is disabled
  and no styling sequences are emitted", fitting the `Auto` option
- Respect `--color=always` even if we know it won't work

---------

Co-authored-by: Niklas Mohrin <dev@niklasmohrin.de>
2024-11-14 16:07:30 +01:00
Niklas Mohrin
ec2daa495c
Replace atty with std::io::IsTerminal (#380) 2024-10-02 20:32:17 +00:00
Danilo Bargen
fc6d644152
Update all URLs to point to new GitHub organization (#379)
See https://github.com/tealdeer-rs/tealdeer/issues/376 for details.
2024-09-30 11:27:19 +02:00
Danilo Bargen
7c245040b9
Command line help: Add hint about platform overrides (#375)
- Rename PLATFORMS to PLATFORM
- Add hint about specifying platform multiple times
2024-08-13 00:14:19 +02:00
Danilo Bargen
f3d74850a8
Make clippy happy (#373) 2024-08-06 21:46:40 +00:00
Danilo Bargen
64f3fbbbc6 Apply clippy suggestions 2024-06-17 00:35:04 +02:00
Danilo Bargen
de1684edb6 Update to clap v4 2024-06-17 00:35:04 +02:00
K.B.Dharun Krishna
ee6d2418f1
Add BSD platform support and update workflows (#354) 2024-04-10 16:05:51 +02:00
Zacchary Dempsey-Plante
17c08f0261
Change custom page files to use a .md extension (#322)
* Change custom page files to use a `.md` extension.
* Add a breaking change warning to the documentation for the usage of custom pages.
* Add a temporary check for old custom pages to assist in the migration to the new naming convention.

Co-authored-by: Danilo Bargen <mail@dbrgn.ch>
2024-02-15 19:27:56 +00:00
JJ Style
9e1489bbc5
Allow querying multiple platforms (#300) 2023-08-27 21:52:20 +00:00
qknogxxb
8c6754ae78
Line iterator: Improve test functions (#316) 2023-07-05 23:33:39 +02:00
Danilo Bargen
94d56c01a7
Allow building with native-tls (#303)
Right now we only support building with Rustls. However, there are quite
a few architectures that aren't yet supported by "ring" (the crypto
library used by Rustls), for example MIPS, PowerPC or SPARC.

To offer an alternative, I added the "native-tls" feature that can be
used instead of "native-roots". When used, the native TLS stack is used
instead of Rustls (i.e. SChannel on Windows, Secure Transport on macOS
and OpenSSL otherwise).
2023-02-14 18:21:07 +01:00
qknogxxb
72362769de
Line iterator: Drop empty line without allocating (#314)
Co-authored-by: Niklas Mohrin <dev@niklasmohrin.de>
2023-02-12 17:45:53 +00:00
tveness
76d9d0bbda
Obey 1.67 clippy lints (#313) 2023-02-07 21:56:41 +01:00
Danilo Bargen
ab5148f237
Fix path source for custom pages dir (#297) 2022-10-22 22:00:29 +02:00
Danilo Bargen
2ebf86b265 Remove deprecated -m/--markdown command 2022-10-01 23:54:37 +02:00
Danilo Bargen
efe1b57696 Remove deprecated -o/--os command 2022-10-01 23:53:32 +02:00
Danilo Bargen
0c93a4cfe9 Remove deprecated --config-path command 2022-10-01 23:52:03 +02:00
Danilo Bargen
c44faf2b09 Lazy creation of cache directory 2022-10-01 12:18:44 +02:00
Danilo Bargen
3f528ba5cb Impl From<RawX> for more config types
- StyleConfig
- DisplayConfig
- UpdatesConfig
2022-10-01 12:18:34 +02:00
Danilo Bargen
d702a1fab6 Cache: Add pages_dir helper method
Additionally, rename `cache_dir` to `pages_dir` where terminology was
wrong.
2022-10-01 12:18:34 +02:00
Danilo Bargen
3e7dfb3c71 Cache: Make URL a parameter, not a field 2022-10-01 12:18:33 +02:00
Danilo Bargen
fb89303e85 Move custom_pages_dir business logic from RawConfig to Config
This also introduces the path source information for that directory,
which was previously unknown.
2022-10-01 12:18:30 +02:00
Danilo Bargen
afbdfa6746 Bring back path source for cache directory 2022-10-01 12:13:40 +02:00
Danilo Bargen
33f0f108d8 Allow overriding cache directory through config
- Config: Add `cache_dir` to `[directories]` section
- Logic to handle legacy env var, config override and default cache dir
  selection is now in the `Config::try_from(RawConfig)` impl
- Deprecate old `TEALDEER_CACHE_DIR` env variable
- Update docs

Co-authored-by: Hans Gaiser <hansg91@gmail.com>
2022-10-01 12:13:39 +02:00
Danilo Bargen
026ae72742
Switch from ansi_term to yansi (#288)
ansi_term is not actively maintained anymore (see
https://rustsec.org/advisories/RUSTSEC-2021-0139). Replace it with a
suitable alternative.

I looked at termcolor, owo-colors and yansi and picked yansi:

- It is very simple
- It does not do terminal color support checking (we already do that in
  tealdeer)
- Its color enum type is almost identical to the one from ansi_term, so
  migrating is easy

The only change from a config API point of view is that "purple" is now
renamed to "magenta", but "purple" still works.
2022-09-27 23:55:50 +02:00
Olav de Haas
f4a94112f4
Add custom pages to list output (#285)
Fixes #205.
2022-09-24 21:27:35 +02:00
Niklas Mohrin
e94ee92db4
cargo clippy --fix 2022-08-21 21:53:10 +02:00
Kian-Meng Ang
97b4395e25
Fix typos (#277) 2022-06-20 12:35:17 +00:00
Evan Lloyd New-Schmidt
abbbbf01ed Add PlatformType::current for android target 2022-06-14 15:50:18 -04:00
Evan Lloyd New-Schmidt
4a5410fd0b Add support for android platform
tldr added android-specific commands under a new 'android' platform
last year: <https://github.com/tldr-pages/tldr/issues/5462>
2022-06-02 12:36:20 -04:00
Danilo Bargen
0f82aa5950
Create macOS release builds with bundled root certificates (#272)
As reported in https://github.com/dbrgn/tealdeer/issues/244, some users
on macOS had problems with `rustls-tls-native-roots`. Since we did not
find the root cause of this, we'll build macOS release builds with
`rustls-tls-webpki-roots` instead.

Fixes #244.
2022-05-06 10:43:30 +00:00
Danilo Bargen
62b6405685 Fix clap deprecation warnings 2022-05-03 22:10:18 +02:00
Danilo Bargen
5a1a21b8ab
Add note about auto-updates when cache is missing (#254) 2022-02-06 22:53:48 +01:00
cyqsimon
d5dbe3084b
Add no-auto-update flag (#257)
* Added `no-auto-update`
* Updated usage.txt
* Add `no-auto-update` to completion scripts
* Apply review suggestions
2022-01-21 09:12:10 +01:00
Danny Moesch
3b4451f8fa
Move definition of CLI arguments and options into own file (#258) 2022-01-19 23:49:23 +01:00
Danilo Bargen
77a6d48381 Pages download: Check return status 2022-01-09 21:14:30 +01:00
Danilo Bargen
71b6e037a7 When decompressing ZIP fails, propagate error
Do not unwrap. Instead, propagate the error with a anyhow context.
2022-01-09 21:14:30 +01:00
Marcin Puc
4a9763a783 Ensure that pager configuration is run at most once 2022-01-09 13:08:10 +01:00
Marcin Puc
82e4b97f92 Move pager configuration near render logic 2022-01-09 01:27:42 +01:00
Danilo Bargen
5262234846 Remove error module and clean up 2022-01-09 01:04:24 +01:00
Danilo Bargen
fd307757d7 Port cache and output modules to anyhow results 2022-01-09 01:04:07 +01:00
Danilo Bargen
405a2c9c8f Port config module to anyhow results 2022-01-09 01:04:07 +01:00
Danilo Bargen
84277cc31e
Cache: Return error if HTTP client cannot be created (#247)
Apparently `Client::new` can panic (see #244), so let's return the error instead.
2022-01-08 22:01:36 +01:00
Danilo Bargen
e722b4f92e
Rename main branch (#239) 2021-12-30 22:39:27 +01:00
Danilo Bargen
ed3d1ea9af Always add empty line before concatenating patch file 2021-12-30 21:09:37 +01:00
Danilo Bargen
fb40974616 Cache: Add tests for PageLookupResult::reader
Co-authored-by: Dalton Maahs <dalton.maahs@yourbind.com>
2021-12-30 00:01:31 +01:00
Danilo Bargen
0ef31d1f17 Concatenate page and patch bytes before processing
This way a patch file does not need a well-formed header anymore.

Fixes #181.
2021-12-30 00:01:31 +01:00
Danilo Bargen
6508ec6ac6 Ensure that default custom_pages_dir ends with trailing slash 2021-12-20 00:26:19 +01:00