如何使用 Sphinx 创建 (#) 样式的编号列表

And*_*ier 7 restructuredtext python-sphinx

Sphinx 引用的 RST 文档为“权威的 reStructuredText 用户文档”(请参见此处),显示了编号列表格式的几种样式,其中包括括号样式(请参见此处):

(1) foo
(2) bla
Run Code Online (Sandbox Code Playgroud)

然而,Sphinx 会从这样的 RST 源生成带有点的样式:

1. foo
2. bla
Run Code Online (Sandbox Code Playgroud)

Sphinx 文档仅显示点线样式(请参阅此处)。

我的问题是:有什么方法可以让 Sphinx 创建数字的括号样式吗?

Ant*_*llo 7

* This is a bulleted list.
* It has two items, the second
  item uses two lines.

1. This is a numbered list.
2. It has two items too.

#. This is a numbered list.
#. It has two items too.
Run Code Online (Sandbox Code Playgroud)

请参阅Sphinx 文档站点中的reStructuredText Primer 。

  • 问题是如何生成一个编号列表,其中每个列表项的编号都带有括号。这个答案没有显示如何做到这一点。 (5认同)
  • 好点子。我应该更仔细地阅读。根据http://docutils.sourceforge.net/FAQ.html#why-do-enumerated-lists-only-use-numbers-no-letters-or-roman-numerals,输出样式由样式表处理。这需要添加自定义样式表。请参阅 https://docs.readthedocs.io/en/stable/guides/adding-custom-css.html。 (2认同)