Sphinx 中普通文本的换行符

Jon*_*han 5 python-sphinx

我的 .rst 文件中有以下文本:

Some text.
* Heading
  | The first topic.
  | Another topic which is very verbose and spans multiple lines ad infinitum.
  Topic continued......................................
Run Code Online (Sandbox Code Playgroud)

我希望它呈现为:

Some text.
* Heading
  The first topic.
  Another topic which is very verbose and spans multiple lines ad infinitum....................
  Topic continued.............
Run Code Online (Sandbox Code Playgroud)

然而,它在 Html 中呈现如下:

Some text.
* Heading| The first topic.| Another topic which is very verbose and spans multiple lines ad infinitum .................... Topic continued
Run Code Online (Sandbox Code Playgroud)

Sphinx 文档建议使用该|符号来表示换行符,就像 Stackoverflow 上的几篇文章一样,但我一直无法让它工作。我想要一种独立于所使用的 Sphinx 构建器的方法。

元素之间的空白线确实有效,但没有给出我想要的视觉效果。

我需要做什么?

Ste*_*rcy 3

分两步执行此操作。

首先让您的 reStructuredText 使用正确的空格来生成可用的 HTML 结构,并应用默认的视觉样式。

Some text.

* Heading

  | The first topic.
  | Another topic which is very verbose and spans multiple lines ad infinitum.

  Topic continued......................................
Run Code Online (Sandbox Code Playgroud)

其次覆盖默认样式表以生成所需的视觉效果,如这篇 SO 文章中所述,How do I set up custom styles for reStructuredText, Sphinx, ReadTheDocs, etc.