diff --git a/docs/conf.py b/docs/conf.py index acc03161e5596..7f0256ea32e36 100644 --- a/docs/conf.py +++ b/docs/conf.py @@ -160,7 +160,9 @@ def split_code_and_text_blocks(source_file, return_node, real_func): @monkey_patch("sphinx_gallery.gen_rst", "save_rst_example") -def save_rst_example(example_rst, example_file, time_elapsed, memory_used, gallery_conf, real_func): +def save_rst_example( + example_rst, example_file, time_elapsed, memory_used, gallery_conf, language, real_func +): """Monkey-patch save_rst_example to include the "Open in Colab" button.""" # The url is the md5 hash of the notebook path. @@ -179,7 +181,9 @@ def save_rst_example(example_rst, example_file, time_elapsed, memory_used, galle python_file=example_fname, ref_name=ref_fname, colab_url=colab_url, button_svg=BUTTON ) with patch("sphinx_gallery.gen_rst.EXAMPLE_HEADER", new_header): - real_func(example_rst, example_file, time_elapsed, memory_used, gallery_conf) + real_func( + example_rst, example_file, time_elapsed, memory_used, gallery_conf, language=language + ) INCLUDE_DIRECTIVE_RE = re.compile(r"^([ \t]*)\.\. include::\s*(.+)\n", flags=re.M) @@ -450,10 +454,12 @@ def jupyter_notebook(script_blocks, gallery_conf, target_dir, real_func): subsection_order = ExplicitOrder( - str(p) - for p in [ - tvm_path / "vta" / "tutorials" / "frontend", - tvm_path / "vta" / "tutorials" / "optimize", + [ + str(p) + for p in [ + tvm_path / "vta" / "tutorials" / "frontend", + tvm_path / "vta" / "tutorials" / "optimize", + ] ] )