Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fix "Run in Colab" and "Download Notebook" links in tutorials #2268

Merged
merged 1 commit into from
Jul 4, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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
Loading