Skip to content

Fixed path bug with links in SVG inheritance diagrams#10576

Closed
ayshih wants to merge 1 commit intosphinx-doc:5.0.xfrom
ayshih:svg_urls
Closed

Fixed path bug with links in SVG inheritance diagrams#10576
ayshih wants to merge 1 commit intosphinx-doc:5.0.xfrom
ayshih:svg_urls

Conversation

@ayshih
Copy link
Contributor

@ayshih ayshih commented Jun 18, 2022

Subject: Fixes links in SVG inheritance diagrams when those diagrams are in documents not at the base level

Feature or Bugfix

  • Bugfix

Purpose

Currently, links in SVG inheritance diagrams only work when the documents are at the base level. That's because the URIs supplied to the diagram are relative to the document (as is appropriate for PNG output), but the SVGs live in the /_images folder, so the URIs need to be relative to that location. There is a hard-coded '../' that gets prepended to the URIs, which fixes only base-level documents. Documents in sub-directories result in SVG links that have one or more extraneous '../' that break the links.

Detail

This PR fixes the URIs to be relative to the image directory prior to making the SVG inheritance diagrams.

Relates

Fixes #10570

@ayshih
Copy link
Contributor Author

ayshih commented Jun 19, 2022

Note that this PR fixes a bug in Sphinx that is unrelated to any use of third-party extensions (e.g., sphinx_automodapi).

Non-exhaustive list of issues that this PR closes: #3176, sunpy/sunpy#2097, astropy/astropy#4935, probabilistic-numerics/probnum#459

Related issues:

@ayshih
Copy link
Contributor Author

ayshih commented Sep 27, 2022

Closing this PR since #10614 is more encompassing

@ayshih ayshih closed this Sep 27, 2022
@github-actions github-actions bot locked as resolved and limited conversation to collaborators Oct 28, 2022
@AA-Turner AA-Turner added the extensions:graphviz The `sphinx.ext.graphviz` or `sphinx.ext.inheritance_diagram` extensions label Jan 29, 2025
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.

Labels

extensions:graphviz The `sphinx.ext.graphviz` or `sphinx.ext.inheritance_diagram` extensions

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants