|
1 | | -# -*- coding: utf-8 -*- |
2 | 1 | # |
3 | 2 | # Configuration file for the Sphinx documentation builder. |
4 | 3 | # |
|
24 | 23 | def parse_version(package): |
25 | 24 |
|
26 | 25 | init_file = '%s/%s/__init__.py' % (ROOT_PATH, package) |
27 | | - with open(init_file, 'r', encoding='utf-8') as f: |
| 26 | + with open(init_file, encoding='utf-8') as f: |
28 | 27 | for line in f.readlines(): |
29 | 28 | if '__version__' in line: |
30 | 29 | return line.split('=')[1].strip()[1:-1] |
@@ -53,12 +52,14 @@ def parse_version(package): |
53 | 52 | # ones. |
54 | 53 | extensions = [ |
55 | 54 | 'sphinx.ext.autodoc', |
| 55 | + 'sphinx.ext.autosummary', |
56 | 56 | 'sphinx.ext.todo', |
57 | 57 | 'sphinx.ext.coverage', |
58 | 58 | 'sphinx.ext.mathjax', |
59 | 59 | 'sphinx.ext.ifconfig', |
60 | 60 | 'sphinx.ext.viewcode', |
61 | 61 | 'sphinx.ext.githubpages', |
| 62 | + 'sphinx.ext.napoleon', |
62 | 63 | 'sphinx_llms_txt', |
63 | 64 | # 'IPython.sphinxext.ipython_console_highlighting', |
64 | 65 | # 'IPython.sphinxext.ipython_directive', |
@@ -192,3 +193,19 @@ def parse_version(package): |
192 | 193 | epub_exclude_files = ['search.html'] |
193 | 194 |
|
194 | 195 | # -- Extension configuration ------------------------------------------------- |
| 196 | + |
| 197 | +# Configure napoleon to parse Google-style docstrings |
| 198 | +napoleon_google_docstring = True |
| 199 | +napoleon_numpy_docstring = False |
| 200 | +napoleon_include_init_with_doc = False |
| 201 | +napoleon_preprocess_types = True |
| 202 | + |
| 203 | +# Autodoc / autosummary configuration |
| 204 | +autosummary_generate = True |
| 205 | +autodoc_typehints = 'description' |
| 206 | +autodoc_default_options = { |
| 207 | + 'members': True, |
| 208 | + 'undoc-members': False, |
| 209 | + 'inherited-members': True, |
| 210 | + 'show-inheritance': True, |
| 211 | +} |
0 commit comments