Skip to content

Commit

Permalink
Fix "Run in Colab" and "Download Notebook" links in tutorials
Browse files Browse the repository at this point in the history
  • Loading branch information
kurtamohler committed Jul 3, 2024
1 parent ba6897d commit 99d257f
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 = $(".reference.download")[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 = $(".reference.download")[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 = $(".reference.download")[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 99d257f

Please sign in to comment.