Commit graph

91 commits

Author SHA1 Message Date
Nikolaos Karaolidis
f8a2003bc2
Add updates.warn_cache_age config option (#492)
This is useful when the cache is managed externally, e.g. provisioned
from a Nix store path or by a package manager, where the directory's
mtime doesn't reflect the cache's real age, causing a spurious warning
on every invocation. Today the only way to silence it is `--quiet`,
which must be passed every call and hides all other output too.
2026-07-07 14:24:06 +02:00
xtqqczze
d0108b23e4
Fix clippy lints on all targets (#481) 2026-05-07 15:07:27 +02:00
Pavel Timofeev
b8f7c0cc2d
Add display.indent config option (#471)
Fixes #394.
2026-04-17 21:59:34 +02:00
Pavel Timofeev
b19517097a
Add builtin tldr tealdeer page (#472)
Fixes #218.
2026-04-14 00:31:31 +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
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
1e87db7ab7
Cache rewrite (#416) 2025-08-01 16:03:01 +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
Nachiket Kanore
c6de583c46
Only create a single temporary directory in integration tests (#411) 2025-03-02 12:03:09 +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
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
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
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
tveness
76d9d0bbda
Obey 1.67 clippy lints (#313) 2023-02-07 21:56:41 +01:00
Danilo Bargen
7338933de5 Add integration test for cache_dir 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
Olav de Haas
f4a94112f4
Add custom pages to list output (#285)
Fixes #205.
2022-09-24 21:27:35 +02:00
Kian-Meng Ang
97b4395e25
Fix typos (#277) 2022-06-20 12:35:17 +00:00
Danilo Bargen
5a1a21b8ab
Add note about auto-updates when cache is missing (#254) 2022-02-06 22:53:48 +01:00
Danilo Bargen
fd307757d7 Port cache and output modules to anyhow results 2022-01-09 01:04:07 +01:00
Danilo Bargen
ed3d1ea9af Always add empty line before concatenating patch file 2021-12-30 21:09:37 +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
00ec281b9b Include custom pages directory in --show-paths command 2021-12-20 00:25:48 +01:00
Danilo Bargen
1a3624d011
Introduce command_or_file arg group (#230)
This allows to say "this command line parameter requires either a
command or a raw file".

Fixes #219.
2021-12-05 20:45:35 +01:00
Danilo Bargen
023a9d2079
Lowercase page names before lookup (#227) 2021-12-05 14:31:03 +01:00
Danilo Bargen
0fbc95cb71
Rename -o / --os to -p / --platform (#217)
This makes it compliant with the client spec.

The `-p` flag was previously used for the pager, using the pager now
requires using the long flag (`--pager`). Alternatively the pager can be
configured through the config file.

This commit also renames OsType to PlatformType.
2021-12-05 13:28:58 +01:00
Danilo Bargen
8833b6b401 Rename -m / --markdown to -r / --raw
That flag name is clearer: We output raw page data without processing.
2021-10-17 21:12:08 +02:00
invakid404
006ec6f3c0 Switch to recommended tldr-pages archive URL
Instead of downloading the GitHub repository archive, download the pages
from the official URL instead.

Squashed commits:

- chore: use recommended tldr-pages archive url
- chore: extract pages dir to constant
- chore(deps): install zip crate
- feat: use zip crate to unpack archive
- chore(deps): drop flate2
2021-10-16 20:09:32 +02:00
Danilo Bargen
7bd08e35d1 Refactor cache freshness checks
- Create explicit CacheFreshness enum
- Do not exit inside `check_cache` function, this prevents further
  actions if the cache isn't found

Co-authored-by: invakid404 <invakid404@riseup.net>
2021-10-16 20:09:16 +02:00
Danilo Bargen
e84fce6f90
Use tree-style imports (#204) 2021-09-13 09:06:21 +02:00
Danilo Bargen
07dc5c6bf4 Upgrade predicates and assert_cmd: 1 → 2 2021-09-12 21:12:00 +02:00
Danilo Bargen
a811788b31
Merge pull request #189 from niklasmohrin/simplify_highlight_commands
Refactor formatting code
2021-09-12 20:31:45 +02:00
Danny Mösch
1471b1d97b
Create cache directory path if it does not exist (#174)
Fixes #167
2021-09-12 20:28:22 +02:00
Niklas Mohrin
b216a63c64
Add integration test for non-ascii page rendering
Although this did not fail on old master, it is still an important case
to test. Actually, this test doesn't even break when introducing some
errors that fail i18n unit tests, unless the command name itself is
non-ascii.
2021-09-08 14:44:10 +02:00
Niklas Mohrin
22baa455b5
Update inkscape-default.expected 2021-09-08 14:44:09 +02:00
Wesley Klop
8051c3169a
Implement support for italics (#197)
Closes #146.
2021-09-06 17:01:55 +02:00
Marcin Puc
a4ac910e86 Add various small refactorings 2021-08-29 16:12:24 +02:00
Danny Mösch
b6342633cd
Use which instead of tar as reference tldr page in tests (#192)
The page for `tar` changes pretty frequently. `which` was last updated in 2018 and is a rather simple command overall. So it is less likely that the reference in the repository has to be updated as often as the one for `tar`.
2021-05-13 14:12:11 +02:00
Dalton
4d4c7b6a5d
Fix clippy warnings (#188)
* Fix clippy warnings
* Update toolchain for CI workflows fmt and clippy
2021-05-11 13:28:26 +02:00
Dalton
388deac079
Send all progress logging messages to stderr (#171)
- Change logging messages to go to stderr
- Updated tests to expect these messages in stderr instead of stdout
- Changed test_markdown_rendering to no longer rely on the tldr pages repo
2021-05-10 09:17:13 +02:00
Danny Mösch
a92e974ac2
Update expected output for 'tar' tldr page (#186) 2021-05-09 18:05:50 +02:00
Dalton
0fce79f8ed
Add unit tests for custom pages / patches (#183) 2021-04-23 20:06:44 +02:00