Closed lord63 closed 8 years ago
Hi !
You pointed me to this issue, and I have some suggestions after having read more on the subject.
We could use the assets made by Travis to update the dependencies of tldr.py. We can even get rid of the annoying step "clone the tldr repo" by downloading the tldr.zip and using it.
I can probably do a pull request within a week if you like the idea. What's your opinion then ?
Fresh index is always available at: http://tldr-pages.github.io/assets/index.json
It is uploaded there together with pages archive.
@Shir0kamii @igorshubovych
The reason why I prefer the git repo:
Github has API limits. You will not be able to use it forever.
See what happened to brew: https://gist.github.com/christopheranderton/8644743
@igorshubovych
Github has API limits. You will not be able to use it forever.
What do you mean by this? I don't use homebrew so I can't get your point. Maybe homebrew use the github API for something but tldr.py just try to pull to fetch the latest pages, does this action also have limits? What's more, I don't think that users will hit this edge cause they won't update so frequently.
tldr.py just try to pull to fetch the latest pages, does this action also have limits?
I made mistake, i thought you were getting the page directly from Github. I just checked that you are doing once:
git ls-remote https://github.com/tldr-pages/tldr/ HEAD
In this case you are safe. But those clients which directly read pages from Git, they are not.
@igorshubovych Tldr.py
use the local page in the local repo, it is fast and you can custom your pages. Directly read from the git repo is slow and may hit the limit :)
Yes. Thanks for explanation.
@Shir0kamii Hi, tldr.py
v0.3.0 should support rebuild the index via tldr reindex
, have a try!
@lord63 I just tried and it works fine, thank you for your work. I have a really tiny comment about the message : "Rebuild the index." seems more like a description of the command than a message saying that the index is being rebuilt.
We need to let the users know that this subcommand works, so puts something to the terminal. Do you have any suggestions, like change the output message to?
How about implementing auto-update every e.g. 30 days. Similar to what Oh-My-Zsh does.
@igorshubovych
Although it is convenient for users, but this seems need more code and may make tldr.py
complicated and hard to maintain. I may not support this feature currently. Any ideas?
Check if it was not updated for 30 days, and say warning. This is how it is currently implemented in NodeJS client.
@lord63 simply "Rebuilding" instead of "Rebuild" should let the user know that it's being done, right ?
Tldr has remove the index build, so the updated pages may still can't be found since the
index.json
in not the latest. Also, when you add a custom page by yourself, you need to build the index yourself. Maybe we should add a subcommand to support building the index, for example:or something like this.