Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Sphinx todo box not showing

In sphinx, I can not make the todo list show. Here is what I have:

.. todo:: blah blah blah

conf.py

extensions = [
    'sphinx.ext.autodoc',
    'sphinx.ext.todo',
]

I tried sphinx.ext.todo=True in conf.py, but then I get syntax errors when I make html.

like image 202
dman Avatar asked Mar 10 '14 01:03

dman


1 Answers

Based on this documentation you have to set the todo_include_todos in the configuration.

http://sphinx-doc.org/ext/todo.html#confval-todo_include_todos

If you get syntax errors maybe try (as in the note example linked to from the docs above):

.. todo::

    blah
    blah

Edit:

It doesn't look the same as in that site because that site has applied customed CSS to get that. I looked at the sphinx source code and the "Pyramid" theme is the only theme that mentions the TODO styles, but you can obviously see that the site you mentioned uses the default theme. That site has it's own CSS file. You should be able to add your own CSS file to your "doc/source/_static" directory and add something like this to your conf.py to include it:

def setup(app):
    app.add_stylesheet('my_styles.css')

Specifically notice the section of their CSS file for div.admonition-todo:

div.admonition-todo {
border-top: 2px solid red;
border-bottom: 2px solid red;
border-left: 2px solid red;
border-right: 2px solid red;
background-color: #ff6347
}
like image 167
djhoese Avatar answered Sep 27 '22 22:09

djhoese