【问题标题】:How to create boxed text without title in Sphinx?如何在 Sphinx 中创建没有标题的盒装文本?
【发布时间】:2020-04-26 02:15:14
【问题描述】:

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

【问题讨论】:

  • 几种方法包括自定义 CSS p.admonition-title {display: none;} 或原始 HTML 指令。

标签: python-sphinx restructuredtext


【解决方案1】:

您可以使用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

【讨论】:

  • 谢谢,但这仍然不是我想要的。我已经拒绝使用 rst 来编写支持 markdown + raw html 的文档。
猜你喜欢
  • 1970-01-01
  • 1970-01-01
  • 2021-12-26
  • 2023-03-31
  • 2021-09-27
  • 1970-01-01
  • 1970-01-01
  • 2018-08-07
  • 1970-01-01
相关资源
最近更新 更多