Skip to content

Commit

Permalink
maint: Update conf.py
Browse files Browse the repository at this point in the history
  • Loading branch information
AlejandroFernandezLuces committed Nov 13, 2024
1 parent 793df24 commit f8ffd63
Show file tree
Hide file tree
Showing 2 changed files with 47 additions and 2 deletions.
1 change: 1 addition & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -33,6 +33,7 @@ dist/
# autogenerated docs
_autosummary
_build/
doc/source/api


# Testing
Expand Down
48 changes: 46 additions & 2 deletions doc/source/conf.py
Original file line number Diff line number Diff line change
Expand Up @@ -58,6 +58,12 @@
"icon": "fa fa-comment fa-fw",
},
],
"ansys_sphinx_theme_autoapi": {
"project": project,
"keep_files": True,
"add_toctree_entry": True,
"package_depth": 5,
},
"cheatsheet": {
"file": "cheatsheet/cheat_sheet.qmd",
"title": "PyPrimeMesh cheat sheet",
Expand All @@ -67,7 +73,6 @@

# Sphinx extensions
extensions = [
'sphinx.ext.autodoc',
'sphinx.ext.autosummary',
"numpydoc",
"sphinx.ext.intersphinx",
Expand All @@ -78,10 +83,10 @@
"sphinx.ext.coverage",
"sphinx.ext.doctest",
"sphinx.ext.extlinks",
"sphinx_autodoc_typehints",
"sphinxemoji.sphinxemoji",
"sphinx_design",
"pyvista.ext.viewer_directive",
"ansys_sphinx_theme.extension.autoapi",
]
nbsphinx_execute = "always"

Expand Down Expand Up @@ -177,3 +182,42 @@
}

supress_warnings = ["docutils"]


exclude_patterns = [
"examples/**/*.ipynb",
"examples/**/*.py",
"examples/**/*.md5",
"api/ansys/visualizer/index.rst",
]


BUILD_API = True
if not BUILD_API:
exclude_patterns.append("autoapi")

BUILD_EXAMPLES = True
if not BUILD_EXAMPLES:
exclude_patterns.append("examples/**")
exclude_patterns.append("examples.rst")

jinja_contexts = {
"main_toctree": {
"build_api": BUILD_API,
"build_examples": BUILD_EXAMPLES,
}
}


def prepare_jinja_env(jinja_env) -> None:
"""Customize the jinja env.
Notes
-----
See https://jinja.palletsprojects.com/en/3.0.x/api/#jinja2.Environment
"""
jinja_env.globals["project_name"] = project


autoapi_prepare_jinja_env = prepare_jinja_env

0 comments on commit f8ffd63

Please sign in to comment.