Skip to content

Increase heading & ToC indentation levels for subcommands #31

@chadoh

Description

@chadoh

Given a CLI like:

git remote add
git remote rm
git remote set-url
git submodule init
git submodule deinit

clap-markdown should generate a TOC like:

- git
- git remote
  - git remote add
  - git remote rm
  - git remote set-url
- git submodule
  - git submodule init
  - git submodule deinit

And yes, we should skip increasing the indent level for first-level subcommands, otherwise the only thing at the main level will be the root command, which is silly.

It should likewise increase the heading levels for each subcommand nest level, all the way to h6 (######) and then to simple bold tags for CLIs with nesting beyond six levels (😱).

## `git`

Git is a fast, scalable, distributed revision control system.

## `git remote`

Manage the set of repositories ("remotes") whose branches you track.

### `git remote add`

Add a remote named <name> for the repository at <URL>. 

### `git remote rm`

Remove the remote named <name>. 

### `git remote set-url`

Changes URLs for the remote. 

## `git submodule`

A submodule is a repository embedded inside another repository. 

### `git submodule init`

Initialize the submodules recorded in the index.

### `git submodule deinit`

Unregister the given submodules.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions