diff --git a/.gitignore b/.gitignore index 0d27eb1c..448db6ae 100644 --- a/.gitignore +++ b/.gitignore @@ -83,7 +83,7 @@ target/ # Jupyter Notebook .ipynb_checkpoints PPO_UC2/ -docs/_static/notebooks/html/*.html +docs/source/notebooks/*.ipynb # IPython profile_default/ diff --git a/README.md b/README.md index 2265538a..3fd73b53 100644 --- a/README.md +++ b/README.md @@ -137,7 +137,22 @@ python -m jupyter notebook ``` Then, click the URL provided by the jupyter command to open the jupyter application in your browser. You can also open notebooks in your IDE if supported. -## 📚 Building documentation +## 📚 Documentation + +### Pre requisites + +Building the documentation requires the installation of Pandoc + +##### Unix +```bash +sudo apt-get install pandoc +``` + +##### Other operating systems +Follow the steps in https://pandoc.org/installing.html + +### Building the documentation + The PrimAITE documentation can be built with the following commands: ##### Unix diff --git a/docs/Makefile b/docs/Makefile index bd4ef1db..2346738f 100644 --- a/docs/Makefile +++ b/docs/Makefile @@ -6,8 +6,6 @@ SPHINXBUILD ?= sphinx-build SOURCEDIR = . BUILDDIR = _build -JUPYTEROUTPUTPATH="_static\notebooks\html" - # Remove command is different depending on OS ifdef OS RM = IF exist $(AUTOSUMMARY) ( RMDIR $(AUTOSUMMARY) /s /q ) @@ -31,8 +29,4 @@ clean: %: Makefile | clean pip-licenses --format=rst --with-urls --output-file=source/primaite-dependencies.rst - jupyter nbconvert --execute --to html --output-dir _static/notebooks/html ../src/primaite/**/*.ipynb - - cp -r ../src/primaite/notebooks/_package_data _static/notebooks/html/_package_data _static/notebooks/html/_package_data - @$(SPHINXBUILD) -M $@ "$(SOURCEDIR)" "$(BUILDDIR)" $(SPHINXOPTS) $(O) diff --git a/docs/conf.py b/docs/conf.py index 33e192aa..008c23a1 100644 --- a/docs/conf.py +++ b/docs/conf.py @@ -9,7 +9,9 @@ import datetime # -- Project information ----------------------------------------------------- # https://www.sphinx-doc.org/en/master/usage/configuration.html#project-information import os +import shutil import sys +from pathlib import Path from typing import Any import furo # noqa @@ -43,11 +45,12 @@ html_title = f"{project} v{release} docs" # ones. extensions = [ "sphinx.ext.autodoc", # Core Sphinx library for auto html doc generation from docstrings - "sphinx.ext.autosummary", # Create summary tables for modules/classes/methods etc + # "sphinx.ext.autosummary", # Create summary tables for modules/classes/methods etc "sphinx.ext.intersphinx", # Link to other project's documentation (see mapping below) "sphinx.ext.viewcode", # Add a link to the Python source code for classes, functions etc. "sphinx.ext.todo", "sphinx_copybutton", # Adds a copy button to code blocks + "nbsphinx", ] templates_path = ["_templates"] @@ -64,33 +67,7 @@ html_theme = "furo" html_static_path = ["_static"] 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("