Open rdzman opened 5 months ago
Here's a minimal working example ...
Upon further experimentation, it seems that completely deleting the following lines of code ...
... solves #243 and it solves this issue for the case where you have matlab_short_links = True
(the case that really matters to me), but not the case where the module name is .
(as in the case attached above).
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 ... https://github.com/sphinx-contrib/matlabdomain/blob/481134f80be0c84ba1a7c17347d3aefc7a82716d/sphinxcontrib/matlab.py#L280 ... 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.