1818copyright = f"(c) { datetime .datetime .now ().year } ANSYS, Inc. All rights reserved"
1919author = 'ANSYS Inc.'
2020release = version = __version__
21- cname = os .getenv ("DOCUMENTATION_CNAME" , default = "nocname .com" )
21+ cname = os .getenv ("DOCUMENTATION_CNAME" , default = "dyna.docs.pyansys .com" )
2222
2323# Sphinx extensions
2424extensions = [
3131 "sphinx_jinja" ,
3232 "pyvista.ext.plot_directive" ,
3333 "sphinx_design" ,
34+ "ansys_sphinx_theme.extension.autoapi" ,
3435]
3536
3637# Intersphinx mapping
126127 ],
127128 "collapse_navigation" : True ,
128129 "use_edit_page_button" : True ,
130+ "ansys_sphinx_theme_autoapi" : {
131+ "project" : project ,
132+ "ignore" : [
133+ "*core/keywords/keyword_classes/auto*" ,
134+ ],
135+ "output" : "api" ,
136+ },
129137}
130138
131139# static path
134142
135143# -- Declare the Jinja context -----------------------------------------------
136144BUILD_API = True if os .environ .get ("BUILD_API" , "true" ) == "true" else False
137- if not BUILD_API :
138- exclude_patterns .append ("_autoapi_templates" )
139- else :
140- # Configuration for Sphinx autoapi
141- extensions .append ("autoapi.extension" )
142- autoapi_dirs = ["../../src/ansys" ]
143- autoapi_ignore = ["*core/keywords/keyword_classes/auto*" ]
144- autoapi_type = "python"
145- autoapi_options = [
146- "members" ,
147- "undoc-members" ,
148- "show-inheritance" ,
149- "show-module-summary" ,
150- "special-members" ,
151- ]
152- autoapi_template_dir = "_autoapi_templates"
153- suppress_warnings = ["autoapi.python_import_resolution" , "config.cache" ]
154- exclude_patterns .append ("_autoapi_templates/index.rst" )
155- autoapi_python_use_implicit_namespaces = True
145+
146+ suppress_warnings = ["autoapi.python_import_resolution" , "config.cache" ]
156147
157148BUILD_EXAMPLES = (
158149 True if os .environ .get ("BUILD_EXAMPLES" , "true" ) == "true" else False
194185 "build_examples" : BUILD_EXAMPLES ,
195186 },
196187}
188+
189+
190+ def skip_run_subpackage (app , what , name , obj , skip , options ):
191+ """Skip specific members of the 'run' subpackage during documentation generation.
192+
193+ This function skips:
194+ - All modules under 'ansys.dyna.core.run' except 'local_solver' and 'options'.
195+ - Within 'local_solver', skips all members except the 'run_dyna' function.
196+ """
197+
198+
199+ if name .startswith ("ansys.dyna.core.run." ) and not (name .startswith ("ansys.dyna.core.run.local_solver" ) or name .startswith ("ansys.dyna.core.run.options" )):
200+ skip = True
201+
202+ if name .startswith ("ansys.dyna.core.run.local_solver" ):
203+ if what == "function" and name != "ansys.dyna.core.run.local_solver.run_dyna" :
204+ skip = True
205+
206+ return skip
207+
208+ def setup (sphinx ):
209+ """Add custom extensions to Sphinx."""
210+ sphinx .connect ("autoapi-skip-member" , skip_run_subpackage )
0 commit comments