* 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.
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>
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.
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`.
- 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
Separate page list with newlines, not with commas.
From the official spec:
> Additional decoration MAY be printed if the standard output is a TTY.
> If not, then the output MUST not contain any additional decorations.
> For example a page list MUST be formatted with 1 page name per line
> (to enable easy manipulation using standard CLI tools such as grep etc.).