Skip to content

Commit

Permalink
Configure pyvista for doc builds
Browse files Browse the repository at this point in the history
  • Loading branch information
jcapriot committed Jul 13, 2023
1 parent d6eb086 commit 16d87ea
Showing 1 changed file with 20 additions and 4 deletions.
24 changes: 20 additions & 4 deletions docs/conf.py
Original file line number Diff line number Diff line change
Expand Up @@ -448,14 +448,30 @@ def linkcode_resolve(domain, info):
),
]


# Use pyvista's image scraper for example gallery
# -- pyvista configuration ---------------------------------------------------
import pyvista

# Make sure off screen is set to true when building locally
pyvista.OFF_SCREEN = True
# Manage errors
pyvista.set_error_output_file("errors.txt")
# Ensure that offscreen rendering is used for docs generation
pyvista.OFF_SCREEN = True # Not necessary - simply an insurance policy
# Preferred plotting style for documentation
pyvista.set_plot_theme("document")
pyvista.global_theme.window_size = [1024, 768]
pyvista.global_theme.font.size = 22
pyvista.global_theme.font.label_size = 22
pyvista.global_theme.font.title_size = 22
pyvista.global_theme.return_cpos = False
pyvista.set_jupyter_backend(None)
# Save figures in specified directory
pyvista.FIGURE_PATH = os.path.join(os.path.abspath("./images/"), "auto-generated/")
if not os.path.exists(pyvista.FIGURE_PATH):
os.makedirs(pyvista.FIGURE_PATH)


# necessary when building the sphinx gallery
pyvista.BUILDING_GALLERY = True
os.environ["PYVISTA_BUILDING_GALLERY"] = "true"

# Sphinx Gallery
sphinx_gallery_conf = {
Expand Down

0 comments on commit 16d87ea

Please sign in to comment.