我有一段文本想要放在第一个文字块中,但我也想将文档中超过 70 个字符的长行分成多行。有没有办法将文本分解为文字块,以便在我的编辑器中每行的长度保持在 70 个字符以下,但保留文档编译版本中的这些换行符?
对于 HTML 输出,您可以使用自定义 CSS,例如
.. class:: pre-wrap
::
This is a text with long lines that should wrap in the output if the browser window is nawrrow.
next line
使用CSS规则
.pre-wrap { white-space: pre-wrap; }
。
在Sphinx中,使用“rst-class”而不是“class”作为指令名称。 在 Docutils 0.20 中,“预换行规则”已经存在于默认 CSS 样式表中
minimal.css
。