Closed JoelPasvolsky closed 2 months ago
symbolic link to the image in the SDK's _images/
maybe? Another option would be "hosting" the image somewhere (even just in this issue) and linking it from the docs. Both ugly for sure.
Yes, I was looking at symbolic links and considering putting the image in the SDK with the normal path so it would only build there (and give an error for local builds)
Ah, we can also reference it with a URL like https://github.com/dwavesystems/dwave-optimization/blob/main/docs/_images/to_networkx_example.svg. Obviously makes updating a pain but :shrug:
I would avoid "hotlinking" to github. Symlink seems the way to go.
Perhaps there's a different syntax but directly using the URL creates a link that you have to open to see the image
You'd need to link to the raw image: https://raw.githubusercontent.com/dwavesystems/dwave-optimization/main/docs/_images/to_networkx_example.svg, but that's frowned upon.
Looks like it's actually enough to have the image itself under sdk _images for the absolute path (which is currently used in dwave-optimization) to work. I should have tried that first.
I suggest adding that image as part of this PR and making a PR in dwave-optimization to replace the current image with an image that gives the new location so in the future the right one is updated
replace the current image with an image that gives the new location so in the future the right one is updated
I don't understand what you mean by this
Local build of dwave-optimization:
SDK build:
I would prefer to keep the image locally and use a symbolic link in the SDK rather than have the local doc builds not work.
Also, keeping the image in this git history is preferable so we can make updates over time without needing to also change the SDK.
Okay, for some reason the first time I built that it failed with an error WARNING: cannot copy static file FileExistsError(17, 'File exists')
but after cleaning old generated files a second build works nicely.
This commit closes this issue.
The /_images/to_networkx_example.svg path here works for local builds but not for the SDK build, where it is translated to
dwave-ocean-sdk/docs/_build/html/docs_optimization/reference/generated/_images/to_networkx_example.svg
and not found.I've tried a few alternatives but so far haven't a good solution. Depending on when there's a new SDK release we might need to remove this or move it to the intro.