Skip to content

Commit

Permalink
refactor: handle options more pythonically
Browse files Browse the repository at this point in the history
  • Loading branch information
agoose77 committed Feb 7, 2024
1 parent 956553a commit 324cc28
Showing 1 changed file with 1 addition and 4 deletions.
5 changes: 1 addition & 4 deletions src/sphinx_book_theme/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -133,7 +133,7 @@ def hash_html_assets(app, pagename, templatename, context, doctree):
def update_mode_thebe_config(app):
"""Update thebe configuration with SBT-specific values"""
theme_options = get_theme_options_dict(app)
if theme_options.get("launch_buttons", {}).get("thebe") is True:
if theme_options.get("launch_buttons", {}).get("thebe"):
# In case somebody specifies they want thebe in a launch button
# but has not activated the sphinx_thebe extension.
if not hasattr(app.env.config, "thebe_config"):
Expand All @@ -149,9 +149,6 @@ def update_mode_thebe_config(app):
else:
return

if not theme_options.get("launch_buttons", {}).get("thebe"):
return

# Update the repository branch and URL
# Assume that if there's already a thebe_config, then we don't want to over-ride
if "repository_url" not in thebe_config:
Expand Down

0 comments on commit 324cc28

Please sign in to comment.