Skip to content
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

Add wp handbook gen-custom for custom commands #526

Draft
wants to merge 1 commit into
base: main
Choose a base branch
from

Conversation

BrianHenryIE
Copy link
Member

@BrianHenryIE BrianHenryIE commented Jul 3, 2024

I want to use the same documentation style in my own plugins. I.e. wp handbook gen-custom my-command should generate markdown docs for my command, wherever I want them in my project.

NAME

  wp handbook gen-custom

DESCRIPTION

  Generate the documentation page for a custom command using the same templates as the official WP-CLI commands.

SYNOPSIS

  wp handbook gen-custom <command> [--output_dir=<output_dir>] [--verbose]

OPTIONS

  <command>
    The custom WP CLI command to generate the documentation for.

  [--output_dir=<output_dir>]
    Directory in which to save the documentation.
    ---
    default: ./docs/wp-cli
    ---

  [--verbose]
    If set will list command pages as they are generated.
  • ./docs/ was chosen based on php-pds/skeleton
  • gen-custom should maybe be gen-custom-command
  • Documentation above needs examples – what WordPress maintained plugin has CLI commands?
  • I need to consider how to handle subcommands
  • Documentation for gen-all (which runs on @when before_wp_load) needs to make clear that it means all WP CLI native commands
  • Tests

@ernilambar
Copy link
Member

I think this would be a good candidate for separate WP-CLI package. Few months back, I needed similar for the commands in a plugin. I ended up copying and modifying the parser from this repo and used it to generate docs.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants