gpt4 book ai didi

python-sphinx - Sphinx 中普通文本的换行符

转载 作者:行者123 更新时间:2023-12-03 23:16:24 24 4
gpt4 key购买 nike

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

Some text.
* Heading
| The first topic.
| Another topic which is very verbose and spans multiple lines ad infinitum.
Topic continued......................................

我希望它呈现为:
Some text.
* Heading
The first topic.
Another topic which is very verbose and spans multiple lines ad infinitum....................
Topic continued.............

但是它在 Html 中是这样呈现的:
Some text.
* Heading| The first topic.| Another topic which is very verbose and spans multiple lines ad infinitum .................... Topic continued

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

元素之间的空行确实有效,但不能提供我想要的视觉效果。

我需要做什么?

最佳答案

分两步执行此操作。

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

Some text.

* Heading

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

Topic continued......................................

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

关于python-sphinx - Sphinx 中普通文本的换行符,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/50068904/

24 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com