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

Improve visualisation of command hierarchy in headings #35

Closed
florimondmanca opened this issue Feb 19, 2021 · 0 comments · Fixed by #36
Closed

Improve visualisation of command hierarchy in headings #35

florimondmanca opened this issue Feb 19, 2021 · 0 comments · Fixed by #36
Labels
enhancement New feature or request

Comments

@florimondmanca
Copy link
Contributor

florimondmanca commented Feb 19, 2021

Problem statement

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

Right now the TOC looks like this:

  • root
    • subgroup1
      • subcommand1
      • subcommand2
      • ...
    • subcommand3
    • ...

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

  • Make headings contain the full command_path, eg ## root subgroup1 subcommand2
  • Permalinks should be updated too, eg /#root-subgroup1-subcommand2 (see custom labels)
  • TOC entries should not change, as the TOC already conveys the hierarchy just fine.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request
Projects
None yet
Development

Successfully merging a pull request may close this issue.

1 participant