leostera / tldr.jsx

📚 A Reactive web client for tldr-pages
https://tldr.ostera.io
MIT License
1.54k stars 75 forks source link

Support external lookups for tldr.md page in github repos #62

Open leostera opened 8 years ago

leostera commented 8 years ago

Use-case:

I have watch and try. Two small cli utils that have no place in tldr itself because they do not come bundled with any UN*X distro.

I'd like to be able to reuse the current frontend and serve a small tldr page on how to use it from within the repo, by requesting https://tldr.ostera.io/ostera/watch.

The page could live in ./TLDR.md inside the ostera/watch repo.

Upsides:

Downsides:

I'd like to know what @waldyrious thinks of this.

waldyrious commented 8 years ago

The idea is great! Essentially we'd make the storage of command pages distributed. There are some points we might need to iron out:

1) we need a definitive format for the TLDR pages. I've been mulling on a proposal to change the pages' syntax (tldr-pages/tldr#958), but we could start with the current syntax as a 1.0 spec, eventually updating it with the proposals shown in https://github.com/tldr-pages/tldr/labels/syntax 2) we do already have several tools that don't come bundled with any Unix distro. I don't think having a large repo would be too problematic, as it's mostly small text files. However, we will indeed end up bumping into naming conflicts if we just keep growing indiscriminately, so either agreeing on explicit requirements for inclusion, or swapping to a namespaced approach (e.g. user/repo) will probably be needed. Again, this doesn't preclude this feature to be implemented, but we will have to make a decision sooner or later.

As for the downsides, I don't understand the first one; the second is not a problem IMO -- we could e.g. add a disclaimer to the top of the page if the content isn't being loaded from the tldr-pages project.

leostera commented 8 years ago

On the downsides, the first one means that it wouldn't be able to suggest commands as alternatives because it doesn't know they exist. Say you look for windows/du and it can't find it, but it can find linux/du in the index. If a command is not in the index, then it can't be shown as an alternative.

waldyrious commented 8 years ago

We could use that as an opportunity to prompt people to contribute the missing commands, like the current node client does :)