|
1 | 1 | """Sphinx documentation configuration file."""
|
2 | 2 |
|
3 | 3 | from datetime import datetime
|
4 |
| -import os |
5 | 4 |
|
6 | 5 | import ansys.mechanical.core
|
7 |
| -from ansys_sphinx_theme import ansys_favicon |
8 |
| -from ansys_sphinx_theme import pyansys_logo_black as logo |
9 |
| -import numpy as np |
| 6 | +from ansys_sphinx_theme import ansys_favicon, pyansys_logo_black |
10 | 7 | import pyvista
|
| 8 | +from pyvista.plotting.utilities.sphinx_gallery import DynamicScraper |
11 | 9 | from sphinx_gallery.sorting import FileNameSortKey
|
12 | 10 |
|
13 | 11 | # Project information
|
|
17 | 15 | release = version = "0.1.dev0"
|
18 | 16 |
|
19 | 17 | # Select desired logo, theme, and declare the html title
|
20 |
| -html_logo = logo |
| 18 | +html_logo = pyansys_logo_black |
21 | 19 | html_favicon = ansys_favicon
|
22 | 20 | html_theme = "ansys_sphinx_theme"
|
23 | 21 | html_short_title = html_title = "PyMechanical Embedding Examples"
|
|
38 | 36 | "icon": "fa fa-comment fa-fw",
|
39 | 37 | },
|
40 | 38 | ],
|
| 39 | + "cheatsheet": { |
| 40 | + "url": "https://cheatsheets.docs.pyansys.com/pymechanical_cheat_sheet.pdf", |
| 41 | + "title": "PyMechanical cheat sheet", |
| 42 | + "thumbnail": "https://cheatsheets.docs.pyansys.com/pymechanical_cheat_sheet.png", |
| 43 | + "needs_download": True, |
| 44 | + }, |
41 | 45 | }
|
42 | 46 |
|
43 | 47 | # Sphinx extensions
|
|
54 | 58 | "sphinx_copybutton",
|
55 | 59 | "sphinx_gallery.gen_gallery",
|
56 | 60 | "sphinxemoji.sphinxemoji",
|
| 61 | + "sphinx_design", |
| 62 | + "pyvista.ext.viewer_directive", |
57 | 63 | ]
|
58 | 64 |
|
59 | 65 | # -- Sphinx Gallery Options ---------------------------------------------------
|
|
74 | 80 | "backreferences_dir": None,
|
75 | 81 | # Modules for which function level galleries are created. In
|
76 | 82 | "doc_module": "ansys.mechanical.core",
|
77 |
| - "image_scrapers": ("pyvista", "matplotlib"), |
| 83 | + "image_scrapers": (DynamicScraper(), "matplotlib"), |
78 | 84 | "ignore_pattern": "flycheck*",
|
79 | 85 | "thumbnail_size": (350, 350),
|
80 | 86 | # embed gif in gallery
|
|
118 | 124 | pyvista.OFF_SCREEN = True
|
119 | 125 | pyvista.BUILDING_GALLERY = True
|
120 | 126 |
|
121 |
| -# must be less than or equal to the XVFB window size |
122 |
| -try: |
123 |
| - pyvista.global_theme.window_size = np.array([1024, 768]) |
124 |
| -except AttributeError: |
125 |
| - # for compatibility with pyvista < 0.40 |
126 |
| - pyvista.rcParams["window_size"] = np.array([1024, 768]) |
127 |
| - |
128 |
| -# Save figures in specified directory |
129 |
| -pyvista.FIGURE_PATH = os.path.join(os.path.abspath("./images/"), "auto-generated/") |
130 |
| -if not os.path.exists(pyvista.FIGURE_PATH): |
131 |
| - os.makedirs(pyvista.FIGURE_PATH) |
132 |
| - |
133 | 127 | # configure pymechanical for embedding
|
134 | 128 | ansys.mechanical.core.BUILDING_GALLERY = True
|
135 | 129 |
|
|
0 commit comments