denisidoro/navi

Cant use tldr.

Darkslategray-lgtm opened this issue · 5 comments

Describe the bug
It cant use tldr and always shows 0/0 results.
But it can use cheatsh.
Additional information: I used brew to install tldr.

To Reproduce

  1. Input navi --tldr docker
  2. There is 0/0 result.

Screenshots

navi

Versions:

OS: macOS
Shell: zsh
navi: 2.22.1
zsh version: zsh 5.9 (x86_64-apple-darwin22.0)

Thanks for opening your first issue here! In case you're facing a bug, please update navi to the latest version first. Maybe the bug is already solved! :)

What is the output of these shell commands:

$ type -a tldr
$ echo $PATH
$ tldr docker --markdown

I have the same problem, as I described time ago in #798.

❯ tldr --version
tldr v1.6.0 (v1.6.0)
Copyright (C) 2016 Arvid Gerstmann
Source available at https://github.com/tldr-pages/tldr-c-client
❯ type -a tldr
tldr is /opt/homebrew/bin/tldr
❯ tldr docker --markdown
tldr: unrecognized option `--markdown'

[...]

If you have Python and its pip module, try to install the tldr client as a pip package:

$ python3 -m pip install --user --upgrade tldr

On my machine, it gives this version:

$ tldr --version
tldr 3.2.0 (Client Specification 1.5)

Which does recognize --markdown.

On Linux, it should be installed at /home/user/.local/bin/tldr.

Make sure that /home/user/.local/bin is in your PATH, and that it comes before /opt/homebrew/bin (or remove the tldr client installed from Homebrew). Also, if the output of $ type -a tldr contains multiple lines, /home/user/.local/bin/tldr should be printed on the very first line.


There might be yet another alternative using npm(1), but I haven't tested it.