@@ -121,6 +121,7 @@ def split_code_and_text_blocks(source_file, return_node, real_func):
121121
122122
123123# This header replaces the default sphinx-gallery one in sphinx_gallery/gen_rst.py.
124+ # Colab button has been temporarily disabled due to prebuilt packages unavailability.
124125COLAB_HTML_HEADER = """
125126.. DO NOT EDIT. THIS FILE WAS AUTOMATICALLY GENERATED BY
126127.. TVM'S MONKEY-PATCHED VERSION OF SPHINX-GALLERY. TO MAKE
@@ -132,13 +133,7 @@ def split_code_and_text_blocks(source_file, return_node, real_func):
132133 .. note::
133134 :class: sphx-glr-download-link-note
134135
135- This tutorial can be used interactively with Google Colab! You can also click
136- :ref:`here <sphx_glr_download_{ref_name}>` to run the Jupyter notebook locally.
137-
138- .. image:: {button_svg}
139- :align: center
140- :target: {colab_url}
141- :width: 300px
136+ You can click :ref:`here <sphx_glr_download_{ref_name}>` to run the Jupyter notebook locally.
142137
143138.. rst-class:: sphx-glr-example-title
144139
@@ -162,7 +157,11 @@ def split_code_and_text_blocks(source_file, return_node, real_func):
162157def save_rst_example (
163158 example_rst , example_file , time_elapsed , memory_used , gallery_conf , language , real_func
164159):
165- """Monkey-patch save_rst_example to include the "Open in Colab" button."""
160+ """Monkey-patch save_rst_example to customize the tutorial header.
161+
162+ Note: Colab button has been temporarily disabled. The colab_url and button_svg
163+ are still generated but not used in the header template.
164+ """
166165
167166 # The url is the md5 hash of the notebook path.
168167 example_fname = os .path .relpath (example_file , gallery_conf ["src_dir" ])
@@ -171,6 +170,7 @@ def save_rst_example(
171170 digest = md5 (notebook_path .encode ()).hexdigest ()
172171
173172 # Fixed documentation versions must link to different (earlier) .ipynb notebooks.
173+ # Note: colab_url is generated but not currently used in the header template.
174174 colab_url = f"{ COLAB_URL_BASE } /{ IPYTHON_GITHUB_BASE } "
175175 if "dev" not in version :
176176 colab_url += version + "/"
0 commit comments