From 982a9560a5066c096a7a28691bb109058fd92ed0 Mon Sep 17 00:00:00 2001 From: Jirka Borovec Date: Thu, 16 Sep 2021 16:14:37 +0200 Subject: [PATCH] Update notebooks submodule and add tutorial view to docs (#9420) Co-authored-by: Ethan Harris --- .gitignore | 2 ++ _notebooks | 2 +- docs/source/conf.py | 9 ++++++--- docs/source/index.rst | 24 ++++++++++++++---------- 4 files changed, 23 insertions(+), 14 deletions(-) diff --git a/.gitignore b/.gitignore index d6eef48a55..6ad0671fb3 100644 --- a/.gitignore +++ b/.gitignore @@ -16,6 +16,8 @@ docs/source/*.md docs/source/generated docs/source/*/generated docs/source/notebooks +docs/source/_static/images/course_UvA-DL +docs/source/_static/images/lightning_examples # Byte-compiled / optimized / DLL files __pycache__/ diff --git a/_notebooks b/_notebooks index 4fe3370eac..a2fb646811 160000 --- a/_notebooks +++ b/_notebooks @@ -1 +1 @@ -Subproject commit 4fe3370eac9c448eceb36b835ff49ca30de7d404 +Subproject commit a2fb6468112b7e1dad501c3b6a17533a4adfeabc diff --git a/docs/source/conf.py b/docs/source/conf.py index f68338803c..36ec523856 100644 --- a/docs/source/conf.py +++ b/docs/source/conf.py @@ -23,7 +23,6 @@ import pt_lightning_sphinx_theme PATH_HERE = os.path.abspath(os.path.dirname(__file__)) PATH_ROOT = os.path.join(PATH_HERE, "..", "..") PATH_RAW_NB = os.path.join(PATH_ROOT, "_notebooks") -PATH_IPYNB = os.path.join(PATH_HERE, "notebooks") sys.path.insert(0, os.path.abspath(PATH_ROOT)) sys.path.append(os.path.join(PATH_RAW_NB, ".actions")) @@ -43,7 +42,7 @@ spec.loader.exec_module(about) # -- Project documents ------------------------------------------------------- -HelperCLI.copy_notebooks(PATH_RAW_NB, PATH_IPYNB) +HelperCLI.copy_notebooks(PATH_RAW_NB, PATH_HERE, "notebooks") def _transform_changelog(path_in: str, path_out: str) -> None: @@ -110,6 +109,11 @@ extensions = [ "pt_lightning_sphinx_theme.extensions.lightning_tutorials", ] +# Suppress warnings about duplicate labels (needed for PL tutorials) +suppress_warnings = [ + "autosectionlabel.*", +] + # Add any paths that contain templates here, relative to this directory. templates_path = ["_templates"] @@ -145,7 +149,6 @@ language = None # This pattern also affects html_static_path and html_extra_path. exclude_patterns = [ f"{FOLDER_GENERATED}/PULL_REQUEST_TEMPLATE.md", - "notebooks/course_UvA-DL/*", "notebooks/sample-template*", ] diff --git a/docs/source/index.rst b/docs/source/index.rst index c2469d8dca..999c9f9eea 100644 --- a/docs/source/index.rst +++ b/docs/source/index.rst @@ -3,10 +3,16 @@ You can adapt this file completely to your liking, but it should at least contain the root `toctree` directive. -PyTorch Lightning Documentation -=============================== +PyTorch Lightning +================= +.. tutoriallist:: + +.. raw:: html + +
+ .. toctree:: :maxdepth: 1 :name: start @@ -85,19 +91,13 @@ PyTorch Lightning Documentation :maxdepth: 1 :name: Tutorials :caption: Tutorials + :glob: starter/introduction_guide PyTorch Lightning 101 class From PyTorch to PyTorch Lightning [Blog] From PyTorch to PyTorch Lightning [Video] - notebooks/lightning_examples/mnist-hello-world.ipynb - notebooks/lightning_examples/datamodules.ipynb - notebooks/lightning_examples/cifar10-baseline.ipynb - notebooks/lightning_examples/basic-gan.ipynb - notebooks/lightning_examples/mnist-tpu-training.ipynb - notebooks/lightning_examples/text-transformers.ipynb - notebooks/lightning_examples/reinforce-learning-DQN.ipynb - notebooks/lightning_examples/augmentation_kornia.ipynb + notebooks/**/* .. toctree:: :maxdepth: 2 @@ -147,6 +147,10 @@ PyTorch Lightning Documentation governance generated/CHANGELOG.md +.. raw:: html + +
+ Indices and tables ------------------