summaryrefslogtreecommitdiff
path: root/sphinx
diff options
context:
space:
mode:
authorRob Ruana <rob@relentlessidiot.com>2014-01-19 13:43:54 -0500
committerRob Ruana <rob@relentlessidiot.com>2014-01-19 13:43:54 -0500
commit77d5f2776cb262c7f3e6d85ea065ae06a25e606b (patch)
treeeae54c1f8a03bbbc9c185fbce130174893a646e1 /sphinx
parenta8b06aa17015396b9bd5accb5cca4644f69f307d (diff)
downloadsphinx-77d5f2776cb262c7f3e6d85ea065ae06a25e606b.tar.gz
Makes suggested changes before adding napoleon to sphinx
Diffstat (limited to 'sphinx')
-rw-r--r--sphinx/ext/napoleon/__init__.py220
1 files changed, 112 insertions, 108 deletions
diff --git a/sphinx/ext/napoleon/__init__.py b/sphinx/ext/napoleon/__init__.py
index 168ac574..d3b6f754 100644
--- a/sphinx/ext/napoleon/__init__.py
+++ b/sphinx/ext/napoleon/__init__.py
@@ -43,157 +43,161 @@ class Config(object):
.. _NumPy style:
https://github.com/numpy/numpy/blob/master/doc/HOWTO_DOCUMENT.rst.txt
+ Attributes
+ ----------
+ napoleon_google_docstring : bool, defaults to True
+ True to parse `Google style`_ docstrings. False to disable support
+ for Google style docstrings.
+ napoleon_numpy_docstring : bool, defaults to True
+ True to parse `NumPy style`_ docstrings. False to disable support
+ for NumPy style docstrings.
+ napoleon_include_private_with_doc : bool, defaults to False
+ True to include private members (like ``_membername``) with docstrings
+ in the documentation. False to fall back to Sphinx's default behavior.
+ **If True**::
- **napoleon_google_docstring** : bool, defaults to True
- True to parse `Google style`_ docstrings. False to disable support
- for Google style docstrings.
-
- **napoleon_numpy_docstring** : bool, defaults to True
- True to parse `NumPy style`_ docstrings. False to disable support
- for NumPy style docstrings.
-
- **napoleon_include_private_with_doc** : bool, defaults to False
- True to include private members (like ``_membername``) with docstrings
- in the documentation. False to fall back to Sphinx's default behavior.
-
- **If True**::
-
- def _included(self):
- \"\"\"
- This will be included in the docs because it has a docstring
- \"\"\"
- pass
+ def _included(self):
+ \"\"\"
+ This will be included in the docs because it has a docstring
+ \"\"\"
+ pass
- def _skipped(self):
- # This will NOT be included in the docs
- pass
+ def _skipped(self):
+ # This will NOT be included in the docs
+ pass
- **napoleon_include_special_with_doc** : bool, defaults to True
- True to include special members (like ``__membername__``) with
- docstrings in the documentation. False to fall back to Sphinx's
- default behavior.
+ napoleon_include_special_with_doc : bool, defaults to True
+ True to include special members (like ``__membername__``) with
+ docstrings in the documentation. False to fall back to Sphinx's
+ default behavior.
- **If True**::
+ **If True**::
- def __str__(self):
- \"\"\"
- This will be included in the docs because it has a docstring
- \"\"\"
- return unicode(self).encode('utf-8')
+ def __str__(self):
+ \"\"\"
+ This will be included in the docs because it has a docstring
+ \"\"\"
+ return unicode(self).encode('utf-8')
- def __unicode__(self):
- # This will NOT be included in the docs
- return unicode(self.__class__.__name__)
+ def __unicode__(self):
+ # This will NOT be included in the docs
+ return unicode(self.__class__.__name__)
- **napoleon_use_admonition_for_examples** : bool, defaults to False
- True to use the ``.. admonition::`` directive for the **Example** and
- **Examples** sections. False to use the ``.. rubric::`` directive
- instead. One may look better than the other depending on what HTML
- theme is used.
+ napoleon_use_admonition_for_examples : bool, defaults to False
+ True to use the ``.. admonition::`` directive for the **Example** and
+ **Examples** sections. False to use the ``.. rubric::`` directive
+ instead. One may look better than the other depending on what HTML
+ theme is used.
- This `NumPy style`_ snippet will be converted as follows::
+ This `NumPy style`_ snippet will be converted as follows::
- Example
- -------
- This is just a quick example
+ Example
+ -------
+ This is just a quick example
- **If True**::
+ **If True**::
- .. admonition:: Example
+ .. admonition:: Example
- This is just a quick example
+ This is just a quick example
- **If False**::
+ **If False**::
- .. rubric:: Example
+ .. rubric:: Example
- This is just a quick example
+ This is just a quick example
- **napoleon_use_admonition_for_notes** : bool, defaults to False
- True to use the ``.. admonition::`` directive for **Notes** sections.
- False to use the ``.. rubric::`` directive instead.
+ napoleon_use_admonition_for_notes : bool, defaults to False
+ True to use the ``.. admonition::`` directive for **Notes** sections.
+ False to use the ``.. rubric::`` directive instead.
- .. note:: The singular **Note** section will always be converted to a
- ``.. note::`` directive.
+ Note
+ ----
+ The singular **Note** section will always be converted to a
+ ``.. note::`` directive.
- .. seealso:: :attr:`napoleon_use_admonition_for_examples`
+ See Also
+ --------
+ :attr:`napoleon_use_admonition_for_examples`
- **napoleon_use_admonition_for_references** : bool, defaults to False
- True to use the ``.. admonition::`` directive for **References**
- sections. False to use the ``.. rubric::`` directive instead.
+ napoleon_use_admonition_for_references : bool, defaults to False
+ True to use the ``.. admonition::`` directive for **References**
+ sections. False to use the ``.. rubric::`` directive instead.
- .. seealso:: :attr:`napoleon_use_admonition_for_examples`
+ See Also
+ --------
+ :attr:`napoleon_use_admonition_for_examples`
- **napoleon_use_ivar** : bool, defaults to False
- True to use the ``:ivar:`` role for instance variables. False to use
- the ``.. attribute::`` directive instead.
+ napoleon_use_ivar : bool, defaults to False
+ True to use the ``:ivar:`` role for instance variables. False to use
+ the ``.. attribute::`` directive instead.
- This `NumPy style`_ snippet will be converted as follows::
+ This `NumPy style`_ snippet will be converted as follows::
- Attributes
- ----------
- attr1 : int
- Description of `attr1`
+ Attributes
+ ----------
+ attr1 : int
+ Description of `attr1`
- **If True**::
+ **If True**::
- :ivar attr1: Description of `attr1`
- :vartype attr1: int
+ :ivar attr1: Description of `attr1`
+ :vartype attr1: int
- **If False**::
+ **If False**::
- .. attribute:: attr1
- :annotation: int
+ .. attribute:: attr1
+ :annotation: int
- Description of `attr1`
+ Description of `attr1`
- **napoleon_use_param** : bool, defaults to False
- True to use a ``:param:`` role for each function parameter. False to
- use a single ``:parameters:`` role for all the parameters.
+ napoleon_use_param : bool, defaults to False
+ True to use a ``:param:`` role for each function parameter. False to
+ use a single ``:parameters:`` role for all the parameters.
- This `NumPy style`_ snippet will be converted as follows::
+ This `NumPy style`_ snippet will be converted as follows::
- Parameters
- ----------
- arg1 : str
- Description of `arg1`
- arg2 : int, optional
- Description of `arg2`, defaults to 0
+ Parameters
+ ----------
+ arg1 : str
+ Description of `arg1`
+ arg2 : int, optional
+ Description of `arg2`, defaults to 0
- **If True**::
+ **If True**::
- :param arg1: Description of `arg1`
- :type arg1: str
- :param arg2: Description of `arg2`, defaults to 0
- :type arg2: int, optional
+ :param arg1: Description of `arg1`
+ :type arg1: str
+ :param arg2: Description of `arg2`, defaults to 0
+ :type arg2: int, optional
- **If False**::
+ **If False**::
- :parameters: * **arg1** (*str*) --
- Description of `arg1`
- * **arg2** (*int, optional*) --
- Description of `arg2`, defaults to 0
+ :parameters: * **arg1** (*str*) --
+ Description of `arg1`
+ * **arg2** (*int, optional*) --
+ Description of `arg2`, defaults to 0
- **napoleon_use_rtype** : bool, defaults to False
- True to use the ``:rtype:`` role for the return type. False to output
- the return type inline with the description.
+ napoleon_use_rtype : bool, defaults to False
+ True to use the ``:rtype:`` role for the return type. False to output
+ the return type inline with the description.
- This `NumPy style`_ snippet will be converted as follows::
+ This `NumPy style`_ snippet will be converted as follows::
- Returns
- -------
- bool
- True if successful, False otherwise
+ Returns
+ -------
+ bool
+ True if successful, False otherwise
- **If True**::
+ **If True**::
- :returns: True if successful, False otherwise
- :rtype: bool
+ :returns: True if successful, False otherwise
+ :rtype: bool
- **If False**::
+ **If False**::
- :returns: *bool* -- True if successful, False otherwise
+ :returns: *bool* -- True if successful, False otherwise
"""
_config_values = {