wp-cli / scaffold-package-command

Scaffolds WP-CLI commands with functional tests, full README.md, and more.

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

Introduce Featured Commands in README in scaffold package-readme

ernilambar opened this issue · comments

Feature Request

Describe your use case and the problem you are facing

For package with large number of commands and subcommands, navigating through commands is quite difficult. TOC in the beginning of readme would be very helpful.

Describe the solution you'd like

List the commands anchored with corresponding command.

Example: https://github.com/ernilambar/entity-command/blob/toc/README.md

Thanks for the suggestion!

I think listing all of the commands in a TOC could be a bit much for some. However, we could allow package authors curate the most popular commands into TOC (and indicate as such).

In extra in composer.json, lets support featured-commands parameter:

    "featured-commands": [
      "database test",
      "database reset"
    ],

Output would be:

Screenshot 2024-02-26 at 12 12 46 PM

Example: https://github.com/ernilambar/database-command/tree/yo-toc#readme

Cool, I think that looks reasonably good.

FWIW, GitHub already shows a table of contents:

Screenshot 2024-02-28 at 10 37 15

IIRC we already had this discussion at some point.

Yah it seems there is already an issue: #141

@swissspidy That GitHub thingy of readme file looks cool. I didn't know that. Nice.
This issue was started with full TOC is mind but now discussion is going around featured commands

@danielbachhuber Featured commands was sparked from the need to see all commands in a bird eye view, which GitHub kind of already provides (even though with one extra click). So I am now neutral about this now. I am ok whatever you decide.

Yeah, let's wontfix this. I think it's only a problem when a package has a lot of commands, which is just a few.

Package authors can easily highlight featured commands by creating a custom section part