From 4ac6d59e6cf16b7e5d56d9b6b35d6344ee0e830b Mon Sep 17 00:00:00 2001 From: Dominik Jain Date: Sun, 9 Nov 2025 14:23:01 +0100 Subject: [PATCH] Use redirect instead of copy for index file --- docs/.gitignore | 1 - docs/create_toc.py | 10 ---------- docs/index.md | 2 ++ 3 files changed, 2 insertions(+), 11 deletions(-) create mode 100644 docs/index.md diff --git a/docs/.gitignore b/docs/.gitignore index a91099dc..d86fc2c2 100644 --- a/docs/.gitignore +++ b/docs/.gitignore @@ -2,4 +2,3 @@ /jupyter_execute /conf.py /_build -/index.md diff --git a/docs/create_toc.py b/docs/create_toc.py index 8d6867c9..39490e88 100644 --- a/docs/create_toc.py +++ b/docs/create_toc.py @@ -1,16 +1,6 @@ import os from pathlib import Path -# Copy 01-about/000_intro.md to index.md -# We want the intro to the first chapter to also be the intro to the book, -# and it doesn't seem to be easily possible to get rid of an index file entirely. -directory = Path(__file__).parent -with open(directory / "01-about/000_intro.md", "r", encoding="utf-8") as src: - intro_content = src.read() -with open(directory / "index.md", "w", encoding="utf-8") as dst: - dst.write("\n\n") - dst.write(intro_content) - # This script provides a platform-independent way of making the jupyter-book call (used in pyproject.toml) folder = Path(__file__).parent toc_file = folder / "_toc.yml" diff --git a/docs/index.md b/docs/index.md new file mode 100644 index 00000000..8b9e5dc0 --- /dev/null +++ b/docs/index.md @@ -0,0 +1,2 @@ + +If you are not redirected automatically, [click here](01-about/000_intro.html).