-
Notifications
You must be signed in to change notification settings - Fork 46
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
non-functional :func: and :class: references with identical section name #246
Comments
Here's a minimal working example ... |
Upon further experimentation, it seems that completely deleting the following lines of code ... matlabdomain/sphinxcontrib/matlab.py Lines 261 to 267 in 481134f
... solves #243 and it solves this issue for the case where you have I think the only effect of this change is that it will always use the fully qualified name instead of the short name for the HTML anchor tags. Is there any other effect? And if so, wouldn't this be a good idea? |
For clarification, deleting the code in my previous comment is not the right solution. It causes lots of other issues. And nothing in #245 addresses it. So this issue is still awaiting a solution. |
Thanks for the update. I'll try to get time to look at the issue more in depth. However, time is limited at the moment. |
I have stumbled across a very strange bug with certain
:func:
and:class:
references not working. That is, references like ...... will display correctly, but will not render as a functioning link under certain circumstances ... which I think I have finally tracked down to something helpful. The following conditions must hold ...
mypackage+
)..
OR you must havematlab_short_links = True
... autofunction::
or.. autoclass::
.For me, the last two are always satisfied, since I use
matlab_short_links = True
and I document all of my functions/classes with an .rst stub file that looks something like ...That section title here is critical for my table of contents. It took me a long time to encounter this issue since almost all of my functions/classes are either (1) in a package, or (2) have an underscore in the name.
While I do not have a fix for this issue, I did notice that the conditional in ...
matlabdomain/sphinxcontrib/matlab.py
Line 280 in 481134f
... evaluates to
false
for a name without an underscore and totrue
for a name with an underscore, since the corresponding section name inself.state.document.ids
has dashes instead of underscores.I have a hunch that this may be related to #243, in which case my "fix" in #245 probably isn't the right one.
The text was updated successfully, but these errors were encountered: