|
7 | 7 | import re
|
8 | 8 | import sys
|
9 | 9 |
|
10 |
| -# 3rd party |
11 |
| -from sphinx.locale import _ |
12 |
| - |
13 | 10 | sys.path.append(os.path.abspath('.'))
|
14 | 11 | sys.path.append(os.path.abspath('..'))
|
15 | 12 |
|
|
18 | 15 | # User-configurable lines
|
19 | 16 | # End of user-configurable lines
|
20 | 17 |
|
21 |
| -github_url = "https://github.com/domdfcoding/flake8_strftime" |
| 18 | +github_username = "domdfcoding" |
| 19 | +github_repository = "flake8_strftime" |
| 20 | +github_url = f"https://github.com/{github_username}/{github_repository}" |
| 21 | + |
22 | 22 |
|
23 | 23 | rst_prolog = f""".. |pkgname| replace:: flake8_strftime
|
24 | 24 | .. |pkgname2| replace:: ``flake8_strftime``
|
|
34 | 34 | package_root = "flake8_strftime"
|
35 | 35 |
|
36 | 36 | extensions = [
|
37 |
| - 'sphinx.ext.intersphinx', |
38 |
| - 'sphinx.ext.autodoc', |
39 |
| - 'sphinx.ext.mathjax', |
40 |
| - 'sphinx.ext.viewcode', |
41 |
| - 'sphinxcontrib.httpdomain', |
42 |
| - "sphinxcontrib.extras_require", |
43 |
| - "sphinx.ext.todo", |
44 |
| - "sphinxemoji.sphinxemoji", |
45 |
| - "notfound.extension", |
46 |
| - "sphinx_tabs.tabs", |
47 |
| - "sphinx-prompt", |
48 |
| - "sphinx_autodoc_typehints", |
49 |
| - "sphinx.ext.autosummary", |
50 |
| - "autodocsumm", |
51 |
| - "sphinx_copybutton", |
52 |
| - "sphinxcontrib.default_values", |
53 |
| - "sphinxcontrib.toctree_plus", |
54 |
| - # "sphinx_gitstamp", |
55 |
| - ] |
| 37 | + 'sphinx_toolbox', |
| 38 | + 'sphinx_toolbox.more_autodoc', |
| 39 | + 'sphinx_toolbox.more_autosummary', |
| 40 | + 'sphinx_toolbox.tweaks.param_dash', |
| 41 | + 'sphinx.ext.intersphinx', |
| 42 | + 'sphinx.ext.mathjax', |
| 43 | + 'sphinxcontrib.httpdomain', |
| 44 | + 'sphinxcontrib.extras_require', |
| 45 | + 'sphinx.ext.todo', |
| 46 | + 'sphinxemoji.sphinxemoji', |
| 47 | + 'notfound.extension', |
| 48 | + 'sphinx_copybutton', |
| 49 | + 'sphinxcontrib.default_values', |
| 50 | + 'sphinxcontrib.toctree_plus', |
| 51 | + 'seed_intersphinx_mapping', |
| 52 | + ] |
56 | 53 |
|
57 | 54 | sphinxemoji_style = 'twemoji'
|
58 | 55 | todo_include_todos = bool(os.environ.get("SHOW_TODOS", 0))
|
|
68 | 65 | pygments_style = 'default'
|
69 | 66 |
|
70 | 67 | intersphinx_mapping = {
|
71 |
| - 'rtd': ('https://docs.readthedocs.io/en/latest/', None), |
72 |
| - 'sphinx': ('https://www.sphinx-doc.org/en/stable/', None), |
73 | 68 | 'python': ('https://docs.python.org/3/', None),
|
74 |
| - "NumPy": ('https://numpy.org/doc/stable/', None), |
75 |
| - "SciPy": ('https://docs.scipy.org/doc/scipy/reference', None), |
76 |
| - "Pandas": ('https://pandas.pydata.org/docs/', None), |
77 |
| - "matplotlib": ('https://matplotlib.org', None), |
| 69 | + 'sphinx': ('https://www.sphinx-doc.org/en/stable/', None), |
| 70 | + 'rtd': ('https://docs.readthedocs.io/en/latest/', None), |
78 | 71 | "h5py": ('https://docs.h5py.org/en/latest/', None),
|
79 |
| - "Sphinx": ('https://www.sphinx-doc.org/en/master/', None), |
80 |
| - "Django": ('https://docs.djangoproject.com/en/dev/', 'https://docs.djangoproject.com/en/dev/_objects/'), |
81 | 72 | "sarge": ('https://sarge.readthedocs.io/en/latest/', None),
|
82 |
| - "attrs": ('https://www.attrs.org/en/stable/', None), |
83 | 73 | }
|
84 | 74 |
|
85 | 75 | html_theme = 'domdf_sphinx_theme'
|
|
103 | 93 | man_pages = [('index', slug, project, [author], 1)]
|
104 | 94 | texinfo_documents = [('index', slug, project, author, slug, project, 'Miscellaneous')]
|
105 | 95 |
|
| 96 | +toctree_plus_types = { |
| 97 | + "class", |
| 98 | + "function", |
| 99 | + "method", |
| 100 | + "data", |
| 101 | + "enum", |
| 102 | + "flag", |
| 103 | + "confval", |
| 104 | + "directive", |
| 105 | + "role", |
| 106 | + "confval", |
| 107 | + "protocol", |
| 108 | + "typeddict", |
| 109 | + "namedtuple", |
| 110 | + } |
| 111 | + |
| 112 | +add_module_names = False |
| 113 | + |
106 | 114 |
|
107 | 115 | autodoc_default_options = {
|
108 | 116 | 'members': None, # Include all members (methods).
|
109 | 117 | 'special-members': None,
|
110 | 118 | "autosummary": None,
|
| 119 | + "show-inheritance": None, |
111 | 120 | 'exclude-members': ','.join([ # Exclude "standard" methods.
|
112 | 121 | "__dict__",
|
| 122 | + "__class__", |
113 | 123 | "__dir__",
|
114 | 124 | "__weakref__",
|
115 | 125 | "__module__",
|
|
118 | 128 | "__parameters__",
|
119 | 129 | "__subclasshook__",
|
120 | 130 | "__init_subclass__",
|
121 |
| - ]) |
| 131 | + "__attrs_attrs__", |
| 132 | + "__init__", |
| 133 | + "__new__", |
| 134 | + "__getnewargs__", |
| 135 | + "__abstractmethods__", |
| 136 | + "__hash__", |
| 137 | + ]), |
122 | 138 | }
|
123 |
| - |
124 |
| - |
125 |
| -# Extensions to theme docs |
126 |
| -def setup(app): |
127 |
| - from sphinx.domains.python import PyField |
128 |
| - from sphinx.util.docfields import Field |
129 |
| - |
130 |
| - app.add_object_type( |
131 |
| - 'confval', |
132 |
| - 'confval', |
133 |
| - objname='configuration value', |
134 |
| - indextemplate='pair: %s; configuration value', |
135 |
| - doc_field_types=[ |
136 |
| - PyField( |
137 |
| - 'type', |
138 |
| - label=_('Type'), |
139 |
| - has_arg=False, |
140 |
| - names=('type', ), |
141 |
| - bodyrolename='class', |
142 |
| - ), |
143 |
| - Field( |
144 |
| - 'default', |
145 |
| - label=_('Default'), |
146 |
| - has_arg=False, |
147 |
| - names=('default', ), |
148 |
| - ), |
149 |
| - ] |
150 |
| - ) |
0 commit comments