如何在Sphinx中创建不带标题的框式文本?

问题描述 投票:0回答:1

Sphinx中有多个指令可以创建框式文本,例如.. note::.. topic::,但它们都包含标题。是否可以创建没有标题的框式文本?

python-sphinx restructuredtext
1个回答
0
投票

您可以使用Generic Admonition

enter image description here

.. admonition:: \ \ 

   You can use a `Generic Admonition`_

.. hint::
   | Generic Admonition still requires a title, but an escaped whitespace can be used!
   | 
   | This has the convenience, of the box using a theme style consistent with other admonitions.

.. _Generic Admonition: https://docutils.sourceforge.io/docs/ref/rst/directives.html#generic-admonition
© www.soinside.com 2019 - 2024. All rights reserved.