Thanks to visit codestin.com
Credit goes to github.com

Skip to content

Create a separate page for each command group #149

Open
@lefeverd

Description

@lefeverd

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

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions