gpt4 book ai didi

python-sphinx - 我们如何在 sphinx 文档中嵌入图像?

转载 作者:行者123 更新时间:2023-12-03 07:38:21 25 4
gpt4 key购买 nike

我对使用sphinx还很陌生,第一次为python项目做文档。例如,如何在 sphinx 文档中嵌入图像?

最佳答案

来自documenation :

There are two image directives: image and figure.

An image is a simple picture.

A figure consists of image data (including image options), an optional caption (a single paragraph), and an optional legend (arbitrary body elements). For page-based output media, figures might float to a different position if this helps the page layout.

图像用法示例:

.. image:: picture.jpg
:width: 200px
:height: 100px
:scale: 50 %
:alt: alternate text
:align: right

figure 用法示例:

.. figure:: picture.png
:scale: 50 %
:alt: map to buried treasure

This is the caption of the figure (a simple paragraph).

关于python-sphinx - 我们如何在 sphinx 文档中嵌入图像?,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/25866102/

25 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com