Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

refactor: handle options more pythonically #813

Closed
wants to merge 2 commits into from
Closed
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
5 changes: 1 addition & 4 deletions src/sphinx_book_theme/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -134,7 +134,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 @@ -150,9 +150,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