Skip to content

Commit 0c0852b

Browse files
committed
Enable multi-level nav in the left nav bar
1 parent 904ca90 commit 0c0852b

File tree

7 files changed

+92
-51
lines changed

7 files changed

+92
-51
lines changed

_static/css/custom2.css

Lines changed: 14 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -17,3 +17,17 @@
1717
margin-bottom: 5px;
1818
}
1919
}
20+
21+
/* Left nav for 2nd level nav */
22+
23+
.pytorch-left-menu li.toctree-l2 {
24+
padding-left: 10px;
25+
}
26+
27+
.pytorch-left-menu li.toctree-l2.current > a, {
28+
color: #ee4c2c;
29+
}
30+
31+
.pytorch-left-menu li.toctree-l2.current a:link.reference.internal {
32+
color: #ee4c2c;
33+
}

_templates/layout.html

Lines changed: 19 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,23 @@
11
{% extends "!layout.html" %}
22

3+
4+
<!-- Overrides needed for the multilevel nav -->
5+
{% block menu %}
6+
{% if 'singlehtml' not in builder %}
7+
{% set global_toc = toctree(collapse=theme_collapse_navigation|tobool,
8+
includehidden=theme_includehidden|tobool,
9+
titles_only=True) %}
10+
{% endif %}
11+
{% if global_toc %}
12+
{{ global_toc }}
13+
{% else %}
14+
<!-- Local TOC -->
15+
<div class="local-toc">{{ toc }}</div>
16+
{% endif %}
17+
{% endblock %}
18+
<!-- End of overrides needed for the multilevel nav -->
19+
20+
321
{%- block content %}
422
{{ super() }}
523
<script>
@@ -29,6 +47,7 @@
2947
</div>
3048
{% endblock %}
3149

50+
3251
{% block footer %}
3352
{{ super() }}
3453
<script>

beginner_source/basics/intro.py

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -49,6 +49,16 @@
4949
.. include:: /beginner_source/basics/qs_toc.txt
5050
5151
.. toctree::
52+
:maxdepth: 2
5253
:hidden:
5354
55+
quickstart_tutorial
56+
tensorqs_tutorial
57+
data_tutorial
58+
transforms_tutorial
59+
buildmodel_tutorial
60+
autogradqs_tutorial
61+
optimization_tutorial
62+
saveloadrun_tutorial
63+
5464
"""

beginner_source/introyt.rst

Lines changed: 4 additions & 23 deletions
Original file line numberDiff line numberDiff line change
@@ -1,29 +1,10 @@
1-
`Introduction <introyt/introyt1_tutorial.html>`_ ||
2-
`Tensors <introyt/tensors_deeper_tutorial.html>`_ ||
3-
`Autograd <introyt/autogradyt_tutorial.html>`_ ||
4-
`Building Models <introyt/modelsyt_tutorial.html>`_ ||
5-
`TensorBoard Support <introyt/tensorboardyt_tutorial.html>`_ ||
6-
`Training Models <introyt/trainingyt.html>`_ ||
7-
`Model Understanding <introyt/captumyt.html>`_
8-
91
Introduction to PyTorch - YouTube Series
102
========================================
113

12-
Authors:
13-
`Brad Heintz <https://github.com/fbbradheintz>`_
14-
15-
This tutorial follows along with the `PyTorch Beginner Series <https://www.youtube.com/playlist?list=PL_lsbAsL_o2CTlGHgMxNrKhzP97BaG9ZN>`_ on YouTube.
16-
17-
`This tutorial assumes a basic familiarity with Python and Deep Learning concepts.`
18-
19-
Running the Tutorial Code
20-
-------------------------
21-
You can run this tutorial in a couple of ways:
4+
This page has been moved.
225

23-
- **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*
24-
- **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.
6+
Redirecting now...
257

26-
.. include:: /beginner_source/introyt/tocyt.txt
8+
.. raw:: html
279

28-
.. toctree::
29-
:hidden:
10+
<meta http-equiv="Refresh" content="0; url='https://pytorch.org/tutorials/introyt/introyt'" />

beginner_source/introyt/introyt.py

Lines changed: 40 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,40 @@
1+
"""
2+
`Introduction <introyt/introyt1_tutorial.html>`_ ||
3+
`Tensors <introyt/tensors_deeper_tutorial.html>`_ ||
4+
`Autograd <introyt/autogradyt_tutorial.html>`_ ||
5+
`Building Models <introyt/modelsyt_tutorial.html>`_ ||
6+
`TensorBoard Support <introyt/tensorboardyt_tutorial.html>`_ ||
7+
`Training Models <introyt/trainingyt.html>`_ ||
8+
`Model Understanding <introyt/captumyt.html>`_
9+
10+
Introduction to PyTorch - YouTube Series
11+
========================================
12+
13+
Authors:
14+
`Brad Heintz <https://github.com/fbbradheintz>`_
15+
16+
This tutorial follows along with the `PyTorch Beginner Series <https://www.youtube.com/playlist?list=PL_lsbAsL_o2CTlGHgMxNrKhzP97BaG9ZN>`_ on YouTube.
17+
18+
`This tutorial assumes a basic familiarity with Python and Deep Learning concepts.`
19+
20+
Running the Tutorial Code
21+
-------------------------
22+
You can run this tutorial in a couple of ways:
23+
24+
- **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*
25+
- **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.
26+
27+
.. include:: /beginner_source/introyt/tocyt.txt
28+
29+
.. toctree::
30+
:maxdepth: 2
31+
:hidden:
32+
33+
introyt1_tutorial
34+
tensors_deeper_tutorial
35+
autogradyt_tutorial
36+
modelsyt_tutorial
37+
tensorboardyt_tutorial
38+
trainingyt
39+
captumyt
40+
"""

conf.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -238,7 +238,7 @@ def reset_seeds(gallery_conf, fname):
238238
html_logo = '_static/img/pytorch-logo-dark.svg'
239239
html_theme_options = {
240240
'pytorch_project': 'tutorials',
241-
'collapse_navigation': False,
241+
'collapse_navigation': True,
242242
'display_version': True,
243243
'navigation_with_keys': True,
244244
'logo_only': False,

index.rst

Lines changed: 4 additions & 27 deletions
Original file line numberDiff line numberDiff line change
@@ -906,7 +906,7 @@ Additional Resources
906906
.. Page TOC
907907
.. -----------------------------------------
908908
.. toctree::
909-
:maxdepth: 2
909+
:maxdepth: 1
910910
:hidden:
911911
:includehidden:
912912
:caption: PyTorch Recipes
@@ -915,36 +915,13 @@ Additional Resources
915915
See All Prototype Recipes <prototype/prototype_index>
916916

917917
.. toctree::
918-
:maxdepth: 2
918+
:maxdepth: 3
919919
:hidden:
920920
:includehidden:
921921
:caption: Introduction to PyTorch
922922

923923
beginner/basics/intro
924-
beginner/basics/quickstart_tutorial
925-
beginner/basics/tensorqs_tutorial
926-
beginner/basics/data_tutorial
927-
beginner/basics/transforms_tutorial
928-
beginner/basics/buildmodel_tutorial
929-
beginner/basics/autogradqs_tutorial
930-
beginner/basics/optimization_tutorial
931-
beginner/basics/saveloadrun_tutorial
932-
advanced/custom_ops_landing_page
933-
934-
.. toctree::
935-
:maxdepth: 2
936-
:hidden:
937-
:includehidden:
938-
:caption: Introduction to PyTorch on YouTube
939-
940-
beginner/introyt
941-
beginner/introyt/introyt1_tutorial
942-
beginner/introyt/tensors_deeper_tutorial
943-
beginner/introyt/autogradyt_tutorial
944-
beginner/introyt/modelsyt_tutorial
945-
beginner/introyt/tensorboardyt_tutorial
946-
beginner/introyt/trainingyt
947-
beginner/introyt/captumyt
924+
beginner/introyt/introyt
948925

949926
.. toctree::
950927
:maxdepth: 2
@@ -960,7 +937,7 @@ Additional Resources
960937
intermediate/pinmem_nonblock
961938

962939
.. toctree::
963-
:maxdepth: 2
940+
:maxdepth: 1
964941
:includehidden:
965942
:hidden:
966943
:caption: Image and Video

0 commit comments

Comments
 (0)