diff --git a/docs/Makefile b/docs/Makefile index 4cbd0908bee..238eb0226ea 100644 --- a/docs/Makefile +++ b/docs/Makefile @@ -15,17 +15,15 @@ help: # Catch-all target: route all unknown targets to Sphinx using the new # "make mode" option. $(O) is meant as a shortcut for $(SPHINXOPTS). -%: Makefile examples tutorials +%: Makefile examples @$(SPHINXBUILD) -M $@ "$(SOURCEDIR)" "$(BUILDDIR)" $(SPHINXOPTS) $(O) examples: - mkdir user-guide/examples - -tutorials: - mkdir user-guide/tutorials + mkdir -p user-guide/examples clean: rm -rf api + rm -rf user-guide/examples @$(SPHINXBUILD) -M $@ "$(SOURCEDIR)" "$(BUILDDIR)" $(SPHINXOPTS) $(O) diff --git a/docs/conf.py b/docs/conf.py index de105472b71..b01ffcd1ee0 100644 --- a/docs/conf.py +++ b/docs/conf.py @@ -144,16 +144,24 @@ def setup(app): ] # Sphinx gallery config +from sphinx_gallery.sorting import ExplicitOrder, FileNameSortKey sphinx_gallery_conf = { "examples_dirs": [ "../examples/examples", - "../examples/tutorials", ], # path to your example scripts "gallery_dirs": [ "user-guide/examples", - "user-guide/tutorials", ], # path to where to save gallery generated output - "nested_sections": True, + 'subsection_order': ExplicitOrder( + [ + '../examples/examples/algorithms', + '../examples/examples/core', + '../examples/examples/visualization', + '../examples/examples/tutorials' + ] + ), + "within_subsection_order": FileNameSortKey, + "nested_sections": False, "copyfile_regex": r"index.rst|.*\.png|.*\.json", "filename_pattern": r".*\.py", "promote_jupyter_magic": True, diff --git a/docs/user-guide/index.rst b/docs/user-guide/index.rst index 853408d8363..7b738f5c583 100644 --- a/docs/user-guide/index.rst +++ b/docs/user-guide/index.rst @@ -9,6 +9,5 @@ User Guide getting-started tools data_models/index - tutorials/index examples/index FAQ diff --git a/examples/examples/index.rst b/examples/examples/index.rst deleted file mode 100644 index 18496722bf3..00000000000 --- a/examples/examples/index.rst +++ /dev/null @@ -1,9 +0,0 @@ -Examples gallery -================ - -The examples gallery provides an overview of different ctapipe modules and how to use them. - -.. toctree:: - visualization/index - algorithms/index - core/index diff --git a/examples/tutorials/README.txt b/examples/examples/tutorials/README.rst similarity index 100% rename from examples/tutorials/README.txt rename to examples/examples/tutorials/README.rst diff --git a/examples/tutorials/calibrated_data_exploration.py b/examples/examples/tutorials/calibrated_data_exploration.py similarity index 100% rename from examples/tutorials/calibrated_data_exploration.py rename to examples/examples/tutorials/calibrated_data_exploration.py diff --git a/examples/tutorials/coordinates_example.py b/examples/examples/tutorials/coordinates_example.py similarity index 100% rename from examples/tutorials/coordinates_example.py rename to examples/examples/tutorials/coordinates_example.py diff --git a/examples/tutorials/ctapipe_handson.py b/examples/examples/tutorials/ctapipe_handson.py similarity index 100% rename from examples/tutorials/ctapipe_handson.py rename to examples/examples/tutorials/ctapipe_handson.py diff --git a/examples/tutorials/ctapipe_overview.py b/examples/examples/tutorials/ctapipe_overview.py similarity index 100% rename from examples/tutorials/ctapipe_overview.py rename to examples/examples/tutorials/ctapipe_overview.py diff --git a/examples/tutorials/ground_frame.png b/examples/examples/tutorials/ground_frame.png similarity index 100% rename from examples/tutorials/ground_frame.png rename to examples/examples/tutorials/ground_frame.png diff --git a/examples/tutorials/raw_data_exploration.py b/examples/examples/tutorials/raw_data_exploration.py similarity index 100% rename from examples/tutorials/raw_data_exploration.py rename to examples/examples/tutorials/raw_data_exploration.py diff --git a/examples/tutorials/theta_square.py b/examples/examples/tutorials/theta_square.py similarity index 100% rename from examples/tutorials/theta_square.py rename to examples/examples/tutorials/theta_square.py diff --git a/examples/tutorials/tilted_ground_frame.png b/examples/examples/tutorials/tilted_ground_frame.png similarity index 100% rename from examples/tutorials/tilted_ground_frame.png rename to examples/examples/tutorials/tilted_ground_frame.png