Skip to content

Commit

Permalink
Updating usage of mybinder in docs.
Browse files Browse the repository at this point in the history
  • Loading branch information
HarshithaPrabhuswamy committed Feb 6, 2024
1 parent 2946b6f commit 1cadc40
Show file tree
Hide file tree
Showing 2 changed files with 43 additions and 0 deletions.
20 changes: 20 additions & 0 deletions Readme.md
Original file line number Diff line number Diff line change
Expand Up @@ -72,3 +72,23 @@ The next steps are described

If you use ConFlowGen and decide to publish your results, we would be glad if you mention our work as defined at
https://conflowgen.readthedocs.io/en/latest/background.html#presentation-of-conflowgen.

<h1>Jupyter Notebook Tools for Sphinx</h1>

nbsphinx is a Sphinx extension that provides a source parser for *.ipynb files. Custom Sphinx directives are used to show Jupyter Notebook code cells (and of course their results) in both HTML and LaTeX output. Un-evaluated notebooks -- i.e. notebooks without stored output cells -- will be automatically executed during the Sphinx build process.

<b><i>Quick Start:</i></b>

1. Install nbsphinx
2. Edit your conf.py and add 'nbsphinx' to extensions.
3. Edit your index.rst and add the names of your *.ipynb files to the toctree.
4. Run Sphinx!

<b><i>Online documentation (and example of use):</i></b>
https://nbsphinx.readthedocs.io/

<b><i>Source code repository (and issue tracker):</i></b>
https://github.com/spatialaudio/nbsphinx/

<b><i>License:</i></b>
MIT -- see the file LICENSE for details.
23 changes: 23 additions & 0 deletions docs/conf.py
Original file line number Diff line number Diff line change
Expand Up @@ -151,6 +151,29 @@
nbsphinx_prolog = """
.. raw:: html
<div class="admonition note">
This page was generated from
<a class="reference external" href="https://github.com/spatialaudio/nbsphinx/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/spatialaudio/nbsphinx/{{ 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>
</div>
<!-- nbsphinx prolog - start -->
<style>
Expand Down

0 comments on commit 1cadc40

Please sign in to comment.