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

Fix relative references in SVGs generated by sphinx.ext.graphviz #11078

Merged
merged 8 commits into from
Jul 28, 2023

Conversation

Panaetius
Copy link
Contributor

closes #11077

@grahamwaters
Copy link

@Panaetius
Copy link
Contributor Author

Panaetius commented Jan 23, 2023

could this help? https://github.com/grahamwaters/ReferenceMedic

I don't think it does. It doesn't support svg files at the moment. And it seems to just fix paths for a very specific folder layout, whereas in this case we know exactly from which source document to which target folder relative reference need to be changed in sphinx, and what type of attributes can be affected, so searching svg (XML) with a regex sounds like a bad idea when we can instead specifically look for e.g. href attributes to update and not accidentally update something that's not relevant. Especially since ONLY links/references need to be updated, paths in plain text do no need to be changed.
Also that library only deals with file paths, but we need to fix URLs in general (Like #my-anchor needs to be changed to ../mydoc/subdoc/#my-anchor). The targets can be anywhere in the file structure, essentially, depending on where the source *.rst file was, not in a fixed directory structure.

@AA-Turner AA-Turner added this to the some future version milestone Apr 29, 2023
@AA-Turner AA-Turner changed the title Fix relative references in graphviz svg Fix relative references in SVGs generated by sphinx.ext.graphviz Jul 28, 2023
@AA-Turner AA-Turner merged commit 6178163 into sphinx-doc:master Jul 28, 2023
@AA-Turner
Copy link
Member

Thanks @Panaetius!

A

@AA-Turner AA-Turner modified the milestones: some future version, 7.2.0 Aug 11, 2023
@github-actions github-actions bot locked as resolved and limited conversation to collaborators Sep 11, 2023
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Relative references in graphviz svgs have the wrong root
4 participants