Skip to content
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

inheritance_diagram should support linking via intersphinx #865

Closed
shimizukawa opened this issue Jan 3, 2015 · 2 comments · Fixed by #10614
Closed

inheritance_diagram should support linking via intersphinx #865

shimizukawa opened this issue Jan 3, 2015 · 2 comments · Fixed by #10614
Labels
extensions type:enhancement enhance or introduce a new feature

Comments

@shimizukawa
Copy link
Member

Currently, the inheritance_diagram extension sets navigation links for the nodes of classes in the current project, but not for classes that are resolvable through intersphinx. It would be nice if it did.


@shimizukawa shimizukawa added this to the some future version milestone Jan 3, 2015
@shimizukawa shimizukawa added type:enhancement enhance or introduce a new feature extensions labels Jan 3, 2015
@shimizukawa
Copy link
Member Author

From Christoph Reiter on 2014-04-12 22:13:31+00:00

I've investigated this a bit. The cause is that intersphinx creates nodes with a reftitle "(in Project v1.42)" but inheritance_diagram expected the retitle to be the target/class name.

#!python
# in intersphinx.missing_reference()
 newnode = nodes.reference('', '', internal=False, refuri=uri,
                   reftitle=_('(in %s v%s)') % (proj, version))

Not sure what the correct fix here is. I've worked around the problem in inheritance_diagram in the mean time by extracting the target name from the url and not from reftitle.

#!python

 # in inheritance_diagram.html_visit_inheritance_diagram()
    urls = {}
    for child in node:
        url = child.get('refuri') or '#' + child['refid']
        fullname = child.get('refid') or child['refuri'].rsplit('#', 1)[-1]
        urls[fullname] = url

@NMertsch
Copy link

NMertsch commented Mar 4, 2021

Hi, are there any updates on this? Your suggested code change still fixes this issue, thank you for that! Would be great to have this by default.

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
extensions type:enhancement enhance or introduce a new feature
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants