Merge pull request #2093 from Sgiath/napoleon-todo

#2092: Napoleon 'todo' directive
This commit is contained in:
Rob Ruana
2015-11-12 14:02:48 -08:00
5 changed files with 12 additions and 0 deletions

View File

@@ -51,6 +51,7 @@ Other contributors, listed alphabetically, are:
* Stefan Seefeld -- toctree improvements
* Shibukawa Yoshiki -- pluggable search API and Japanese search
* Antonio Valentino -- qthelp builder
* Filip Vavera -- napoleon todo directive
* Pauli Virtanen -- autodoc improvements, autosummary extension
* Stefan van der Walt -- autosummary extension
* Thomas Waldmann -- apidoc module fixes

View File

@@ -7,6 +7,7 @@ Incompatible changes
Features added
--------------
* #2092: add todo directive support in napoleon package
* #1962: when adding directives, roles or nodes from an extension, warn if such
an element is already present (built-in or added by another extension).
* #1935: Make "numfig_format" overridable in latex_elements.

View File

@@ -24,6 +24,10 @@ Attributes:
one convention to document module level variables and be consistent
with it.
Todo:
* For module TODOs
* You have to also use ``sphinx.ext.todo`` extension
.. _Google Python Style Guide:
http://google.github.io/styleguide/pyguide.html

View File

@@ -110,6 +110,7 @@ All of the following section headers are supported:
* ``Raises``
* ``References``
* ``See Also``
* ``Todo``
* ``Warning``
* ``Warnings`` *(alias of Warning)*
* ``Warns``

View File

@@ -144,6 +144,7 @@ class GoogleDocstring(UnicodeMixin):
'raises': self._parse_raises_section,
'references': self._parse_references_section,
'see also': self._parse_see_also_section,
'todo': self._parse_todo_section,
'warning': self._parse_warning_section,
'warnings': self._parse_warning_section,
'warns': self._parse_warns_section,
@@ -606,6 +607,10 @@ class GoogleDocstring(UnicodeMixin):
lines = self._consume_to_next_section()
return self._format_admonition('seealso', lines)
def _parse_todo_section(self, section):
lines = self._consume_to_next_section()
return self._format_admonition('todo', lines)
def _parse_warning_section(self, section):
lines = self._consume_to_next_section()
return self._format_admonition('warning', lines)