如何覆盖Seealso :: Directive in Sphinx中的指示?

发布于 2025-02-09 00:37:20 字数 133 浏览 0 评论 0原文

我正在项目中使用sphinx,我想更改'另请参阅标题 seealso ::在模板中的框。 我还在代码中搜索了一点,并在狮身人面表库中看到了Seealso类,但我不知道如何覆盖它并更改标题。

I'm using Sphinx in a project and I wanna change 'See also' title in top of the seealso::'s box in the template.
I also searched a little in the codes and saw the SeeAlso class in the Sphinx library but I have no idea how to override it and change the title.

如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

扫码二维码加入Web技术交流群

发布评论

需要 登录 才能够评论, 你可以免费 注册 一个本站的账号。

评论(1

奈何桥上唱咆哮 2025-02-16 00:37:20

好吧,我终于找到了一种我认为是简单的方法!

我的问题是能够更改seealso ::

in locale fold (phinx/locale/locale/__ init __ init __. py)等seealso ::(例如seealso ::)的标题,有一个名为consonitionlabels code>代码>,标题是在此处定义的。

要在项目中更改它,我们只需在项目的config.py中添加此代码:

from sphinx import locale
locale.admonitionlabels['seealso'] = 'new title'

当我们使用

Well, I finally found a way that I think is the simple one!

My question was to be able to change the title of sphinx specific admonitions like seealso::

In the locale folder (sphinx/locale/__init__.py) , there is a dictionary named admonitionlabels, that the titles are defined here.

To change it in the project, we just add this code in the project's config.py:

from sphinx import locale
locale.admonitionlabels['seealso'] = 'new title'

and when we use make html sphinx will apply our new title to the project

~没有更多了~
我们使用 Cookies 和其他技术来定制您的体验包括您的登录状态等。通过阅读我们的 隐私政策 了解更多相关信息。 单击 接受 或继续使用网站,即表示您同意使用 Cookies 和您的相关数据。
原文