Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Import cheat sheets from other tools #891

Open
Tracked by #3
amanger-qual opened this issue Apr 30, 2024 · 5 comments
Open
Tracked by #3

Import cheat sheets from other tools #891

amanger-qual opened this issue Apr 30, 2024 · 5 comments
Labels
new feature New feature or request

Comments

@amanger-qual
Copy link

I love that we can query tldr and cheatsh, but every time we query them, it takes a while to load.

I'd love to be able to have them imported so I can search for them using navi.

As an alternative, I've considered re-writing the entire cheatsheet then uploading myself, but it would be much easier if navi could just import it.

@amanger-qual amanger-qual added the new feature New feature or request label Apr 30, 2024
Copy link

welcome bot commented Apr 30, 2024

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! :)

@dkasak
Copy link

dkasak commented Jan 7, 2025

+1. Is this just something that hasn't been implemented yet or is it a matter of being contrary to navi's philosophy?

@alexis-opolka
Copy link
Contributor

@amanger-qual and @dkasak How would you like navi to import other cheatsheets?
Do you want Navi to get a cheatsheet to import, then parse it and transform it into a navi cheatsheet then dump it in the default/running path for cheatsheets?

I don't see any reason for Navi to not be able to import other tools cheats, the only issue would be the need for a continuous watch for updates to the said tools cheatsheets syntax.

Any thoughts on it @denisidoro?

@dkasak
Copy link

dkasak commented Feb 24, 2025

I don't have a strong opinion since I'm not sure how this would be best accomplished either.

I was coming from the observation that there's a lot of prior art in terms of ready-made high quality cheatsheets (tldr and cheat.sh) and that navi already has some support for them. However, friction remains high because currently the only way to access those cheatsheets is to provide a separate flag, with a concrete search term, right at the start, which also requires a network roundtrip. There's also no way to get a unified view of native cheatsheets + the others.

Since I prefer navi for its UX in almost all other respects, I really want to be using it as a first-class interface to these other cheatsheets. I think my preferred workflow would be something like:

  1. You specify a number of sources you want to enable: native, tldr, cheat.sh and others if they appear.
  2. navi downloads those into a local cache on first run and keeps them up-to-date by periodically refetching.
  3. When navi is started, there's an indicator which source the cheatsheet is coming from. There's also a hotkey which cycles between a unified view containing all cheatsheets and a separate view for each of the sources.

Bear in mind I'm not sure how feasible any of this is, but on the surface, the above is what I imagine the ideal to be like.

@alexis-opolka
Copy link
Contributor

Hi,

For the first and second steps, changes needs to be done. Currently, navi isn't able to synchronise any cheatsheet from a git repo. (There is an issue dedicated to it #733)

I never used navi to fetch cheats from tldr or cheat.sh but I suppose it currently fetches the results from those tools (maybe explaining the latency) then printing it out in navi's interface so if we don't make a major change on that side it shouldn't be difficult to integrate with those tools.

On the side of the interface, I think it shouldn't be that difficult to make the type of the cheat pop up, in the case of a separate view I can't say as I haven't dabbled much in navi's code of the different views.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
new feature New feature or request
Projects
None yet
Development

No branches or pull requests

3 participants