Commit graph

550 commits

Author SHA1 Message Date
Niklas Mohrin
49626977ff
Run cargo +nightly clippy --fix and formatting (#442) 2025-10-03 22:44:39 +02:00
Niklas Mohrin
9a83b58d51
Bump MSRV to 1.85 and update dependencies (#441)
The latest version of base64ct requires 1.85, and I don't want to think about whether older versions of crypto libraries are safe.
2025-10-03 22:38:02 +02:00
Niklas Mohrin
2b127fd67e
Highlight code examples in user docs (#440)
* Highlight code examples in user docs
* Add missing quotes to archive_source example
2025-10-03 20:59:22 +02:00
Niklas Mohrin
911508ce33
Add search.platforms config option and search all platforms by default (#435) 2025-10-03 20:15:34 +02:00
hex1c
5b306756af
Add display.show_title option to display command titles in output (#439) 2025-10-03 19:53:25 +02:00
Niklas Mohrin
abb7e8ac55
Remove native-tls from default feature set (#436) 2025-09-22 16:06:36 +02:00
Niklas Mohrin
92b6c64c87
Merge pull request #430 from niklasmohrin/language-config
Add `search.languages` and `updates.download_languages` settings
2025-09-22 00:05:24 +02:00
Niklas Mohrin
c741146db5
Add updates.download_languages setting 2025-09-22 00:00:09 +02:00
Niklas Mohrin
a74b7120bd
Add search.languages setting 2025-09-21 23:59:50 +02:00
Niklas Mohrin
3fa96a5bb2
Add test config::test::language::with_encoding 2025-09-21 23:59:13 +02:00
Niklas Mohrin
7e014093cf
Move existing tests from config module into test submodule 2025-09-21 23:59:13 +02:00
Niklas Mohrin
94f9030d36
Move Language related functionality into config module 2025-09-21 23:59:05 +02:00
dependabot[bot]
5cfb817e99
Bump actions/download-artifact from 4 to 5 (#433)
Bumps [actions/download-artifact](https://github.com/actions/download-artifact) from 4 to 5.
- [Release notes](https://github.com/actions/download-artifact/releases)
- [Commits](https://github.com/actions/download-artifact/compare/v4...v5)

---
updated-dependencies:
- dependency-name: actions/download-artifact
  dependency-version: '5'
  dependency-type: direct:production
  update-type: version-update:semver-major
...

Signed-off-by: dependabot[bot] <support@github.com>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
Co-authored-by: Niklas Mohrin <dev@niklasmohrin.de>
2025-09-03 17:17:51 +02:00
dependabot[bot]
4377366c97
Bump actions/checkout from 4 to 5 (#434)
Bumps [actions/checkout](https://github.com/actions/checkout) from 4 to 5.
- [Release notes](https://github.com/actions/checkout/releases)
- [Changelog](https://github.com/actions/checkout/blob/main/CHANGELOG.md)
- [Commits](https://github.com/actions/checkout/compare/v4...v5)

---
updated-dependencies:
- dependency-name: actions/checkout
  dependency-version: '5'
  dependency-type: direct:production
  update-type: version-update:semver-major
...

Signed-off-by: dependabot[bot] <support@github.com>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
2025-09-03 16:52:36 +02:00
Niklas Mohrin
630b7f4423
Allow references in Config (#429)
For #251, I want to use the `Language<'_>` type inside `Config`. The languages will either refer to values read from the config file, or to static strings from `get_languages_from_env`, so just using `Language<'static>` is not an option.

Instead, some input for the `Config` needs to be persisted in the main function for the duration of the program so that the config can reference it. At first I was hoping that this input would be the `contents` string from `RawConfig::load`, but as it turns out you cannot (in general) deserialize strings from toml without having to alter them, for example when they contain escapes like `\n`. Thus, the toml parser seemingly doesn't even try and just throws an error when deserializing into a borrowed string (even if it could in theory just return the correct substring from the input). Given that `RawConfig` should stay static then, the raw config itself is the next best thing to keep alive and have the config reference into.

While this change might seem a bit drastic for little benefit, I am actually pretty happy with it because I want to unify the configuration anyways at some point so that the CLI arguments, environment variables, and the config file are merged at the beginning of the program and then only a single config is used for the everything (no more `enable_styles` everywhere!). At this time, the `Config` would have references into `Cli` anyways, and having the `ConfigLoader` as an entity for this merging also seems natural.
2025-08-05 23:46:49 +02:00
Niklas Mohrin
1e87db7ab7
Cache rewrite (#416) 2025-08-01 16:03:01 +02:00
Niklas Mohrin
d1be7d6bb9
Introduce Language struct (#425)
* Remove unneeded Clone bound on Dedup
* Introduce Language struct to represent language strings
* Move language directory name logic into own method on Language type
2025-06-06 23:25:30 +02:00
Niklas Mohrin
43ab2cb920
Bump MSRV to 1.80 (#426) 2025-06-06 23:13:47 +02:00
Niklas Mohrin
bc820c5f10
Upload binaries from build step as artifact (#423) 2025-06-06 22:52:44 +02:00
MHS-0
9bb95ad11d
Add an option to specify a custom config file to be used (#422)
Co-authored-by: Niklas Mohrin <dev@niklasmohrin.de>
2025-05-31 21:43:39 +02:00
Niklas Mohrin
769ef4da20
Merge branch 'v1.7.x' 2025-03-18 23:51:51 +01:00
Niklas Mohrin
8f433e7774
Release v1.7.2 v1.7.2 2025-03-18 23:38:12 +01:00
Niklas Mohrin
81a0662dbc
Run CI on backport branches and on dispatch 2025-03-18 23:04:24 +01:00
Niklas Mohrin
9f43adb7f9
Require zip >= 2.3.0 2025-03-18 22:58:26 +01:00
Erick Guan
3d8d488f66
Replace reqwest with ureq (#417)
ureq is a blocking HTTP client. ureq is simpler than reqwest. This
brings:
- smaller binary size
- cleaner configuration interfaces
2025-03-09 22:06:47 +01:00
Nachiket Kanore
c6de583c46
Only create a single temporary directory in integration tests (#411) 2025-03-02 12:03:09 +01:00
Niklas Mohrin
009af7063f
Move most of main to try_main (#400)
Currently, `main` uses `print_error` and `process::exit` in several
places. These could be unified by propagating errors via `Result`s.
There is one place left that manually calls `print_error`, because the
error should be followed by help instructions printed without any
highlighting.
2025-02-26 23:04:41 +01:00
lyj
55f401df30
Add args: --edit-page and --edit-patch (#388)
Fix https://github.com/tealdeer-rs/tealdeer/issues/383

Co-authored-by: Niklas Mohrin <dev@niklasmohrin.de>
2025-02-26 22:03:18 +01:00
Erick Guan
09ef7f534e
Allow configuring TLS backend (#386) 2025-02-26 00:27:44 +01:00
Predrag Minic
120e2a92c2
Add configuration option for archive_source (#337)
This allows for specifying a custom archive URL as an alternative approach to Custom Pages.

Co-authored-by: Niklas Mohrin <dev@niklasmohrin.de>
2025-01-12 12:24:02 +01:00
Christoph Loy
09d44110f8
Add tests for osx/macos alias (#407)
Co-authored-by: Niklas Mohrin <dev@niklasmohrin.de>
2025-01-12 12:04:22 +01:00
Christoph Loy
b9f116d629
Add common platform to CLI (#401) 2025-01-12 11:50:32 +01:00
Matěj Kafka
00c7778125
Resolve paths in config [directories] relative to the config directory (#395) 2025-01-05 00:17:44 +01:00
Niklas Mohrin
826630737c
Merge pull request #399 from niklasmohrin/tests
Various test improvements
2025-01-03 00:36:56 +01:00
Niklas Mohrin
dbab55a2b4
Use only one test thread
Otherwise the builds made by `TestEnv::command` will conflict with each
other. This manifested itself on Windows with

> linking with `link.exe` failed: exit code: 1104
> LINK : fatal error LNK1104: cannot open file '...'
2025-01-02 23:55:36 +01:00
Niklas Mohrin
e7b434d06a
Prefer config file over TEALDEER_CACHE_DIR in integration tests 2025-01-02 23:55:36 +01:00
Niklas Mohrin
fc19206029
Add ignore-online-tests feature
Since these tests require internet access, they are undesirable in
reproducible builds [1] (and in general, I guess). The overall goal is
to shrink this list to a minimum. At some point we might remove the
feature again and ignore online tests by default. Before putting much
thought into refactoring the remaining tests, we should wait until we
have introduced the `updates.archive_url` option. Then, we could run a
local webserver that serves a known file. Until then, having the feature
already helps discourage using `--update` in tests that don't need it
and allows for quicker test execution locally if wanted.

- [1]: edf04b75c1/pkgs/by-name/te/tealdeer/package.nix (L34-L44)
2025-01-02 23:55:36 +01:00
Niklas Mohrin
e85de336ed
Structure test fixtures like page cache 2025-01-02 23:55:35 +01:00
Niklas Mohrin
909bad9c65
Fix feature selection in integration tests 2025-01-02 23:55:35 +01:00
Niklas Mohrin
ceee231891
Merge pull request #398 from niklasmohrin/dependencies
Update dependencies to hush dependabot
2025-01-01 19:33:59 +01:00
Niklas Mohrin
0c55a4b82a
Run cargo update --recursive -p rustls 2025-01-01 19:22:25 +01:00
Niklas Mohrin
e3a06eefe3
Run cargo update -p hashbrown 2025-01-01 19:21:36 +01:00
Niklas Mohrin
6869837e79
Run cargo update -p url to bump idna 2025-01-01 19:21:04 +01:00
Niklas Mohrin
ee5418b5a8
Run cargo clippy --fix (Rust 1.83) (#397) 2025-01-01 19:07:40 +01:00
Niklas Mohrin
1d9153e37e
Release v1.7.1 v1.7.1 2024-11-14 22:11:34 +01:00
Niklas Mohrin
d719f21f7b
Bump futures-util (0.3.30 is yanked) 2024-11-14 21:59:23 +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
Danilo Bargen
d44613cf59 Release v1.7.0 v1.7.0 2024-10-02 23:02:32 +02:00
Danilo Bargen
713f6f913c
Run cargo update (#381) 2024-10-02 22:44:22 +02:00
Niklas Mohrin
ec2daa495c
Replace atty with std::io::IsTerminal (#380) 2024-10-02 20:32:17 +00:00