mkdocs / mkdocs-click

An MkDocs extension to generate documentation for Click command line applications
https://pypi.org/project/mkdocs-click
Apache License 2.0
109 stars 16 forks source link

Improve visualisation of command hierarchy in headings #35

Closed florimondmanca closed 3 years ago

florimondmanca commented 3 years ago

Problem statement

Consider a nested CLI, ie one group with one or more nested commands or groups.

Right now the TOC looks like this:

This is nice and clean, as it allows visualizing the

But… In the page content itself, the hierarchy is only represented by heading styles (more or less big/bold text), like this:

root

Usage: ...
Options: ...

subgroup1

Usage: ...
Options:...

subcommand1

Usage: ...
Options: ...

subcommand2

Usage: ...
Options: ...

subcommand3

Usage: ...
Options: ...

When looking at a given section, it is not obvious to know whether a given command belongs to a parent group (and which one) (see subcommand1 and subcommand2), or if it's just a standalone command (see subcommand3).

Besides, permalinks only contain eg /#subcommand2, which again doesn't convey the actual hierarchy.

Suggested solution