-
Notifications
You must be signed in to change notification settings - Fork 22
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 #43
Comments
So the primary issue stems from the ID of the section being based on the section title: But those section titles are always the same: So I see a couple solutions:
|
Ah option 2 wouldn't work if we're just using the parent node information as you could technically have two |
I have a similar request: I would like to not have the headings One could have an option .. argparse::
:module: foo
:func: _bar_parser
:prog: bar
:noheaders: |
Yeah I thought I about adding something like that in my PR for fixing my need in #44. Or rather letting the user specify each header. Like That said, your request brings up a harder question to answer. At least it makes me scratch my head. What does a section without a title look like? See this code in my PR for what I mean: It's creating a section node then a title for that section. The docutils docs say that a section has a title: https://docutils.sourceforge.io/docs/ref/doctree.html#section. I'm not sure it is possible to have a section without a title. So then to make your request work you'd be talking about no sections at all...I suppose that might work. Might be some ugly if-statements, but could work. Sorry, just brainstorming. |
This is a rewrite of alex-rudakov#127 from the old project, but I've made it into a smaller reproducible example. The summary of the issue is that Named Arguments and Options sections in a single restructuredtext document (
or maybe a single sphinx project) that has a:numbered:
TOC tree will always use the section number from the last.. argparse::
directive.mkdir sample_proj cd sample_proj touch myproj.py touch index.rst touch utils.rst
myproj.py
index.rst
utils.rst
Then generate the docs with:
PYTHONPATH=. sphinx-build . build -C -D extensions=sphinxarg.ext
And open
built/utils.html
in a browser. You'll see something like:Notice how the "Named Arguments" sections have the same section number. They should be 1.1.1 and 1.2.1.
The text was updated successfully, but these errors were encountered: