{ "info": { "author": "", "author_email": "", "bugtrack_url": null, "classifiers": [ "Development Status :: 5 - Production/Stable", "Environment :: Console", "Environment :: Web Environment", "Framework :: Sphinx", "Framework :: Sphinx :: Extension", "Intended Audience :: Developers", "License :: OSI Approved :: BSD License", "Operating System :: OS Independent", "Programming Language :: Python", "Programming Language :: Python :: 2", "Programming Language :: Python :: 3", "Topic :: Documentation", "Topic :: Utilities" ], "description": "Napoleon - *Marching toward legible docstrings*\n===============================================\n\nUpdates\n-------\n\nAs of Sphinx 1.3, the napoleon extension will come packaged with Sphinx\nunder sphinx.ext.napoleon. ``sphinxcontrib.napoleon2`` provides support\nfor many more directives. It works best with\n`Sphinx-theme `__ customized\ntheme based on readthedocs.org\n\n``sphinxcontrib.napolean2`` is based on\n```sphinxcontrib.napolean v0.6.0`` `__,\nwritten by Rob Ruana.\n\n+--------------------+--------------------------------------------------------+\n| Style | Directives |\n+====================+========================================================+\n| info (blue) | ``.note, .seealso, .references`` |\n+--------------------+--------------------------------------------------------+\n| tip (green) | ``.tip, .hint, .example`` |\n+--------------------+--------------------------------------------------------+\n| warning (orange) | ``.warning, .caution, .attention, .admonition-todo`` |\n+--------------------+--------------------------------------------------------+\n| danger (red) | ``.danger, .error, .important`` |\n+--------------------+--------------------------------------------------------+\n\nOther sphinxcontrib extensions can be found\n`here `__.\n\nInstallation\n~~~~~~~~~~~~\n\n::\n\n pip install sphinxcontrib-napolean2\n\nThen add ``sphinxcontrib.napolean`` to the ``extensions`` list in\n``docs/source/conf.py``.\n\nHow to add your own directive\n~~~~~~~~~~~~~~~~~~~~~~~~~~~~~\n\n- Refer to ``sphinxcontrib-napolean2/directives.py`` for how to add new\n directives.\n- Add new parser methods to ``sphinxcontrib-napolean2/docstring.py``.\n Refer to lines marked with 'ADDED'.\n- Add ``app.add_directive('example', ExampleDirective)`` to ``setup()``\n function in ``sphinxcontrib-napolean2/__init__.py``\n- Modify ``Sphinx-theme/sass/_theme_rst.sass`` to support the new\n directives in the theme.\n- Original designs are located in\n ``Sphinx-theme/wyrm/sass/wyrm_core/_alert.sass``\n\nIntro\n-----\n\nAre you tired of writing docstrings that look like this:\n\n::\n\n :param path: The path of the file to wrap\n :type path: str\n :param field_storage: The :class:`FileStorage` instance to wrap\n :type field_storage: FileStorage\n :param temporary: Whether or not to delete the file when the File\n instance is destructed\n :type temporary: bool\n :returns: A buffered writable file descriptor\n :rtype: BufferedFileStorage\n\n`ReStructuredText `__ is\ngreat, but it creates visually dense, hard to read\n`docstrings `__. Compare the\njumble above to the same thing rewritten according to the `Google Python\nStyle Guide `__:\n\n::\n\n Args:\n path (str): The path of the file to wrap\n field_storage (FileStorage): The :class:`FileStorage` instance to wrap\n temporary (bool): Whether or not to delete the file when the File\n instance is destructed\n\n Returns:\n BufferedFileStorage: A buffered writable file descriptor\n\nMuch more legible, no?\n\nNapoleon is a `Sphinx\nextension `__ that enables Sphinx\nto parse both\n`NumPy `__\nand\n`Google `__\nstyle docstrings - the style recommended by `Khan\nAcademy `__.\n\nNapoleon is a pre-processor that parses\n`NumPy `__\nand\n`Google `__\nstyle docstrings and converts them to reStructuredText before Sphinx\nattempts to parse them. This happens in an intermediate step while\nSphinx is processing the documentation, so it doesn't modify any of the\ndocstrings in your actual source code files.\n\nGetting Started\n---------------\n\n1. Install the napoleon extension:\n\n ::\n\n $ pip install sphinxcontrib-napoleon\n\n2. After `setting up Sphinx `__ to\n build your docs, enable napoleon in the Sphinx conf.py file:\n\n ::\n\n # conf.py\n\n # Add autodoc and napoleon to the extensions list\n extensions = ['sphinx.ext.autodoc', 'sphinxcontrib.napoleon']\n\n3. Use sphinx-apidoc to build your API documentation:\n\n ::\n\n $ sphinx-apidoc -f -o docs/source projectdir\n\nDocstrings\n----------\n\nNapoleon interprets every docstring that `Sphinx\nautodoc `__ can find, including\ndocstrings on: ``modules``, ``classes``, ``attributes``, ``methods``,\n``functions``, and ``variables``. Inside each docstring, specially\nformatted `Sections <>`__ are parsed and converted to reStructuredText.\n\nAll standard reStructuredText formatting still works as expected.\n\nDocstring Sections\n------------------\n\nAll of the following section headers are supported:\n\n - ``Args`` *(alias of Parameters)*\n - ``Arguments`` *(alias of Parameters)*\n - ``Attributes``\n - ``Example``\n - ``Examples``\n - ``Keyword Args`` *(alias of Keyword Arguments)*\n - ``Keyword Arguments``\n - ``Methods``\n - ``Note``\n - ``Notes``\n - ``Other Parameters``\n - ``Parameters``\n - ``Return`` *(alias of Returns)*\n - ``Returns``\n - ``Raises``\n - ``References``\n - ``See Also``\n - ``Warning``\n - ``Warnings`` *(alias of Warning)*\n - ``Warns``\n - ``Yield`` *(alias of Yields)*\n - ``Yields``\n\nAdded in sphinxcontrib-napoleon2:\n\n - ``Reference`` *(alias of References)*\n - ``Tip``\n - ``Hint``\n - ``Caution``\n - ``Attention``\n - ``Danger``\n - ``Important``\n - ``Error``\n\nGoogle vs NumPy\n---------------\n\nNapoleon supports two styles of docstrings:\n`Google `__\nand\n`NumPy `__.\nThe main difference between the two styles is that Google uses indention\nto separate sections, whereas NumPy uses underlines.\n\nGoogle style:\n\n::\n\n def func(arg1, arg2):\n \"\"\"Summary line.\n\n Extended description of function.\n\n Args:\n arg1 (int): Description of arg1\n arg2 (str): Description of arg2\n\n Returns:\n bool: Description of return value\n\n \"\"\"\n return True\n\nNumPy style:\n\n::\n\n def func(arg1, arg2):\n \"\"\"Summary line.\n\n Extended description of function.\n\n Parameters\n ----------\n arg1 : int\n Description of arg1\n arg2 : str\n Description of arg2\n\n Returns\n -------\n bool\n Description of return value\n\n \"\"\"\n return True\n\nNumPy style tends to require more vertical space, whereas Google style\ntends to use more horizontal space. Google style tends to be easier to\nread for short and simple docstrings, whereas NumPy style tends be\neasier to read for long and in-depth docstrings.\n\nThe `Khan\nAcademy `__\nrecommends using Google style.\n\nThe choice between styles is largely aesthetic, but the two styles\nshould not be mixed. Choose one style for your project and be consistent\nwith it.\n\nFor full documentation see https://sphinxcontrib-napoleon.readthedocs.io\n\n\n", "description_content_type": null, "docs_url": null, "download_url": "http://github.com/LinxiFan/sphinxcontrib-napoleon", "downloads": { "last_day": -1, "last_month": -1, "last_week": -1 }, "home_page": "https://sphinxcontrib-napoleon.readthedocs.io", "keywords": "", "license": "BSD", "maintainer": "", "maintainer_email": "", "name": "sphinxcontrib-napoleon2", "package_url": "https://pypi.org/project/sphinxcontrib-napoleon2/", "platform": "any", "project_url": "https://pypi.org/project/sphinxcontrib-napoleon2/", "project_urls": { "Download": "http://github.com/LinxiFan/sphinxcontrib-napoleon", "Homepage": "https://sphinxcontrib-napoleon.readthedocs.io" }, "release_url": "https://pypi.org/project/sphinxcontrib-napoleon2/1.0/", "requires_dist": [ "pockets (>=0.3)", "six (>=1.5.2)" ], "requires_python": "", "summary": "Modified Sphinx \"napoleon\" extension.", "version": "1.0" }, "last_serial": 2558886, "releases": { "1.0": [ { "comment_text": "", "digests": { "md5": "6743c3edc136ab9a434218ef69ce9e1e", "sha256": "4f275f9b0f1b47e86ff3686a8eb373c10951d676ad850ffacf5e8728f867374c" }, "downloads": -1, "filename": "sphinxcontrib_napoleon2-1.0-py2.py3-none-any.whl", "has_sig": false, "md5_digest": "6743c3edc136ab9a434218ef69ce9e1e", "packagetype": "bdist_wheel", "python_version": "py2.py3", "requires_python": null, "size": 28015, "upload_time": "2017-01-07T02:17:29", "url": "https://files.pythonhosted.org/packages/54/3b/11e3cfe1b85ce87f7f8263e7722598ad4aca42e37ccfb2553a97dea2e373/sphinxcontrib_napoleon2-1.0-py2.py3-none-any.whl" }, { "comment_text": "", "digests": { "md5": "742afca2d5f85208a544caf9efe24c59", "sha256": "23d424571758962c82fa60fd4405ab0959508f26d20043c42845f8f76780ab20" }, "downloads": -1, "filename": "sphinxcontrib-napoleon2-1.0.tar.gz", "has_sig": false, "md5_digest": "742afca2d5f85208a544caf9efe24c59", "packagetype": "sdist", "python_version": "source", "requires_python": null, "size": 26019, "upload_time": "2017-01-07T02:17:31", "url": "https://files.pythonhosted.org/packages/08/e4/92bd69b53faff65bf24e2805aa341e8de75b1f9a312fa2cc1d4a372b7bf6/sphinxcontrib-napoleon2-1.0.tar.gz" } ] }, "urls": [ { "comment_text": "", "digests": { "md5": "6743c3edc136ab9a434218ef69ce9e1e", "sha256": "4f275f9b0f1b47e86ff3686a8eb373c10951d676ad850ffacf5e8728f867374c" }, "downloads": -1, "filename": "sphinxcontrib_napoleon2-1.0-py2.py3-none-any.whl", "has_sig": false, "md5_digest": "6743c3edc136ab9a434218ef69ce9e1e", "packagetype": "bdist_wheel", "python_version": "py2.py3", "requires_python": null, "size": 28015, "upload_time": "2017-01-07T02:17:29", "url": "https://files.pythonhosted.org/packages/54/3b/11e3cfe1b85ce87f7f8263e7722598ad4aca42e37ccfb2553a97dea2e373/sphinxcontrib_napoleon2-1.0-py2.py3-none-any.whl" }, { "comment_text": "", "digests": { "md5": "742afca2d5f85208a544caf9efe24c59", "sha256": "23d424571758962c82fa60fd4405ab0959508f26d20043c42845f8f76780ab20" }, "downloads": -1, "filename": "sphinxcontrib-napoleon2-1.0.tar.gz", "has_sig": false, "md5_digest": "742afca2d5f85208a544caf9efe24c59", "packagetype": "sdist", "python_version": "source", "requires_python": null, "size": 26019, "upload_time": "2017-01-07T02:17:31", "url": "https://files.pythonhosted.org/packages/08/e4/92bd69b53faff65bf24e2805aa341e8de75b1f9a312fa2cc1d4a372b7bf6/sphinxcontrib-napoleon2-1.0.tar.gz" } ] }