jupyter-book icon indicating copy to clipboard operation
jupyter-book copied to clipboard

Document how to disable the download button

Open choldgraf opened this issue 4 years ago • 5 comments

A few folks have asked whether they can disable the page download button. This is possible in the theme, as documented here:

https://sphinx-book-theme.readthedocs.io/en/latest/configure.html?highlight=use_download_button#download-page-button

but, it's not documented in jupyter book. We should either document it or add some kind of configuration for it!

choldgraf avatar Jan 21 '21 01:01 choldgraf

Hi! This doesn't seem to work quite right. I tried adding use_download_button: false into the html: section of _config.yml but it had no effect. So I made a sphinx: config: html_theme_options: section and put it there. That worked, but also disabled all the repository/issues/edit buttons! (Even if the use_repository_button: true etc. options were also moved under html_theme_options:).

grahamgower avatar Apr 19 '21 06:04 grahamgower

I got it to work. The trick was to also add the repository_url under the html_theme_options.

sphinx:
    config:
      html_theme_options:
        use_download_button: false
        repository_url: https://example.com/thing
        use_issues_button: true
        use_repository_button: true
        use_edit_page_button: true

Probably best to avoid using your own html_theme_options (it overrides various other things in your _config.yml, and it may not be obvious which things without looking at the jupyter-book conf.py sources) and just wait until a html: use_download_button: false option gets incorporated.

grahamgower avatar Apr 19 '21 07:04 grahamgower

@choldgraf we use lots of autodoc and autosummary pages in our docs, and these auto-generated pages naturally don't come equipped with a valid GitHub link. Is it possible to deactivate buttons (like edit) on a per-page basis?

maxpumperla avatar Apr 26 '23 07:04 maxpumperla

Hi got the same issue,

if I use

sphinx:
    config:
      html_theme_options:
        use_download_button: false

then not only download button is gone, but also repository button too and the title of root page in the sidebar is gone too.

There is already html conf

html:
  use_issues_button: true
  use_repository_button: true

However, if I add use_download_button: false there, it doesn't change anything

Nikeshbajaj avatar Oct 01 '23 21:10 Nikeshbajaj

@Nikeshbajaj building on https://github.com/executablebooks/jupyter-book/issues/1186#issuecomment-822224459, adding the home_page_in_toc: true should keep the download button and the titled link to the home page in the sidebar.

sphinx:
  config:
    html_theme_options:
      repository_url: https://example.com/thing
      use_issues_button: true
      use_download_button: false
      use_repository_button: true
      use_edit_page_button: true
      home_page_in_toc: true

jhcole avatar Mar 10 '24 23:03 jhcole