cheat.sh icon indicating copy to clipboard operation
cheat.sh copied to clipboard

Handle cheat sheets existing in several upstream repositories

Open dgsb opened this issue 6 years ago • 5 comments

I was wondering if it was possible to specify on the query a specific cheat sheet source to look after when there are multiple sources available ?

dgsb avatar Jun 27 '19 09:06 dgsb

@dgsb David, it is (unfortunately) not possible now, and this is definitely a bug. In future, as soon as it will be implemented, by default all main sources will be sourced, and it will be possible to select a source with the name: prefix.

Say the ls cheat sheet tldr will be available at tldr:ls and from cheat at cheat:ls. This features are one of the most important short term features in my opinion

chubin avatar Jun 27 '19 19:06 chubin

Related problem, copied from https://github.com/chubin/cheat.sheets/issues/106

Todo

  • [ ] all cheat sheets from all upstream repositories must be shown by default
  • [ ] there are must be a way do address a cheat sheet from some repository directly (say: cheat:cpdf).

Details

Previously, I would just add cheat sheets to https://github.com/cheat/cheatsheets

But now, I'm a bit confused.

Say, I want to add a new jq sheet. There's one in this repo: https://github.com/chubin/cheat.sheets/blob/master/sheets/jq and this is the one that is served when querying cht.sh jq

Then there's this one https://github.com/cheat/cheatsheets/blob/master/jq

Which of the two should I update so that most people benefit from the change?

If the answer is both, can something be done about this?

chubin avatar May 21 '20 10:05 chubin

Moved last comment from: https://github.com/chubin/cheat.sheets/issues/106

Just a several notes:

  • You don't need this part: sed "s,\x1B\[[0-9;]*[a-zA-Z],,g", use ?T instead; ANSI will be filtered away at the server side.

  • the ~ subqueries work with all cheat sheets, not only with cheat sheets from cheat.sheets; I just wanted to say that you are encouraged to write big cheats in cheat.sheets (comparing to other repositories where cheat.sheets are supposed to be small or midsized)

  • about the link: yes, agreed; it would be even better to have a special cli option for that, like -e:

cht.sh -e cpdf
  • I want to a new (big) cheat sheet for jq anyway, feel free to edit/extend it.

chubin avatar May 21 '20 10:05 chubin

@dgsb David, the feature is implemented in #264 Could you please take a look at it? Do you have any suggestions?

chubin avatar Nov 22 '20 19:11 chubin

Hey @chubin, sorry for the super super late answer. The feature totally answers my needs. 👍

dgsb avatar Sep 12 '21 13:09 dgsb