【发布时间】:2020-04-26 02:15:14
【问题描述】:
Sphinx 中有几个指令可以创建一个带框的文本,例如 .. note:: 或 .. topic::,但它们都包含一个标题。是否可以创建没有标题的盒装文本?
【问题讨论】:
-
几种方法包括自定义 CSS
p.admonition-title {display: none;}或原始 HTML 指令。
标签: python-sphinx restructuredtext
Sphinx 中有几个指令可以创建一个带框的文本,例如 .. note:: 或 .. topic::,但它们都包含一个标题。是否可以创建没有标题的盒装文本?
【问题讨论】:
p.admonition-title {display: none;} 或原始 HTML 指令。
标签: python-sphinx restructuredtext
您可以使用Generic Admonition。
.. admonition:: \ \
You can use a `Generic Admonition`_
.. hint::
| Generic Admonition still requires a title, but an escaped whitespace can be used!
|
| This can be convenient, because the box uses a style consistent with other admonitions.
|
| And might spare you from having to fiddle with CSS while Rome burns :)
.. _Generic Admonition: https://docutils.sourceforge.io/docs/ref/rst/directives.html#generic-admonition
【讨论】: