-
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
can't link function short name if it matches module name #243
Comments
Thanks for the report. I'll try to look at it soon |
* Fix "can't link function short name if it matches module name" #243. * Fix issue with autolinking of functions or classes with same name as module.
Short update. I finally had time to work on the project this weekend. Today I started looking into why the links don't work as we expect. The culprit is matlabdomain/sphinxcontrib/matlab.py Line 718 in b081e7c
|
I started working on this in a branch: https://github.com/sphinx-contrib/matlabdomain/tree/try-fix-auto-linking. @rdzman do you have time to test this? I'll be away from a computer for 3 weeks in a few days, so it'll take a while before its out as a release. |
@joeced, is it possible the issue at #246 is getting conflated with this one? From what I understand, the presenting issue here was "fixed", probably incorrectly by #245. Unfortunately, I have very limited time for testing at the moment, but a quick try on some of my projects with the try-fix-auto-linking branch results in lots of new warnings, such as the following ...
or
I haven't noticed any changes in links created relative to the above warnings. However, I am seeing cases where there are functions that were not linked (I think due to #246), that are now being linked, but to the wrong target. E.g. |
Given a module named
foo
and a function within that module, also namedfoo
, withmatlab_short_links = True
, it is not possible to create a working link to the function. Both of the following result in a properly formatted, but not hyperlinked, name.With
matlab_short_links = False
both work just fine.Note: The behavior of the first one depends on whether you have an
.. automodule:: foo
anywhere or not. If so, it links to thefoo
module, if not, to thefoo.foo
function.I believe it should behave exactly the same way with
matlab_short_links = True
, right?There is an additional issue with
matlab_auto_link = "all"
that prevents it from recognizingfoo
as a function in this context and wrapping it with the:func:
role. (I think I have a fix for this part.)Finally, while I haven't tested it, I suspect that a class with the same name as the module probably has the same problem.
The text was updated successfully, but these errors were encountered: