如何在sphinx中呈现readme.md,其中包含一些图像的相对路径

2024-10-01 13:40:29 发布

您现在位置:Python中文网/ 问答频道 /正文

我正在使用m2r2使用sphinx呈现html文档。 我的文件夹结构是

project
  |_ docs
      |_ sphinx root
  |_ README.md
  |_ image_to_include_in_readme.png

README.md看起来像这样:

# This is heading

Some text. refer to the image : [Image](image_to_include_in_readme.png)

但此图像无法从sphinx根文件夹读取

我能够在html中使用mdinclude指令正确地呈现readme.md,但图像不会呈现。我得到了 WARNING: image file not readable:
我知道我可以将图像复制到构建文件夹中,但我不想这样做。我怎么修理它


Tags: toin文档图像image文件夹includepng