Skip to content
This repository has been archived by the owner on Nov 17, 2022. It is now read-only.

Image link in markdown with relative link not working with sphinx #50

Open
KenanHArik opened this issue Dec 3, 2019 · 1 comment
Open

Comments

@KenanHArik
Copy link

I have markdown files that reference png images in a separate folder. When viewing / editing those markdown files, all works fine having a relative image link.

However, when the file is converted using sphinx, the only way I can get sphinx to find the images is by changing the paths relative to where sphinx.

For instance, my original markdown file has

![](assets/2019-10-23-13-49-56.png)

In order for the sphinx conversion process to recognize it, I have to change it to

![](../../Gitlab/assets/2019-10-23-13-49-56.png)

The updated location now references from the sphinx execution point, rather than from the markdown file. But doing in doing so, I can allow Sphinx to find the link. Otherwise, I get a warning from Sphinx in the first link above that it cannot find the file:

WARNING: image file not readable: ./assets/2019-10-23-13-49-56.png

Is there a way for image links to comprehend the shift in relative paths, based on the root location of the markdown file that is being processed from?

@KenanHArik
Copy link
Author

Just realized, to add to this: Even though sphinx finds it, and it will display with HTML, the links from the HTML are broken. To reference open issue #20 , I believe it mentions similar problem. That is to say that Sphinx compiles this to include wrongfully adds /Gitlab/assets/2019-10-23-13-49-56.png in the HTML link path as a result of this current workaround.

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant