更新时间:2023-10-31 20:53:16
这取决于您使用哪种工具来处理文档字符串.查看工具的文档以了解如何嵌入图像.
That depends on what tool you use for processing your docstring. Check your tool's documentation to find out how to embed images.
例如,如果您使用的是Sphinx,则可以使用 image
指令,如此说明中所述***答案:
For example, if you are using Sphinx, you can use the image
directive, as described in this *** answer:
.. image:: example.png
关于图片的位置,文档状态:
Regarding the location of the image, the documentation states:
在Sphinx中使用时,给定的文件名必须相对于源文件,或者是绝对的,这意味着它们相对于***源目录.例如,文件sketch/spam.rst可以将图像images/spam.png称为../images/spam.png或/images/spam.png.
When used within Sphinx, the file name given [...] must either be relative to the source file, or absolute which means that they are relative to the top source directory. For example, the file sketch/spam.rst could refer to the image images/spam.png as ../images/spam.png or /images/spam.png.