sphinx-argparse icon indicating copy to clipboard operation
sphinx-argparse copied to clipboard

Ensure that the tittle id is unique on the with different subcommand

Open ice-tong opened this issue 6 months ago • 1 comments

Motivation

I found the URL hash property of the rendered action group tittle could be repeat conflict in one page. The following is a pseudo example to reproduce:

# xxx-cli
Some introduction of `xxx-cli` here...

## xxx-cli subcommand1
Some introduction of `xxx-cli subcommand1` here...
:::{eval-rst}
.. argparse::
   :module: xxx.cli
   :func: get_parser
   :prog: xxx-cli
   :path: subcommand1
:::

## xxx-cli subcommand2
Some introduction of `xxx-cli subcommand2` here...
:::{eval-rst}
.. argparse::
   :module: xxx.cli
   :func: get_parser
   :prog: xxx-cli
   :path: subcommand2
:::

Modification

  • sphinxarg/ext.py
    • Add the data['name'] to the title_as_id.
  • test/test_default_html.py
    • Update the unit test of subcommand.

ice-tong avatar Aug 15 '24 02:08 ice-tong