From 99d257fbeea3516e0f847bf5cf2596419fb45918 Mon Sep 17 00:00:00 2001 From: Kurt Mohler Date: Wed, 3 Jul 2024 21:31:08 +0000 Subject: [PATCH] Fix "Run in Colab" and "Download Notebook" links in tutorials --- docs/source/_static/js/theme.js | 2 +- docs/source/_static/js/torchrl_theme.js | 2 +- docs/source/_templates/layout.html | 2 +- 3 files changed, 3 insertions(+), 3 deletions(-) diff --git a/docs/source/_static/js/theme.js b/docs/source/_static/js/theme.js index 2b23c856d49..9c73e2e3ff9 100644 --- a/docs/source/_static/js/theme.js +++ b/docs/source/_static/js/theme.js @@ -946,7 +946,7 @@ if (downloadNote.length >= 1) { tutorialUrlArray[0] = tutorialUrlArray[0] + "/sphinx-tutorials" var githubLink = "https://github.com/pytorch/rl/blob/main/" + tutorialUrlArray.join("/") + ".py", - notebookLink = $(".reference.download")[1].href, + notebookLink = $(".reference.download")[0].href, notebookDownloadPath = notebookLink.split('_downloads')[1], colabLink = "https://colab.research.google.com/github/pytorch/rl/blob/gh-pages/main/_downloads" + notebookDownloadPath; diff --git a/docs/source/_static/js/torchrl_theme.js b/docs/source/_static/js/torchrl_theme.js index 05e1a5b7a63..3d567fc502b 100644 --- a/docs/source/_static/js/torchrl_theme.js +++ b/docs/source/_static/js/torchrl_theme.js @@ -945,7 +945,7 @@ if (downloadNote.length >= 1) { var tutorialUrlArray = $("#tutorial-type").text().split('/'); var githubLink = "https://github.com/pytorch/rl/tree/tutorial_py_dup/sphinx-tutorials/" + tutorialUrlArray[tutorialUrlArray.length - 1] + ".py", - notebookLink = $(".reference.download")[1].href, + notebookLink = $(".reference.download")[0].href, notebookDownloadPath = notebookLink.split('_downloads')[1], colabLink = "https://colab.research.google.com/github/pytorch/rl/blob/gh-pages/_downloads" + notebookDownloadPath; diff --git a/docs/source/_templates/layout.html b/docs/source/_templates/layout.html index 543edfac202..f575219e940 100644 --- a/docs/source/_templates/layout.html +++ b/docs/source/_templates/layout.html @@ -61,7 +61,7 @@ if (downloadNote.length >= 1) { var tutorialUrl = $("#tutorial-type").text(); var githubLink = "https://github.com/pytorch/rl/blob/main/tutorials/sphinx-tutorials/" + tutorialUrl + ".py", - notebookLink = $(".reference.download")[1].href, + notebookLink = $(".reference.download")[0].href, notebookDownloadPath = notebookLink.split('_downloads')[1], colabLink = "https://colab.research.google.com/github/pytorch/rl/blob/gh-pages/main/_downloads" + notebookDownloadPath;