0

I would like to add to my sphinx documentation a menu, "todo items", which should contain all the methods of my project containing some todo items, like this:

""":todo: Fonction à implémenter"""

I would like to display the name of the class, the name of the concerned method(s), the number of the line and its content.

I found something that could be relevant : http://www.pythondoc.com/sphinx/ext/autodoc.html#skipping-members, but it only filter methods, and does not seem to be linked to the required informations(line numbers and line contents).

Is there a way to achieve this? Do you know some useful links?

mzjn
  • 48,958
  • 13
  • 128
  • 248
lolveley
  • 1,659
  • 2
  • 18
  • 34

1 Answers1

0

Use the Sphinx extension sphinx.ext.todo.

Add it to your list of extensions and set todo_include_todos to True in your conf.py.

Then use the appropriate syntax for the todo directive in your docstrings, being careful to use proper indentation and whitespace.

Steve Piercy
  • 13,693
  • 1
  • 44
  • 57
  • hello, thank you for your answer, but it does not exactly solve my problem. Indeed, I would like sphinx to scan all my classes and to find all times I wrote #todo some_thing_to_do or something similar. What you proposed was to do is to write commentaries in RST file(If I well understood). any suggestion? Does it can be done? – lolveley Jul 10 '19 at 10:45
  • reStructuredText does not read inline comments, so `#todo some_thing_to_do` will not work. You must use its syntax as documented in the link provided to the `sphinx.ext.todo` extension. – Steve Piercy Jul 11 '19 at 11:37