Having Sphinx copy to the install location images referenced only in raw commands not explicitly in rst?

560 Views Asked by At

I have some raw code in my rst that links to images in the images directory in my repository. But since Sphinx does not directly know about these images it does not copy them over to the Sphinx install directory so the resulting HTML (that contains the raw) cannot find them. The exact details are

mydirectory/images/image1.png mydirectory/images/image2.png mydirectory/mypage.rst

mypage.rst contains

..:image: images/image.png ..:raw: <img src="_images/image2.png"

Run Sphinx, it generates an install directory which contains

installdir/mypage.html and installdir/_images/image1.png

That is, it copies image/image1.png to installdir/_images/image1.png

Is there a way to tell Sphinx to also copy image/image1.png to installdir/_images/image1.png ? The reason I need Spinx to do the copy is that when run on ReadTheDocs ReadTheDocs works directly with conf.py and I cannot add external linux calls to copy the images/image2.png.

0

There are 0 best solutions below