0

I'm trying to make lists in Sphinx. However, they end up broken like so here: where the input code is: broken list

#. Set the :guilabel:`Output extent [optional] to
   :menuselection:`... --> Calculate from Layer --> Reprojected`
#. for :guilabel:`Cellsize` enter :file:`1970`

However, on other occasions it just works normally. Just to be sure:

This is unrelated text that needs a full line after

#. Then now we start a numbered list
#. If you have a line that is really long and
   needs to be split over different lines, you
   can do that by indenting
#. You can also have different paragraphs

   like this inside a list. Be aware that it should be 
   indented and there should be a whitespace after

#. Then this item will render correctly

An unindented paragraph will re-set the list

#. this item starts at 1 again

It seems really random to me. Maybe something with the type of line ending (CRLF/LF) number of spaces in indents?

mzjn
  • 48,958
  • 13
  • 128
  • 248
Fee
  • 177
  • 1
  • 3

1 Answers1

0

It turns out to be the number of spaces. Very confusingly, this is also different for a numbered (3: #. /1. ) or bullet (2:* ) list. For example this is correct:

This is unrelated text that needs a full line after

#. Then now we start a numbered list
#. If you have a line that is really long and
   needs to be split over different lines, you
   can do that by indenting
#. You can also have different paragraphs

   like this inside a list. Be aware that it should be 
   indented and there should be a whitespace after

   * You need whitespace for a bulletlist
   * and then if you have a really long item, that
     is split along multiple lines, make sure that in 
     this case you have 2 (two) spaces

   #. But, then again if you would have a numbered list
      that is split over multiple lines, you need to enter
      3 (three) spaces.
   #. and it continues to the next point
   #. but this is confusing
   #. also logical in another way

#. Then this item will render correctly

an unindented parargaph in between will terminate the list

This finally renders correctly:

success!

Fee
  • 177
  • 1
  • 3
  • Bonus tip, just use 4 spaces for all indentation. See https://stackoverflow.com/a/48313531/2214933 – Steve Piercy Oct 28 '21 at 05:29
  • @StevePiercy I was working on documentation that was already using the 3-space (2-space) indentation, so then 4-space indentation started doing weird things like above. Correcting from 4-space to 3-space solved this. For future projects I will consider! – Fee Oct 28 '21 at 09:00