-
-
Notifications
You must be signed in to change notification settings - Fork 4.1k
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
Indicate available subcommand pages #5190
Comments
I would love for this feature to be implemented client-side. 👍🏻 Of course, with our monolith network of clients, it would take a while to get them all updated...but since it's just an optional feature we could probably add it at any time to the tldr-node-client, and maybe the tldr-python-client, too. |
If we decide to do this, how would it be done? Should we assume that any pages that start with the current page name are subcommands of the command the page describes? (I'm sorry about how this sentence was written, I could not find any way to make it clearer haha) |
Sounds reasonable to me, do you see a problem with that approach? |
Also, for the pages that seem to be possible subcommands, check if the title has a space or dash—a space would indicate a command and a subcommand like Of course, we would need to check for cases where there's a dash and a space, e.g. in |
I wonder if we would ever introduce YAML frontmatter into our markdown files...I know that's a big change (@waldyrious @sbrl) but it would be really useful for this sort of thing, and also for marking translated languages, supported OS's, etc. |
Some clients have a search feature, that allows you to search for a specific substring in a page. This could be used as a workaround for now. For indicating a see also, we do have a general convention on that. It goes in the description directly above any more information link like this: > See also `foo`. ...optionally with a description: > See also `foo`, which does bar. Obviously this isn't useful for a large number of subcommands though - for that I'd suggest using a search feature if one is built into your client (I use tldr-bash-client, which has a search feature) |
Would you accept a PR implementing the approach discussed above in https://github.com/tldr-pages/tldr-python-client ? |
Hi, this is the first time I stumbled upon this issue (since I started watching all repos in org, honestly I should check the backlog more often xD). Regarding referencing subcommands, we have three approaches we can take in this repo:
We have documented this in the style guide and the contributing page will go through them again and update it if any of the above approaches aren't documented. Should this be added on the client side? I think this would probably cause redundant work as we already reference most of them directly here (so I am closing this issue). While we can't reference all the commands of a large utility, we already reference the important commands. Let's say a client implements matching the subcommands based on the main command name (i.e For clients to still show/reference all commands you can build an index (along with completion support for it, but it would make the client a bit slow as observed in the Node client) and show below the command's output like: Similar commands: `command1`, `command2, `command3`, `command4`, `command5`, ... This can't be implemented with the Python client as it directly fetches the page from GitHub and doesn't build an index or use our existing index. Since the syntax can change on different pages we can't do this in the render side either. If you are interested, feel free to work on adding search flag support to our Python client using the existing index (maybe with autocompletion too). Miscellaneous (note for maintainers)
Reference image:
|
Ref client-specific changes, I recommend opening an issue against their repositories to discuss those. But generally seems cool! |
Yeah, Will open up issues in the node client tomorrow. |
For rarely used command like
nmcli
it would be nice to indicate the availability of tldr pages for subcommands. (The current nmcli page is not adding much value imo and I did not expect it to have subcommand pages until I stumbled upon them here on the repo.)I checked git and aws for examples but couldn't find an indication. May I add something like "See also:
tldr nmcli device
ortldr nmcli connection
" to thenmcli
page and is there a style guide for that?Can/Should this be implemented client side? Including it in the pages however has the advantage that we can hand-pick the most important subcommands (i.e. those that someone not knowing the subcommands by heart would find most helpful) and choose the order they appear in.
The text was updated successfully, but these errors were encountered: