python-sphinx - Sphinx中普通文本中的换行符
问题描述
我在 .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......................................
第二次覆盖默认样式表以生成所需的视觉效果,如本文所述,如何为 reStructuredText、Sphinx、ReadTheDocs 等设置自定义样式?.
推荐阅读
- node.js - Mongoose 查找与输入子串匹配的所有文档
- flex-lexer - 无法识别 yylex() 产生的错误
- batch-file - 如何批量只替换一个字符串实例
- java - 尽管已经提交了解决方案,但我无法解决 ArrayIndexOutOfBoundsException
- html - CSS 的 Flex 属性在 WebChat 中隐藏滚动条
- email - 使用 OAuth2 不记名令牌获取 Google 电子邮件地址,无需弃用 Google+ API
- python - 有没有办法查看 Pytorch 中的培训课程出了什么问题?
- php - 避免对多对多对象关系的循环引用
- java - JavaFX:切换场景时列表清除值
- javascript - 如何计算总数?