python sphinx - Docutils nested bullet lists termination - Stack Overflow

admin2025-04-19  0

I have a problem with Sphinx/Docutils not recognizing the end of a nested list of bullet points. Code follows. It has been extracted from a much larger document:

.. rst-class:: level4 level

Editor
------

* Gedit from Gnome
------------------

* I have tried Visual Studio Code but have found it unusable for two reasons:

  * It constantly pops up dialogs that are supposed to help you but which
    obscure the work that you are editing.
  * The settings are difficult to use.


.. rst-class:: level2 level

*********
Prompt 18
*********

As you can see, there are two blank lines at the end of the nested list but Sphinx/Docutils does not recognize them, seemingly because this is also the end of a section. I have verified that the blank lines have no blanks within them. Any suggestions on how to make this work?

I have a problem with Sphinx/Docutils not recognizing the end of a nested list of bullet points. Code follows. It has been extracted from a much larger document:

.. rst-class:: level4 level

Editor
------

* Gedit from Gnome
------------------

* I have tried Visual Studio Code but have found it unusable for two reasons:

  * It constantly pops up dialogs that are supposed to help you but which
    obscure the work that you are editing.
  * The settings are difficult to use.


.. rst-class:: level2 level

*********
Prompt 18
*********

As you can see, there are two blank lines at the end of the nested list but Sphinx/Docutils does not recognize them, seemingly because this is also the end of a section. I have verified that the blank lines have no blanks within them. Any suggestions on how to make this work?

Share edited Mar 11 at 20:31 G. Milde 1,0185 silver badges20 bronze badges asked Mar 5 at 18:36 JonathanJonathan 2,8875 gold badges33 silver badges53 bronze badges
Add a comment  | 

2 Answers 2

Reset to default 3

A section heading may not start with * or -, as those are reserved for lists.

Try this.

Gedit from Gnome
----------------

When I try the provided example, the error message points to line 7, so this is no problem with the nested bullet list starting in line 11. Instead, it is the bullet list started by the leading "*" in line 6 and ended by a transition in line 7.

One solution is alread given by Steve Piercy's answer.

Alternatively, remove line 7 and make "Gedit" the first point of the bullet list of editors.

To get two bullet lists of editors separated by a transition, insert a blank line before the transition in line 7.

If you want a heading (or paragraph or any other element) start with a "bullet point" (* or -) character, you need to escape it:

\* Gedit from Gnome
-------------------
转载请注明原文地址:http://conceptsofalgorithm.com/Algorithm/1745014422a280003.html

最新回复(0)