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

Section numbers wrong when multiple argparse directives used in single page #127

Open
djhoese opened this issue Jul 29, 2020 · 0 comments
Open

Comments

@djhoese
Copy link
Contributor

djhoese commented Jul 29, 2020

I have a documentation page that lists a series of utility scripts like:

Utility Scripts
===============

Stuff about utility scripts.

Util Script 1
-------------

.. argparse::
    :module: mypkg.utilscript1
    :func: get_parser
    :prog: util_script1.sh
    :nodefaultconst:


Example:

Some more stuff

Util Script 2
-------------

.. argparse::
    :module: mypkg.utilscript2
    :func: get_parser
    :prog: util_script2.sh
    :nodefaultconst:


Example:

Some more stuff

But when I render this, Sphinx can't tell the difference between the two "Positional Arguments" and "Named Arguments" section so it chooses the section numbers based on the last sections with those titles. So if "Utility Scripts" page is number 7, then "Util Script 1" is 7.1 and "Util Script 2" is 7.2, but the first "Positional Arguments" is 7.2.1, the first "Named Arguments" is 7.2.2, and but so are the second "Positional Arguments" and "Named Arguments" sections (7.2.1, 7.2.2). Any idea how I can get around this?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant