isacikgoz / tldr

fast and interactive tldr client written with go
https://isacikgoz.me/tldr/
MIT License
1.36k stars 48 forks source link

[Request] Make the local settings dir(s) configurable? #10

Open absolutejam opened 5 years ago

absolutejam commented 5 years ago

Hey, great work on this version of a tldr client 👍

I've recently started using tldr quite a lot, but I also have my own collection of markdown snippets which I've typically accessed via. vim in the past. It would be really be nice if I could consolidate them into tldr.

Is there any possibility of either a way to override the config directory and/or add another directory to index, so tldr could scan both the canonical resource and my own folder(s)? That way I could use my own snippets - some of which can't be contributed upstream to tldr - using the same tool.

For example, functionality like the following to override and use only my own resources, would be awesome.

# Override the man dir and only use my custom snippets
tldr --man-dir ~/.tldr git
# or add my own snippets on top of the normal tldr snippets
tldr --additional-dir ~/.tldr git

Cheers, James.

isacikgoz commented 5 years ago

Hey @absolutejam , thanks for the feedback I totally miss your suggestion. Sorry for the late reply. Current implementation regularly checks a single git repository which is tldr-pages official repo. I guess your current suggestion will add a little bit complexity to the code. That is what I try to avoid. However, I am thinking a workaround; you can manually add those files to the repo and if they won't conflict with repo files, it will work as you expected.

Still, this issue can stay opened so that we can hear others thoughts.

Plloi commented 4 years ago

for a simple workaround maybe make the upstream repo configurable. then the user could make/add their own snippets, but it would be on them to maintain sync with tldr master. --This is already kinda doable, after first sync replace the repo's origin with desired target, this should hold until clear-cache is fun.

i've got half an idea for managing multiple data dirs while (hopefully) keeping complexity down i might play with.

josefwells commented 4 years ago

I would like something like this (but maybe depend on an ENV variable to set the location for the clone) This would cover the original-bug intent (TLDR_DATA=/personal tldr special_command vs. TLDR_DATA=/global tldr regular_command)