Add image search pathes

Anonymous avatarAnonymous 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 (3)

  1. Georg Brandl

    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
Tip: Filter by directory path e.g. /media app.js to search for public/media/app.js.
Tip: Use camelCasing e.g. ProjME to search for
Tip: Filter by extension type e.g. /repo .js to search for all .js files in the /repo directory.
Tip: Separate your search with spaces e.g. /ssh pom.xml to search for src/ssh/pom.xml.
Tip: Use ↑ and ↓ arrow keys to navigate and return to view the file.
Tip: You can also navigate files with Ctrl+j (next) and Ctrl+k (previous) and view the file with Ctrl+o.
Tip: You can also navigate files with Alt+j (next) and Alt+k (previous) and view the file with Alt+o.