python-sphinx - 如何在 Sphinx 中创建没有标题的盒装文本?

标签 python-sphinx restructuredtext

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

最佳答案

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

关于python-sphinx - 如何在 Sphinx 中创建没有标题的盒装文本?,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/61435028/

相关文章:

python - 将 Piwik 跟踪代码集成到托管在 readthedocs.io 上的 Sphinx 生成的文档中

emacs - 在 rst.el 中修改颜色

restructuredtext - 带有自定义文本的重组文本中的内部超链接

git - 使用 Sphinx 时是否应该提交environment.pickle?

terminal - 如何在 Sphinx 中显示终端/外壳代码片段?

python - 在 Sphinx 文档生成器中,我可以将整个包(递归地)添加到索引中吗?

python - 使用 NumPy 的向量化的文档字符串不匹配

makefile - 在使用 Makefile 调用 Sphinx 时,如何使用 SPHINXOPTS 触发 "only"指令?

python - 如何将 Google Analytics 添加到 reStructuredText?