Skip to content

Commit

Permalink
fix missing language kwarg in save_rst_example
Browse files Browse the repository at this point in the history
  • Loading branch information
mshr-h committed Oct 23, 2024
1 parent bcaef9c commit e4a78c1
Showing 1 changed file with 12 additions and 6 deletions.
18 changes: 12 additions & 6 deletions docs/conf.py
Original file line number Diff line number Diff line change
Expand Up @@ -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.
Expand All @@ -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)
Expand Down Expand Up @@ -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",
]
]
)

Expand Down

0 comments on commit e4a78c1

Please sign in to comment.