From bcee03998035ae92cb48dd2d02f921ce39bed91b Mon Sep 17 00:00:00 2001 From: Lachlan Grose Date: Thu, 15 Feb 2024 10:49:36 +1100 Subject: [PATCH] docs: removing LS import for config --- docs/source/conf.py | 27 +++++++++++++++------------ 1 file changed, 15 insertions(+), 12 deletions(-) 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')