【发布时间】:2018-07-09 11:16:02
【问题描述】:
我正在使用 sphinx 尝试从 .rst 文件创建 HTML 文档。我正在尝试创建一个包含编号列表 (1., 2., ...) 的文档,其中包含显示示例代码的嵌套子列表 (a., b, c., ...)。但是我在梳理语法以使嵌套子列表工作时遇到了麻烦。这是我尝试过的.rst 文件示例:
===========
Tester Page
===========
Below are some test paragraphs.
1. This is a paragraph detailing a higher level step, with 3 sub-steps.
a. This is a sub-bullet, with an example:
::
ls -l foo.txt
b. I can't get this line to not display as part of the code block! This is another sub-bullet, with an example:
::
git add bar.txt
2. This is step 2.
This is the end of the document.
上面给了我一个类似的结果(很难在 Markdown 中完全重现,但希望你明白):
测试页面
以下是一些测试段落。
这是一些文字。
一个。这是一个子项目符号,有一个例子:
ls -l foo.txt
b. This is another sub-bullet, with an example:
git add bar.txt
- 这是第 2 步。
文档到此结束。
我已经调整双冒号、空格和反引号至少一个小时了,但不知道如何让它正确格式化。也许 reStructuredText 只是不够通用,无法处理嵌入代码块的嵌套列表?
【问题讨论】:
标签: python-sphinx restructuredtext