-
Notifications
You must be signed in to change notification settings - Fork 7k
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
Add links to collab #7854
Add links to collab #7854
Conversation
# We override sphinx-gallery's example header to prevent sphinx-gallery from | ||
# creating a note at the top of the renderred notebook. | ||
# https://github.com/sphinx-gallery/sphinx-gallery/blob/451ccba1007cc523f39cbcc960ebc21ca39f7b75/sphinx_gallery/gen_rst.py#L1267-L1271 | ||
# This is because we also want to add a link to google collab, so we write our own note in each example. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
quick explanation
sphinx-gallery adds this note by default on top of each example:
We want to add links to collab, and I want to avoid having 2 notes. So I removed the note automatically added by sphinx-gallery and manually added it on each example, along with the "try on collab" link. It now looks like this:
It's a bit more work but I think it's worth it. Looks like this is the recommended way to do it sphinx-gallery/sphinx-gallery#978
@@ -3,6 +3,10 @@ | |||
Optical Flow: Predicting movement with the RAFT model | |||
===================================================== | |||
|
|||
.. note:: | |||
Try on `collab <https://colab.research.google.com/github/pytorch/vision/blob/gh-pages/main/_generated_ipynb_notebooks/plot_optical_flow.ipynb>`_ |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Note that all links point to main
. I don't know how to point to the current version, not sure it's worth it.
I think that in the tutorials repo they literally have a separate ipynb
file which always get outdated... That sounds a lot worse.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
LGTM, thanks Nicolas.
Hey @NicolasHug! You merged this PR, but no labels were added. The list of valid labels is available at https://github.com/pytorch/vision/blob/main/.github/process_commit.py |
Summary: (Note: this ignores all push blocking failures!) Reviewed By: matteobettini Differential Revision: D48900382 fbshipit-source-id: b9f0dca20bcbb33e309d9250bc71da3520048175
Closes #7794