ashley
ashley

Reputation: 1565

Preserving line breaks in Sphinx and example todolist

Trying to figure out how to add line breaks to the todo list in Sphinx.

Upvotes: 1

Views: 452

Answers (2)

Steve Piercy
Steve Piercy

Reputation: 15045

The replacement of |br| is not necessary. This example works and yields semantically correct HTML list items, instead of line breaks. If you are not satisfied with the visual display, then you should use custom CSS.

.. todo::

    - blah
    - blah
    - blah

Todo List Items

<p class="first admonition-title">Todo</p>
<ul class="last simple">
<li>blah</li>
<li>blah</li>
<li>blah</li>
</ul>

Upvotes: 0

ashley
ashley

Reputation: 1565

I was not able to find a good answer for this and ended up putting together a couple of different things that ended up working out.

Basically I was trying to put a todolist in my sphinx documentation. But the .. todolist:: was not printing and the .. todo:: was just coming out as a long line and without line breaks. So I added this to the bottom of my main index.rst file:

.. |br| raw:: html

   <br />

And then for my todo list I did this:

.. todo:: 

   - blah |br|
   - blah |br|
   - blah |br|

and in the process got a todo box that looks like this:

enter image description here

Hope this saves someone some time!

Upvotes: 1

Related Questions