如何强制结束 RST 文件中的一些警告

How to force end of some admonitions in a RST file

我在 reStructuredText 格式的文本中有一个注释,它将放置在列表的一个点及其子列表之间。问题是注释包含子列表。


这是文件的摘录:

3. Select build parameters on the `CI              
   <https://website.com/CI>`_ and run it on your
   remote  branch.
 
.. note::

   The text of the note.

   a. If the failure is not related to your changes, say so in the pull request
      comments.
   b. Then, make the appropriate fixes.

 4. Wait for comments or approval. If modifications are requested by the
    comments, consider implementing them.

当我编译它时,a.b. 被包含在 注释中。但我不想那样。有没有办法强制注释在 The text of the note. 之后结束?

这个答案是错误的。原因见评论。请参阅 以获得正确的答案。


大概是这样的:

3. Select build parameters on the `CI
   <https://website.com/CI>`_ and run it on your
   remote  branch.

.. note::

   The text of the note.

..

   a. If the failure is not related to your changes, say so in the pull request
      comments.
   b. Then, make the appropriate fixes.

4. Wait for comments or approval. If modifications are requested by the
comments, consider implementing them.

问题可能是缩进问题。

如果笔记与3.点相关,

否则,如果注释与子列表元素相关,则需要将注释再缩进一次。

3. Select build parameters on the `CI
   <https://website.com/CI>`_ and run it on your
   remote  branch.

   .. note::

      The text of the note.

   a. If the failure is not related to your changes, say so in the pull request
      comments.
   b. Then, make the appropriate fixes.

4. Wait for comments or approval. If modifications are requested by the
   comments, consider implementing them.

空格在 reStructuredText 中有意义。您需要适当缩进。同样对于嵌套列表,当嵌套级别更改时需要一个空行。

3.  Select build parameters on the `CI <https://website.com/CI>`_ and run it on your remote branch.

    .. note::

        The text of the note.

    a.  If the failure is not related to your changes, say so in the pull request comments.
    b.  Then, make the appropriate fixes.

4.  Wait for comments or approval. If modifications are requested by the comments, consider implementing them.

注意我缩进了4个空格并且没有在句子中使用换行符。文档不是代码,不需要包装。