diff --git a/docs/source/conf.py b/docs/source/conf.py index 3da1d259..46362c75 100644 --- a/docs/source/conf.py +++ b/docs/source/conf.py @@ -113,18 +113,21 @@ "LoopStructural.interpolators._cython", ] # Sphinx gallery examples -from LoopStructural.visualisation.sphinx_scraper import Scraper as LoopScraper -from sphinx_gallery.sorting import ExampleTitleSortKey - -sphinx_gallery_conf = { - "examples_dirs": ["../../examples/"], - "gallery_dirs": [ - "_auto_examples/" - ], # path to where to save gallery generated output - "image_scrapers": ("matplotlib", LoopScraper()), - "within_subsection_order": ExampleTitleSortKey, - "reference_url": {"LoopStructural": None}, -} +try: + from LoopStructural.visualisation.sphinx_scraper import Scraper as LoopScraper + from sphinx_gallery.sorting import ExampleTitleSortKey + + sphinx_gallery_conf = { + "examples_dirs": ["../../examples/"], + "gallery_dirs": [ + "_auto_examples/" + ], # path to where to save gallery generated output + "image_scrapers": ("matplotlib", LoopScraper()), + "within_subsection_order": ExampleTitleSortKey, + "reference_url": {"LoopStructural": None}, + } +except ImportError: + pass # def setup(app): # app.add_stylesheet('custom.css')