dbrgn / tealdeer

A very fast implementation of tldr in Rust.
https://dbrgn.github.io/tealdeer/
Apache License 2.0
4.09k stars 124 forks source link

Feat: add --markdown CLI flag #302

Closed benelan closed 1 year ago

benelan commented 1 year ago

I use a tool called navi, which supports searching tldr cheatsheets

navi --tldr <command>

However, navi requires the tldr client to support the --markdown flag like the node client has. When I tried using tealdeer with navi I got the following error:

Failed to call: 
tldr grep --markdown

Output:

Error:
error: Found argument '--markdown' which wasn't expected, or isn't valid in this context

    If you tried to supply `--markdown` as a value rather than a flag, use `-- --markdown`

USAGE:
    tldr <COMMAND|--render <FILE>>

For more information try --help

Note:
Please make sure you're using a version that supports the --markdown flag.
If you are already using a supported version you can ignore this message. 
The tldr client written in C (the default one in Homebrew) doesn't support markdown files, so navi can't use it.
The client written in Rust is recommended. The one available in npm works, too.

Woud you consider adding the --markdown flag? Thanks!

Edit: I can take a stab at a PR if it's something you'd consider approving.

dbrgn commented 1 year ago

That flag in tealdeer is currently called -r / --raw. As long as the client specification doesn't standardize this flag, I'd be reluctant to change it in tealdeer, just to accomodate a third party tool.

Adding an invisible alias would be a possibility, but I think trying to standardize this flag would be the better way forward in the long term. (The place to suggest such a standardization would be over at https://github.com/tldr-pages/tldr.)

benelan commented 1 year ago

Gotcha, thanks for the insight!