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

Create a separate page for each command group #149

Open
lefeverd opened this issue Jan 24, 2025 · 0 comments
Open

Create a separate page for each command group #149

lefeverd opened this issue Jan 24, 2025 · 0 comments

Comments

@lefeverd
Copy link

Hello,

First of all thank you for the extension.
I have a CLI which consists of multiple groups, with subgroups, and commands (commands collection).

Currently, the generation of the documentation for a collection generates a single page.
Would it be possible to generate separate pages for each "root" level group ?

Here's a minimal example of a CLI application (testcli.py) :

import click


def setup_cli():
    root = click.Group()

    test = click.Group(name="test", short_help="test related commands")
    subtest = click.Group(name="subtest", short_help="subtest related commands")
    subtest.add_command(test_command)
    test.add_command(subtest)

    root.add_command(test)
    return root


@click.command()
def test_command():
    click.echo("Hello")


root = setup_cli()

if __name__ == "__main__":
    root()

And the index.rst :

.. click:: testcli:root
   :prog: test-cli
   :nested: full

Thank you,
David

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

No branches or pull requests

1 participant