Skip to content

Commit

Permalink
Fixed link on top of documentation notebooks.
Browse files Browse the repository at this point in the history
  • Loading branch information
mrucker committed Feb 10, 2024
1 parent 3aed98f commit 7079a5f
Showing 1 changed file with 3 additions and 21 deletions.
24 changes: 3 additions & 21 deletions doc/source/conf.py
Original file line number Diff line number Diff line change
Expand Up @@ -90,31 +90,13 @@
# -- Options for nbsphinx ----------------------------------------------------

nbsphinx_prolog = r"""
{% set docname = 'doc/' + env.doc2path(env.docname, base=None) %}
{% set docname = 'doc/source/' + env.doc2path(env.docname, base=None) %}
.. raw:: html
<div class="admonition note">
This page was generated from
<a class="reference external" href="https://github.com/vowpalWabbit/coba/blob/{{ env.config.release|e }}/{{ docname|e }}">{{ docname|e }}</a>.
Interactive online version:
<span style="white-space: nowrap;"><a href="https://mybinder.org/v2/gh/vowpalWabbit/coba/{{ env.config.release|e }}?filepath={{ docname|e }}"><img alt="Binder badge" src="https://mybinder.org/badge_logo.svg" style="vertical-align:text-bottom"></a>.</span>
<a href="{{ env.docname.split('/')|last|e + '.ipynb' }}" class="reference download internal" download>Download notebook</a>.
<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>
To view an interactive online version of this page
<span style="white-space: nowrap;"><a href="https://mybinder.org/v2/gh/vowpalWabbit/coba/{{ env.config.release|e }}?filepath={{ docname|e }}"><img alt="Binder badge" src="https://mybinder.org/badge_logo.svg" style="vertical-align:text-bottom"></a> (requires some time to initialize).</span>
</div>
"""

Expand Down

0 comments on commit 7079a5f

Please sign in to comment.