diff --git a/docs/assets/twiinIT.png b/docs/assets/twiinIT.png new file mode 100644 index 0000000..8d0ac4f Binary files /dev/null and b/docs/assets/twiinIT.png differ diff --git a/docs/build_doc.py b/docs/build_doc.py new file mode 100644 index 0000000..81c7599 --- /dev/null +++ b/docs/build_doc.py @@ -0,0 +1,34 @@ +import os +from pathlib import Path +import shutil + +CWD = Path.cwd() +SOURCEDIR = "source" +BUILDDIR = "_build" +NOTEBOOK_FOLDER = "user_guide/notebooks" + +RESOURCES = ("tf.html", "textures/twiinIT_logo.png", "textures/twiinIT.png") + + +def main(): + build_documentation() + copy_notebook_resources() + + +def build_documentation(): + return os.system("sphinx-build -b html -d _build/doctrees ./source _build") + + +def copy_notebook_resources(): + for resource in RESOURCES: + source_path = CWD / SOURCEDIR / NOTEBOOK_FOLDER / resource + target_path = CWD / BUILDDIR / NOTEBOOK_FOLDER / resource + + if not os.path.exists(target_path.parents[0]): + os.mkdir(target_path.parents[0]) + + shutil.copyfile(source_path, target_path) + + +if __name__ == "__main__": + main() diff --git a/docs/source/conf.py b/docs/source/conf.py index 20e0a96..52f1982 100644 --- a/docs/source/conf.py +++ b/docs/source/conf.py @@ -43,6 +43,7 @@ "sphinx.ext.viewcode", "nbsphinx", "autoapi.extension", + "nbsphinx_link", ] # Add any paths that contain templates here, relative to this directory. @@ -97,7 +98,7 @@ def setup(sphinx): # -- Options for HTML output ------------------------------------------------- -html_logo = "../assets/twiinIT_grayscale.svg" +html_logo = "../assets/twiinIT.png" html_theme = "furo" diff --git a/docs/source/user_guide/notebooks/turbofan.nblink b/docs/source/user_guide/notebooks/turbofan.nblink new file mode 100644 index 0000000..e64ade8 --- /dev/null +++ b/docs/source/user_guide/notebooks/turbofan.nblink @@ -0,0 +1,6 @@ +{ + "path": "../../../../pyturbo/notebooks/turbofan.ipynb", + "extra-media": [ + "../../../../pyturbo/notebooks/textures" + ] +} \ No newline at end of file diff --git a/environment-dev.yml b/environment-dev.yml index d21b1f6..377a2fb 100644 --- a/environment-dev.yml +++ b/environment-dev.yml @@ -20,3 +20,4 @@ dependencies: - pythonocc-core - ambiance - furo + - nbsphinx-link diff --git a/pyturbo/notebooks/turbofan.ipynb b/pyturbo/notebooks/turbofan.ipynb index cf32bb8..9cce1d8 100644 --- a/pyturbo/notebooks/turbofan.ipynb +++ b/pyturbo/notebooks/turbofan.ipynb @@ -5,7 +5,7 @@ "id": "ba8b4132-1828-48fa-bf8c-1a1edbcac52f", "metadata": {}, "source": [ - "# Context\n", + "# Turbofan Tutorial\n", "`pyturbo` library is provided by twiinIT to assembly a simple turbofan system.\n", "\n", "The library is made of components: \n", @@ -47,18 +47,7 @@ { "cell_type": "code", "execution_count": null, - "id": "c5c5219f-88e7-403f-a14d-65946efdb52d", - "metadata": {}, - "outputs": [], - "source": [ - "# Product Breakdown Structure\n", - "sys.to_d3()" - ] - }, - { - "cell_type": "code", - "execution_count": null, - "id": "52efdcc7-37ce-475b-a125-59783a5f23ff", + "id": "6dc31fdb-6dd3-404c-afb4-6fb8c44c488c", "metadata": {}, "outputs": [], "source": [ @@ -111,7 +100,7 @@ "id": "34ea90e8-ecac-4e4f-8c64-14eeb25d7084", "metadata": {}, "source": [ - "## direct mode\n", + "## Direct mode\n", "`thrust` is computed from `fuel_W`." ] },