{# Custom launcher links for Sphinx-Gallery example pages. This adds an "Open in Colab" button that opens the notebook version of the current example. #} {% if pagename.startswith('auto_examples/') and not pagename.endswith('/index') and pagename != 'auto_examples/index' %} {# Build the notebook path corresponding to this example page. Pages live at auto_examples/
/ Notebooks are published to gh-pages at /auto_examples/_notebooks/
/.ipynb The version is either 'dev' for development or the version number (e.g., '1.2') #} {% set example_ipynb_repo_path = pagename.replace('auto_examples/', 'auto_examples/_notebooks/') + '.ipynb' %} {% set doc_version = doc_version|default('dev') %}

Run this example

{# Primary: open the generated notebook on Colab #} Open in Colab
{% endif %}