Issue #324 resolved

Add image search pathes

Anonymous created an issue


we have three sphinx projects with a project structure which is very similar to the one mentioned here: .

Unless the author of the issue quoted above, a lot of our images are shared. Right now we just copy the images for each project to the respective "images" directories. This is getting a bit nasty if you have many images.

So we've added a folder called "common/images" which holds the shared images. However, all our current image references will have to be rewritten so they reference the images in that folder. Also, the images references will get long and can look like ../../../Common/images/myimage.png. If we move anything in the project tree those references will break just again.

Therefore I propose to add an "image_search_pathes" variable to sphinx's config file. If sphinx cannot find the image with its current search algorithm, it should try to find the image on one of the pathes given in image_search_pathes.

Adding image search pathes would make the changing the user's project structure less brittle and allows for easier sharing of images between projects.

Comments (4)

  1. Georg Brandl repo owner

    As of Sphinx 1.0, you can give "absolute" image references, as in /images/myimage.png, which is always relative to the project root. The references will therefore not break on moving the documents, and I think including the path name is not so much of a problem if the paths are kept short.

  2. Log in to comment