Skip to content

Commit

Permalink
add colab link as header to notebooks in docs
Browse files Browse the repository at this point in the history
  • Loading branch information
lkeegan committed Aug 17, 2021
1 parent 73e34cf commit 46508a8
Show file tree
Hide file tree
Showing 3 changed files with 10 additions and 2 deletions.
4 changes: 2 additions & 2 deletions .pre-commit-config.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -8,11 +8,11 @@ repos:
- id: trailing-whitespace

- repo: https://github.com/psf/black
rev: 21.6b0
rev: 21.7b0
hooks:
- id: black

- repo: https://github.com/kynan/nbstripout
rev: 0.4.0
rev: 0.5.0
hooks:
- id: nbstripout
7 changes: 7 additions & 0 deletions docs/conf.py
Original file line number Diff line number Diff line change
Expand Up @@ -40,6 +40,13 @@

autosummary_generate = True

nbsphinx_prolog = """
|colab-icon|_ `Interactive online version <https://colab.research.google.com/github/spatial-model-editor/sme_contrib/blob/master/docs/{{ env.doc2path(env.docname, base=None) }}>`_
.. |colab-icon| image:: https://colab.research.google.com/assets/colab-badge.svg
.. _colab-icon: https://colab.research.google.com/github/spatial-model-editor/sme_contrib/blob/master/docs/{{ env.doc2path(env.docname, base=None) }}
"""

# Add any paths that contain templates here, relative to this directory.
templates_path = ["_templates"]

Expand Down
1 change: 1 addition & 0 deletions docs/notebooks/plot.ipynb
Original file line number Diff line number Diff line change
Expand Up @@ -15,6 +15,7 @@
},
"outputs": [],
"source": [
"!pip install -q sme_contrib\n",
"import sme\n",
"import sme_contrib.plot as smeplot\n",
"from matplotlib import pyplot as plt"
Expand Down

0 comments on commit 46508a8

Please sign in to comment.