halp icon indicating copy to clipboard operation
halp copied to clipboard

Incorporate documentation from tldr

Open pepa65 opened this issue 1 year ago • 6 comments

Using documentation

Great to use man pages, trying -h/--help, but there is also information at the tldr project that you could be tapping into: https://github.com/tldr-pages/tldr

Describe the solution you'd like

Next to the man page, offer a direct dive into the alternate documentation of tldr.

Describe alternatives you've considered

Just bypass halp and use tldr directly, but halp could be a one-stop solution, so people don't need to download tldr or the tldr archives themselves.

pepa65 avatar Mar 12 '23 11:03 pepa65

I also agree with this - tldr would be a great addition.

A possible solution could involve something like Tealdeer, which seems to be a rust client to get tldr data.

BurntNail avatar Mar 12 '23 17:03 BurntNail

Hello @pepa65 @BurntNail ! 🐻

Thank you for the great suggestion! Do you know by any chance is there an endpoint to receive tldr data such as tdlr.sh/<foo>? Or should this be incorporated as a shell command?

One thing to note, if you want to use tealdeer, you can do the following:

$ halp plz --man-cmd "tldr" <foo>

However, it will replace the man option. We can add another option for running tldr instead.

What do you think?

orhun avatar Mar 15 '23 15:03 orhun

@orhun thanks for taking a look at this - I think this is best incorporated as a shell command - it makes liberal use of colours and might be a pain to just GET.

Not sure about anyone else's thoughts though.

Shall I draft up a PR?

BurntNail avatar Mar 15 '23 15:03 BurntNail

tldr is complementary to man-pages, so you should definitely do both. Do you mean where to download the tldr archive? https://tldr.sh/assets/tldr.zip

pepa65 avatar Mar 15 '23 15:03 pepa65

Isn't the problem with that having to check for updates?

BurntNail avatar Mar 15 '23 15:03 BurntNail

I think this is best incorporated as a shell command - it makes liberal use of colours and might be a pain to just GET.

Fair point.

Shall I draft up a PR?

If you mean adding a new option for running tldr shell command, sure.

Do you mean where to download the tldr archive? tldr.sh/assets/tldr.zip

Not really. I was curious if tldr has a HTTP endpoint for fetching the page. (similar to cheat.sh)

Isn't the problem with that having to check for updates?

Yeah, let's not deal with that.


By the way, I'm thinking if we can add a more generalized solution such as:

$ halp plz --with-option "Show TLDR:tldr {}"

Or in config file:

# custom options for `plz` menu
options = [ { option = "Show TLDR", command = "tldr {}" } ]

Maybe it's a topic for another issue but it would be nice to get opinions on this.

orhun avatar Mar 15 '23 17:03 orhun