【问题标题】:How to create custom admonitions in custom directive sphinx?如何在自定义指令 sphinx 中创建自定义警告?
【发布时间】:2019-07-06 08:54:31
【问题描述】:

我在 Sphinx 中创建了一个自定义指令“限制”,其中提到了某个产品的“限制”。我希望将限制写在一个类似于“note”或“warning”指令的彩色框中,其中“limitation”作为标题而不是“note”或“warning”。我希望这由我的自定义指令“限制”本身来处理。

有什么办法吗?

【问题讨论】:

标签: python-sphinx custom-directive


【解决方案1】:

您可以直接从 Docutils 使用 admonition:

 .. admonition:: Limitation

    Description of the limitations ...

查看http://docutils.sourceforge.net/docs/ref/rst/directives.html了解更多信息。

【讨论】:

    猜你喜欢
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 2014-03-16
    • 1970-01-01
    • 1970-01-01
    • 2019-02-19
    • 1970-01-01
    相关资源
    最近更新 更多