Skip to content
Closed
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
9 changes: 7 additions & 2 deletions src/sphinx_book_theme/header_buttons/launch.py
Original file line number Diff line number Diff line change
Expand Up @@ -41,7 +41,11 @@ def add_launch_buttons(
# If so, insert the URLs depending on the configuration
config_theme = app.config["html_theme_options"]
launch_buttons = config_theme.get("launch_buttons", {})
if not launch_buttons or not _is_notebook(app, pagename):
if (
not launch_buttons
or not _is_notebook(app, pagename)
or launch_buttons.get("disable", False)
):
return

# Grab the header buttons from context as it should already exist.
Expand Down Expand Up @@ -198,7 +202,8 @@ def _split_repo_url(url):
org, repo = end.split("/")[:2]
else:
SPHINX_LOGGER.warning(
f"Currently Binder/JupyterHub repositories must be on GitHub, got {url}"
f"Currently Binder/JupyterHub repositories must be on GitHub, got {url}. "
'Use `launch_buttons: {"disable": true}` to silence this warning.'
)
org = repo = None
return org, repo
Expand Down