mirror of
https://github.com/sphinx-doc/sphinx.git
synced 2026-09-03 20:52:55 -05:00
Merge pull request #2093 from Sgiath/napoleon-todo
#2092: Napoleon 'todo' directive
This commit is contained in:
@@ -51,6 +51,7 @@ Other contributors, listed alphabetically, are:
|
|||||||
* Stefan Seefeld -- toctree improvements
|
* Stefan Seefeld -- toctree improvements
|
||||||
* Shibukawa Yoshiki -- pluggable search API and Japanese search
|
* Shibukawa Yoshiki -- pluggable search API and Japanese search
|
||||||
* Antonio Valentino -- qthelp builder
|
* Antonio Valentino -- qthelp builder
|
||||||
|
* Filip Vavera -- napoleon todo directive
|
||||||
* Pauli Virtanen -- autodoc improvements, autosummary extension
|
* Pauli Virtanen -- autodoc improvements, autosummary extension
|
||||||
* Stefan van der Walt -- autosummary extension
|
* Stefan van der Walt -- autosummary extension
|
||||||
* Thomas Waldmann -- apidoc module fixes
|
* Thomas Waldmann -- apidoc module fixes
|
||||||
|
|||||||
@@ -7,6 +7,7 @@ Incompatible changes
|
|||||||
Features added
|
Features added
|
||||||
--------------
|
--------------
|
||||||
|
|
||||||
|
* #2092: add todo directive support in napoleon package
|
||||||
* #1962: when adding directives, roles or nodes from an extension, warn if such
|
* #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).
|
an element is already present (built-in or added by another extension).
|
||||||
* #1935: Make "numfig_format" overridable in latex_elements.
|
* #1935: Make "numfig_format" overridable in latex_elements.
|
||||||
|
|||||||
@@ -24,6 +24,10 @@ Attributes:
|
|||||||
one convention to document module level variables and be consistent
|
one convention to document module level variables and be consistent
|
||||||
with it.
|
with it.
|
||||||
|
|
||||||
|
Todo:
|
||||||
|
* For module TODOs
|
||||||
|
* You have to also use ``sphinx.ext.todo`` extension
|
||||||
|
|
||||||
.. _Google Python Style Guide:
|
.. _Google Python Style Guide:
|
||||||
http://google.github.io/styleguide/pyguide.html
|
http://google.github.io/styleguide/pyguide.html
|
||||||
|
|
||||||
|
|||||||
@@ -110,6 +110,7 @@ All of the following section headers are supported:
|
|||||||
* ``Raises``
|
* ``Raises``
|
||||||
* ``References``
|
* ``References``
|
||||||
* ``See Also``
|
* ``See Also``
|
||||||
|
* ``Todo``
|
||||||
* ``Warning``
|
* ``Warning``
|
||||||
* ``Warnings`` *(alias of Warning)*
|
* ``Warnings`` *(alias of Warning)*
|
||||||
* ``Warns``
|
* ``Warns``
|
||||||
|
|||||||
@@ -144,6 +144,7 @@ class GoogleDocstring(UnicodeMixin):
|
|||||||
'raises': self._parse_raises_section,
|
'raises': self._parse_raises_section,
|
||||||
'references': self._parse_references_section,
|
'references': self._parse_references_section,
|
||||||
'see also': self._parse_see_also_section,
|
'see also': self._parse_see_also_section,
|
||||||
|
'todo': self._parse_todo_section,
|
||||||
'warning': self._parse_warning_section,
|
'warning': self._parse_warning_section,
|
||||||
'warnings': self._parse_warning_section,
|
'warnings': self._parse_warning_section,
|
||||||
'warns': self._parse_warns_section,
|
'warns': self._parse_warns_section,
|
||||||
@@ -606,6 +607,10 @@ class GoogleDocstring(UnicodeMixin):
|
|||||||
lines = self._consume_to_next_section()
|
lines = self._consume_to_next_section()
|
||||||
return self._format_admonition('seealso', lines)
|
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):
|
def _parse_warning_section(self, section):
|
||||||
lines = self._consume_to_next_section()
|
lines = self._consume_to_next_section()
|
||||||
return self._format_admonition('warning', lines)
|
return self._format_admonition('warning', lines)
|
||||||
|
|||||||
Reference in New Issue
Block a user