Skip to content

Commit

Permalink
Fix "Run in Colab" and "Download Notebook" links in tutorials (#2268)
Browse files Browse the repository at this point in the history
  • Loading branch information
kurtamohler committed Jul 4, 2024
1 parent ba6897d commit c4db149
Show file tree
Hide file tree
Showing 3 changed files with 3 additions and 3 deletions.
2 changes: 1 addition & 1 deletion docs/source/_static/js/theme.js
Original file line number Diff line number Diff line change
Expand Up @@ -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 = $(".sphx-glr-download-jupyter").find(".download.reference")[0].href,
notebookDownloadPath = notebookLink.split('_downloads')[1],
colabLink = "https://colab.research.google.com/github/pytorch/rl/blob/gh-pages/main/_downloads" + notebookDownloadPath;

Expand Down
2 changes: 1 addition & 1 deletion docs/source/_static/js/torchrl_theme.js
Original file line number Diff line number Diff line change
Expand Up @@ -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 = $(".sphx-glr-download-jupyter").find(".download.reference")[0].href,
notebookDownloadPath = notebookLink.split('_downloads')[1],
colabLink = "https://colab.research.google.com/github/pytorch/rl/blob/gh-pages/_downloads" + notebookDownloadPath;

Expand Down
2 changes: 1 addition & 1 deletion docs/source/_templates/layout.html
Original file line number Diff line number Diff line change
Expand Up @@ -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 = $(".sphx-glr-download-jupyter").find(".download.reference")[0].href,
notebookDownloadPath = notebookLink.split('_downloads')[1],
colabLink = "https://colab.research.google.com/github/pytorch/rl/blob/gh-pages/main/_downloads" + notebookDownloadPath;

Expand Down

0 comments on commit c4db149

Please sign in to comment.