pyfar / gallery

Creative Commons Attribution 4.0 International
2 stars 1 forks source link

Remove the binder link from example notebooks that cannot be run there #58

Closed pingelit closed 5 months ago

pingelit commented 5 months ago

As the title says. This PR adapts the nbsphinx_prolog to remove the binder link badge from the example page and replace it with a note to download the notebook.

Furthermore, this PR move the IR measurement notebook to the no_binder folder. This is done because that notebook cannot be run in binder.

f-brinkmann commented 5 months ago

Thanks this looks good to me. But I just noticed that NBViewer also does not work for the measurement notebook - neither here, nor on main. Should we remove the link as well and only leave the download link?

mberz commented 5 months ago

I think that's an unrelated issue. NBViewer does not execute the notebooks, but uses nbconvert to render in a different format.

pingelit commented 5 months ago

I noticed the nbviewer link as well. But as far as I can tell, the link is not in "our" prologue. Should I investigate this in this PR?

f-brinkmann commented 5 months ago

In that case, lets maybe better open a seprate issue

mberz commented 5 months ago

I noticed the nbviewer link as well. But as far as I can tell, the link is not in "our" prologue. Should I investigate this in this PR?

It's right below the changes you made.

      <script>
        if (document.location.host) {
          let nbviewer_link = document.createElement('a');
          nbviewer_link.setAttribute('href',
            'https://nbviewer.org/url' +
            (window.location.protocol == 'https:' ? 's/' : '/') +
            window.location.host +
            window.location.pathname.slice(0, -4) +
            'ipynb');
          nbviewer_link.innerHTML = 'Or view it on <em>nbviewer</em>';
          nbviewer_link.classList.add('reference');
          nbviewer_link.classList.add('external');
          document.currentScript.replaceWith(nbviewer_link, '.');
        }
      </script>

Albeit, it's most probably a different issue with this particular notebook. As mentioned above, nbconvert does not execute the notebooks. Let's make this a separate issue/PR.