From 81c523dc670fa0e25a5297180a694f0b51049eaa Mon Sep 17 00:00:00 2001 From: Czar Echavez Date: Thu, 9 May 2024 13:43:55 +0100 Subject: [PATCH] #2472: integrating jupyter notebooks into documentation --- .gitignore | 2 ++ docs/conf.py | 32 ++++++++++++++++++- docs/index.rst | 9 ++++-- docs/make.bat | 27 ++++++++++++++++ docs/source/configuration/simulation.rst | 4 +-- docs/source/example_notebooks.rst | 7 +++- docs/source/executed_notebooks.rst | 13 ++++++++ ...a-Manipulation-Customising-Red-Agent.ipynb | 12 +++---- 8 files changed, 94 insertions(+), 12 deletions(-) create mode 100644 docs/source/executed_notebooks.rst diff --git a/.gitignore b/.gitignore index b464566b..0d27eb1c 100644 --- a/.gitignore +++ b/.gitignore @@ -83,6 +83,7 @@ target/ # Jupyter Notebook .ipynb_checkpoints PPO_UC2/ +docs/_static/notebooks/html/*.html # IPython profile_default/ @@ -152,6 +153,7 @@ docs/source/primaite-dependencies.rst src/primaite/outputs/ simulation_output/ sessions/ +PrimAITE-PPO-example-agent.zip # benchmark session outputs benchmark/output diff --git a/docs/conf.py b/docs/conf.py index a666e460..33e192aa 100644 --- a/docs/conf.py +++ b/docs/conf.py @@ -66,6 +66,33 @@ html_theme_options = {"globaltoc_collapse": True, "globaltoc_maxdepth": 2} html_copy_source = False +def get_notebook_links() -> str: + """ + Returns a string which will be added to the RST. + + Allows for dynamic addition of notebooks to the documentation. + """ + notebooks = os.listdir("_static/notebooks/html") + + links = [] + links.append("