-
Notifications
You must be signed in to change notification settings - Fork 4.2k
Enable multi-level nav in the left nav bar #3125
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
Merged
Changes from all commits
Commits
Show all changes
17 commits
Select commit
Hold shift + click to select a range
5ca0731
Enable multi-level nav in the left nav bar
svekars def575b
Update intro.py
svekars 4865453
Update .lycheeignore
svekars 7136e5d
Update
svekars 75efdbd
Add beginner_source/introyt/introy.py to validate_tutorial_built.py t…
svekars 294216d
Update
svekars 6578068
Update
svekars 49ba46e
Reduce num_workers to 0
svekars 1a46194
Apply suggestions from code review
svekars 61bf3b9
Add .js to keep left nav expanded
svekars de145c0
Expand only Learn the Basics
svekars 705e52c
Update
svekars 80603c2
Update
svekars 5043bf5
fix link
svekars 216f783
Updated
svekars 47d2821
Merge branch 'main' into third-nav
svekars 81cdebe
Remember user selection for collapsed/uncollapsed content; remove the…
svekars File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,52 @@ | ||
document.addEventListener("DOMContentLoaded", function() { | ||
// Select all <li> elements with the class "toctree-l1" | ||
var toctreeItems = document.querySelectorAll('li.toctree-l1'); | ||
|
||
toctreeItems.forEach(function(item) { | ||
// Find the link within the item | ||
var link = item.querySelector('a'); | ||
var nestedList = item.querySelector('ul'); | ||
|
||
if (link && nestedList) { | ||
// Create a span element for the "[+]" or "[-]" sign | ||
var expandSign = document.createElement('span'); | ||
expandSign.style.cursor = 'pointer'; // Make it look clickable | ||
|
||
// Use the link text as a unique key for localStorage | ||
var sectionKey = 'section_' + link.textContent.trim().replace(/\s+/g, '_'); | ||
|
||
// Retrieve the saved state from localStorage | ||
var isExpanded = localStorage.getItem(sectionKey); | ||
|
||
// If no state is saved, default to expanded for "Learn the Basics" and collapsed for others | ||
if (isExpanded === null) { | ||
isExpanded = (link.textContent.trim() === 'Learn the Basics') ? 'true' : 'false'; | ||
localStorage.setItem(sectionKey, isExpanded); | ||
} | ||
|
||
if (isExpanded === 'true') { | ||
nestedList.style.display = 'block'; // Expand the section | ||
expandSign.textContent = '[-] '; // Show "[-]" since it's expanded | ||
} else { | ||
nestedList.style.display = 'none'; // Collapse the section | ||
expandSign.textContent = '[+] '; // Show "[+]" since it's collapsed | ||
} | ||
|
||
// Add a click event to toggle the nested list | ||
expandSign.addEventListener('click', function() { | ||
if (nestedList.style.display === 'none') { | ||
nestedList.style.display = 'block'; | ||
expandSign.textContent = '[-] '; // Change to "[-]" when expanded | ||
localStorage.setItem(sectionKey, 'true'); // Save state | ||
} else { | ||
nestedList.style.display = 'none'; | ||
expandSign.textContent = '[+] '; // Change back to "[+]" when collapsed | ||
localStorage.setItem(sectionKey, 'false'); // Save state | ||
} | ||
}); | ||
|
||
// Insert the sign before the link | ||
link.parentNode.insertBefore(expandSign, link); | ||
} | ||
}); | ||
}); |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,29 +1,10 @@ | ||
`Introduction <introyt/introyt1_tutorial.html>`_ || | ||
`Tensors <introyt/tensors_deeper_tutorial.html>`_ || | ||
`Autograd <introyt/autogradyt_tutorial.html>`_ || | ||
`Building Models <introyt/modelsyt_tutorial.html>`_ || | ||
`TensorBoard Support <introyt/tensorboardyt_tutorial.html>`_ || | ||
`Training Models <introyt/trainingyt.html>`_ || | ||
`Model Understanding <introyt/captumyt.html>`_ | ||
|
||
Introduction to PyTorch - YouTube Series | ||
======================================== | ||
|
||
Authors: | ||
`Brad Heintz <https://github.com/fbbradheintz>`_ | ||
|
||
This tutorial follows along with the `PyTorch Beginner Series <https://www.youtube.com/playlist?list=PL_lsbAsL_o2CTlGHgMxNrKhzP97BaG9ZN>`_ on YouTube. | ||
|
||
`This tutorial assumes a basic familiarity with Python and Deep Learning concepts.` | ||
|
||
Running the Tutorial Code | ||
------------------------- | ||
You can run this tutorial in a couple of ways: | ||
This page has been moved. | ||
|
||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Woah, would this autoredirect? There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Yes, tested in other pages like this. |
||
- **In the cloud**: This is the easiest way to get started! Each section has a Colab link at the top, which opens a notebook with the code in a fully-hosted environment. Pro tip: Use Colab with a GPU runtime to speed up operations *Runtime > Change runtime type > GPU* | ||
- **Locally**: This option requires you to setup PyTorch and torchvision first on your local machine (`installation instructions <https://pytorch.org/get-started/locally/>`_). Download the notebook or copy the code into your favorite IDE. | ||
Redirecting now... | ||
|
||
.. include:: /beginner_source/introyt/tocyt.txt | ||
.. raw:: html | ||
|
||
.. toctree:: | ||
:hidden: | ||
<meta http-equiv="Refresh" content="0; url='https://pytorch.org/tutorials/beginner/introyt/introyt_index.html'" /> |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,38 @@ | ||
""" | ||
`Introduction <introyt/introyt1_tutorial.html>`_ || | ||
`Tensors <introyt/tensors_deeper_tutorial.html>`_ || | ||
`Autograd <introyt/autogradyt_tutorial.html>`_ || | ||
`Building Models <introyt/modelsyt_tutorial.html>`_ || | ||
`TensorBoard Support <introyt/tensorboardyt_tutorial.html>`_ || | ||
`Training Models <introyt/trainingyt.html>`_ || | ||
`Model Understanding <introyt/captumyt.html>`_ | ||
|
||
Introduction to PyTorch - YouTube Series | ||
======================================== | ||
|
||
Authors: | ||
`Brad Heintz <https://github.com/fbbradheintz>`_ | ||
|
||
This tutorial follows along with the `PyTorch Beginner Series <https://www.youtube.com/playlist?list=PL_lsbAsL_o2CTlGHgMxNrKhzP97BaG9ZN>`_ on YouTube. | ||
|
||
`This tutorial assumes a basic familiarity with Python and Deep Learning concepts.` | ||
|
||
Running the Tutorial Code | ||
------------------------- | ||
You can run this tutorial in a couple of ways: | ||
|
||
- **On the cloud**: This is the easiest way to get started! Each section has a Colab link at the top, which opens a notebook with the code in a fully-hosted environment. Pro tip: Use Colab with a GPU runtime to speed up operations *Runtime > Change runtime type > GPU* | ||
- **Locally**: This option requires you to set up PyTorch and torchvision on your local machine (`installation instructions <https://pytorch.org/get-started/locally/>`_). Download the notebook or copy the code into your favorite IDE. | ||
|
||
.. toctree:: | ||
:maxdepth: 2 | ||
:hidden: | ||
|
||
introyt1_tutorial | ||
tensors_deeper_tutorial | ||
autogradyt_tutorial | ||
modelsyt_tutorial | ||
tensorboardyt_tutorial | ||
trainingyt | ||
captumyt | ||
""" |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
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.
@cassiebreviu - can you confirm this is the new account that should be listed here.
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.
Yes
https://github.com/cassiebreviu/
is correct. Thanks!