尝试添加自定义字体到Sphinx-RTD-theme



我正在记录我的python库。我想添加自定义图标。我看到我可以添加字体很棒的图标。然而,我一定不是很好谷歌或…

是否可以添加自定义图标到Sphinx(-rtd-theme)?如果有,有没有例子?我找不到。谢谢你。

我发现最接近的是sphinx-design包,然后使用带有{div}指令(Myst)的avatar类。例如:

:::{div}
<img src="images/whale_trace.png" class="sd-avatar-md sd-border-1">
:::

注意:我使用。md而不是。rst。因此,我使用Myst解析器。为了复制图像并使用正确的路径,需要修改conf.py文件:

myst_enable_extensions = ["colon_fence", "html_image"]

添加html_image将所有图像的分辨率。参见Myst文档:


> Blockquote
HTML parsing to the rescue!
By adding "html_image" to myst_enable_extensions (in the sphinx conf.py configuration file), MySt-Parser will attempt to convert any isolated img tags (i.e. not wrapped in any other HTML) to the internal representation used in sphinx.

_

最新更新