sphinx-argparse
sphinx-argparse copied to clipboard
Ensure that the tittle id is unique on the with different subcommand
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 thetitle_as_id
.
- Add the
-
test/test_default_html.py
- Update the unit test of subcommand.