jupyter-book
jupyter-book copied to clipboard
Hide the launch button when all backends are disabled
Describe the bug
context
When I disable the default binder link in _config.yml
:
launch_buttons:
binderhub_url: ""
expectation I expected the launch button to disappear.
bug
But instead the launch button still showed up on the top, with an empty dropdown list:
Also, if I set repository url to empty, an error occors:
ValueError: You must provide the key: `repository_url` to use launch buttons.
problem This is a problem for people trying to fully disable the launch button.
workaround Currently the launch button can be disabled directly via the sphinx config:
sphinx:
config:
html_theme_options:
launch_buttons: {}
Reproduce the bug
jupyter-book create test
cat >> _config.yml <<EOF
launch_buttons:
binderhub_url: ""
EOF
jupyter-book build test
see _build/html/notebooks.html
and _build/html/markdown-notebooks.html
List your environment
$ jupyter-book --version
Jupyter Book : 0.13.0
External ToC : 0.2.4
MyST-Parser : 0.15.2
MyST-NB : 0.13.2
Sphinx Book Theme : 0.3.2
Jupyter-Cache : 0.4.3
NbClient : 0.5.13
Thanks for opening your first issue here! Engagement like this is essential for open source projects! :hugs:
If you haven't done so already, check out EBP's Code of Conduct. Also, please try to follow the issue template as it helps other community members to contribute more effectively.
If your issue is a feature request, others may react to it, to raise its prominence (see Feature Voting).
Welcome to the EBP community! :tada:
I had the same issue, thanks so much for sharing this workaround. One minor limitation with the workaround is that it also disables the GitHub Repository and Issues links. I could not not find a workaround for that yet; that is disable/ hide the launch button, but keep the GitHub button.
the same problem too
another workaround could be to hide the button, adding a rule like
.menu-dropdown-launch-buttons {
display: none !important;
}
to a .css
file in the _static
folder
of course this isn't very robust and would need to be updated whenever a new jupyter book version changes the class name of the launch button