如何在第一时间强制换行/换行?我不希望它是一个新段落(即行之间没有其他空格),我只是希望文本以新行开头。谢谢!
答案 0 :(得分:9)
根据docutils raw
role的文档,您可以执行以下操作:
If there just *has* to be a line break here,
:raw-html:`<br />`
it can be accomplished with a "raw"-derived role.
But the line block syntax should be considered first.
您需要首先定义raw
角色:
.. role:: raw-html(raw)
:format: html
如示例所示,请首先考虑line block syntax。
| Lend us a couple of bob till Thursday.
| I'm absolutely skint.
| But I'm expecting a postal order and I can pay you back
as soon as it comes.
| Love, Ewan.
答案 1 :(得分:8)
line block syntax也可以工作,并且更干净:
| This is a line
| This is another line
| Another new line
答案 2 :(得分:3)
我们在global.rst文件中添加了替换项,因此我们不必一直添加原始标签。
.. |br| raw:: html
<br/>
这样,我们可以只使用| br |当我们需要换行时。