* 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>
- 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>
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.
Squashed commits:
- chore: wipe only pages instead of entire cache dir
- fix: only delete dir if it exists
- chore: try to make variable names less confusing
- chore: display error as well
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
- 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>
This is required for Result::map_or_else.
Additionally, run clippy with 1.41 as well. Otherwise it reports
suggestions that are not compatible with 1.41.
- Replace `Result` parameters with `Option`
- Replace `HashSet` for deduplication with linear search based approach
- Avoid intermediate allocations
This reduces the instruction count in release mode by almost 50%.
We try to enable ANSI color support on Windows using the new APIs.
If that succeeds, we print colors as usual. If it fails, we disable
styles completely.