Skip to content

Commit

Permalink
Cope with Sphinx not being a newer version
Browse files Browse the repository at this point in the history
  • Loading branch information
philip-linaro committed Jul 25, 2024
1 parent a97a8bf commit da37863
Showing 1 changed file with 13 additions and 2 deletions.
15 changes: 13 additions & 2 deletions sphinxcontrib/serializinghtml/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -45,13 +45,24 @@ class SerializingHTMLBuilder(StandaloneHTMLBuilder):

def init(self) -> None:
self.build_info = BuildInfo(self.config, self.tags)
# Cope with whether or not Sphinx has the required configuration variables
# set.
# See HTML Builder comments for explanation of image setup & handling
html_image_dir = self.get_builder_config('image_dir', 'html')
html_image_dir = None
try:
html_image_dir = self.get_builder_config('image_dir', 'html')
except AttributeError:
pass
if html_image_dir is not None:
self.imagedir = html_image_dir
else:
self.imagedir = '_images'
self.imagepath = self.get_builder_config('image_path', 'html')
html_image_path = None
try:
html_image_path = self.get_builder_config('image_path', 'html')
except AttributeError:
pass
self.imagepath = html_image_path
self.current_docname = ''
self.theme = None # type: ignore[assignment] # no theme necessary
self.templates = None # no template bridge necessary
Expand Down

0 comments on commit da37863

Please sign in to comment.