diff --git a/docs/source/exampledepend.rst b/docs/source/exampledepend.rst new file mode 100644 index 000000000..2528e0330 --- /dev/null +++ b/docs/source/exampledepend.rst @@ -0,0 +1,15 @@ +.. _example_dependencies: + +Example Dependencies +-------------------- + +Some examples use additional dependencies, which are listed in `examples_requirements.txt `_. +The additional requirements should be installed via pip, with the exception of ``astra-toolbox``, +which should be installed via conda: + + :: + + conda install -c astra-toolbox astra-toolbox + pip install -r examples/examples_requirements.txt # Installs other example requirements + +The dependencies can also be installed individually as required. diff --git a/docs/source/examples.rst b/docs/source/examples.rst index 82deea618..fae2d5bcd 100644 --- a/docs/source/examples.rst +++ b/docs/source/examples.rst @@ -6,6 +6,8 @@ Usage Examples .. toctree:: :maxdepth: 1 +.. include:: exampledepend.rst + Organized by Application ------------------------ diff --git a/examples/makeindex.py b/examples/makeindex.py index 944c23686..6e0894a7e 100755 --- a/examples/makeindex.py +++ b/examples/makeindex.py @@ -76,12 +76,18 @@ print(".. _example_notebooks:\n", file=dstfile) with open(src, "r") as srcfile: for line in srcfile: + # Add toctree and include statements after main heading + if line[0:3] == "===": + print(line, end="", file=dstfile) + print("\n.. toctree::\n :maxdepth: 1", file=dstfile) + print("\n.. include:: exampledepend.rst", file=dstfile) + continue # Detect lines containing script filenames m = re.match(r"(\s+)- ([^\s]+).py", line) if m: print(" " + prfx + m.group(2), file=dstfile) else: print(line, end="", file=dstfile) - # Add toctree statements after section headings + # Add toctree statement after section headings if line[0:3] == line[0] * 3 and line[0] in ["=", "-", "^"]: print("\n.. toctree::\n :maxdepth: 1", file=dstfile)