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

标签 python-sphinx

我对使用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/

相关文章:

python - 如何告诉 sphinx 源代码在此路径中并在该路径中构建

python-sphinx - Sphinx local 和 readthedocs.org 之间的区别

python - Rinohtype Sphinx 重组文本 : Fixed Width Tables

python-sphinx - 在Sphinx中的引用内保留内联代码

python - 如何在sphinx中为python创建调用者图?

python - sphinx_rtd_theme 从 1.4.0 版本开始不再是硬依赖

latex - 在 Sphinx 中,如何在生成 LaTeX PDF 时隐藏节号?

python-sphinx - 如何配置用于 :menuselection:? 的分隔符

python-sphinx - 如何使用 ReStructured Text 和 .. raw::html 更改字体?

python-sphinx - 对齐图标题 Sphinx 中的图例文本