How do I create a new line with reStructuredText?

ぐ巨炮叔叔 提交于 2019-12-05 02:11:44

The line block syntax also worked, and was a bit cleaner:

| This is a line | This is another line | Another new line

According to the docs for docutils raw role, you can do this:

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.

You will need to define the raw role first:

.. role:: raw-html(raw)
    :format: html

As the example states, consider line block syntax first.

| 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.

We added a substitution to our global.rst file so we didn't have to add raw tags all the time.

.. |br| raw:: html

  <br/>

This way we can just use |br| when we need a line break.

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!