-
-
Notifications
You must be signed in to change notification settings - Fork 7
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
Inferred type of function parameters not correctly generating <a> tag #23
Comments
Is |
Yes it is, I can manually type the link with Here is my actual live documentation where you can see this occurring. All the classes experiencing this do have their own direct link. https://jonxslays.github.io/wom.py/v0.4.1/reference/services/ Note the I went ahead and uploaded the minimal example and |
OK thanks I was able to identify the issue. The issue is (at least in the reproduction repository you provided) that you import secondary with The link to But for To fix this, use the "new kind of absolute" imports, i.e. always use % python3.7
Python 3.7.15 (default, Nov 5 2022, 23:33:40)
[GCC 12.2.0] on linux
Type "help", "copyright", "credits" or "license" for more information.
>>> from modules import main
Traceback (most recent call last):
File "<stdin>", line 1, in <module>
File "/media/data/dev/mkdocs-bug-test/modules/main.py", line 1, in <module>
import secondary
ModuleNotFoundError: No module named 'secondary' |
Alternatively, if your |
Let me lead with a huge thanks for helping me troubleshoot this issue, and your contributions to open source. Good catch that I used an incorrect import pattern in the repro example. I never actually ran that code just used it to generate docs. In my actual repository i do use the I just tried this pattern you described of specifying This does fix the link for the Is there a way to get the best of both worlds? Whats odd is that in my previous release both links just worked using the pattern I had before. I didn't change anything and it broke out of nowhere. This is my actual repository: https://github.com/Jonxslays/wom.py If you compare docs v0.4.1 with v0.4.0 you'll see the difference I'm describing. |
I've updated your mkdocs-bug-test repo locally and it works fine on my side. Both # main
::: main # secondary
::: secondary rm modules/__init__.py plugins:
- search
- autorefs
- include-markdown
- mkdocstrings:
handlers:
python:
paths: [modules]
options:
members_order: alphabetical
docstring_style: google
show_signature_annotations: true
separate_signature: true |
I'll check what happens in your Wise Old Man project now 🙂 |
Found the issue as well. This is a regression in Griffe, the static analysis tool. Will fix and push a release today 🙂 |
0.28.2 is out, closing! |
Thanks again for all your help! Everythings looking good with 0.28.2. |
You're welcome, thank you for making the investigation easy by providing all the necessary info! |
I've been using mkdocstrings[python] and mkdocs-material with autorefs for my documentation but in my most recent deployment inferred types of parameters to functions are no longer linking correctly.
Upon examination of the outputted html from
mkdocs build
the class name is a <span> instead of an <a> tag.Does anyone have any ideas as to the issue here?
Here is a minimal example of the way the code and docstrings look:
And the resulting docs:
Previously both
secondary
andSecondary
would link to the respective module and class, but only the module does now.My mkdocs config file looks like:
The text was updated successfully, but these errors were encountered: