|
2 | 2 |
|
3 | 3 | from datetime import datetime
|
4 | 4 | import os
|
5 |
| -from pathlib import Path |
6 | 5 |
|
7 | 6 | from allie.flowkit import __version__
|
8 | 7 | from ansys_sphinx_theme import (
|
9 | 8 | ansys_favicon,
|
10 | 9 | ansys_logo_white,
|
11 | 10 | ansys_logo_white_cropped,
|
12 |
| - get_autoapi_templates_dir_relative_path, |
13 | 11 | get_version_match,
|
14 | 12 | latex,
|
15 |
| - pyansys_logo_black, |
16 | 13 | watermark,
|
17 | 14 | )
|
18 | 15 | from sphinx.builders.latex import LaTeXBuilder
|
|
28 | 25 | switcher_version = get_version_match(__version__)
|
29 | 26 |
|
30 | 27 | # Select desired logo, theme, and declare the html title
|
31 |
| -html_logo = pyansys_logo_black |
32 | 28 | html_theme = "ansys_sphinx_theme"
|
33 | 29 | html_short_title = html_title = "Allie Flowkit Python"
|
34 | 30 | html_baseurl = f"https://{cname}/version/stable"
|
|
41 | 37 | "doc_path": "doc/source",
|
42 | 38 | }
|
43 | 39 | html_theme_options = {
|
| 40 | + "logo": "pyansys", |
44 | 41 | "switcher": {
|
45 | 42 | "json_url": f"https://{cname}/versions.json",
|
46 | 43 | "version_match": switcher_version,
|
|
65 | 62 | "url": f"https://{cname}/version/{switcher_version}/_static/assets/download/allie-flowkit-python.pdf", # noqa: E501
|
66 | 63 | "icon": "fa fa-file-pdf fa-fw",
|
67 | 64 | },
|
68 |
| - ] |
| 65 | + ], |
| 66 | + "ansys_sphinx_theme_autoapi": { |
| 67 | + "project": "Allie Flowkit Python", |
| 68 | + "output": "api", |
| 69 | + "use_implicit_namespaces": True, |
| 70 | + "directory": "src", |
| 71 | + "keep_files": True, |
| 72 | + "own_page_level": "class", |
| 73 | + "type": "python", |
| 74 | + "options": [ |
| 75 | + "members", |
| 76 | + "undoc-members", |
| 77 | + "show-inheritance", |
| 78 | + "show-module-summary", |
| 79 | + "special-members", |
| 80 | + ], |
| 81 | + "class_content": "class", |
| 82 | + }, |
69 | 83 | }
|
70 | 84 |
|
| 85 | +suppress_warnings = ["autoapi.python_import_resolution", "design.grid", "config.cache", "autoapi.not_readable"] |
| 86 | + |
| 87 | + |
71 | 88 | # Sphinx extensions
|
72 | 89 | extensions = [
|
73 | 90 | "sphinx.ext.intersphinx",
|
|
76 | 93 | "sphinx_jinja",
|
77 | 94 | "autoapi.extension",
|
78 | 95 | "numpydoc",
|
| 96 | + "ansys_sphinx_theme.extension.autoapi", |
79 | 97 | ]
|
80 | 98 |
|
81 | 99 | nbsphinx_execute = "always"
|
|
148 | 166 | # The master toctree document.
|
149 | 167 | master_doc = "index"
|
150 | 168 |
|
151 |
| -# Configuration for Sphinx autoapi |
152 |
| -autoapi_type = "python" |
153 |
| -autoapi_dirs = ["../../src"] |
154 |
| -autoapi_root = "api" |
155 |
| -autoapi_template_dir = get_autoapi_templates_dir_relative_path(Path(__file__)) |
156 |
| -suppress_warnings = ["autoapi.python_import_resolution", "design.grid", "config.cache", "autoapi.not_readable"] |
157 |
| -autoapi_python_use_implicit_namespaces = True |
158 |
| -autoapi_keep_files = True |
159 |
| -autoapi_own_page_level = "class" |
160 |
| -autoapi_add_toctree_entry = False |
161 |
| -# Examples gallery customization |
162 |
| -nbsphinx_execute = "always" |
163 |
| - |
164 |
| -nbsphinx_epilog = """ |
165 |
| ----- |
166 |
| -
|
167 |
| -.. admonition:: Download this example |
168 |
| -
|
169 |
| - Download this example as a `Jupyter Notebook <{cname_pref}/{ipynb_file_loc}>`_ |
170 |
| - or as a `Python script <{cname_pref}/{py_file_loc}>`_. |
171 |
| -
|
172 |
| -""".format( |
173 |
| - cname_pref=f"https://{cname}/version/{switcher_version}", |
174 |
| - ipynb_file_loc="{{ env.docname }}.ipynb", |
175 |
| - py_file_loc="{{ env.docname }}.py", |
176 |
| -) |
177 |
| - |
178 |
| -nbsphinx_prolog = """ |
179 |
| -
|
180 |
| -.. admonition:: Download this example |
181 |
| -
|
182 |
| - Download this example as a `Jupyter Notebook <{cname_pref}/{ipynb_file_loc}>`_ |
183 |
| - or as a `Python script <{cname_pref}/{py_file_loc}>`_. |
184 |
| -
|
185 |
| ----- |
186 |
| -""".format( |
187 |
| - cname_pref=f"https://{cname}/version/{switcher_version}", |
188 |
| - ipynb_file_loc="{{ env.docname }}.ipynb", |
189 |
| - py_file_loc="{{ env.docname }}.py", |
190 |
| -) |
191 | 169 |
|
192 | 170 | typehints_defaults = "comma"
|
193 | 171 | simplify_optional_unions = False
|
|
200 | 178 | latex_elements = {"preamble": latex.generate_preamble(html_title)}
|
201 | 179 |
|
202 | 180 | linkcheck_exclude_documents = ["index", "getting_started/local/index", "assets"]
|
203 |
| -linkcheck_ignore = [ |
204 |
| - "https://github.com/ansys/allie-flowkit-python/" |
205 |
| -] |
| 181 | +linkcheck_ignore = ["https://github.com/ansys/allie-flowkit-python/"] |
206 | 182 | # -- Declare the Jinja context -----------------------------------------------
|
207 | 183 | exclude_patterns = [
|
208 | 184 | "examples/**/*.ipynb",
|
|
0 commit comments