Skip to content

Commit 0c15aec

Browse files
committed
dynamic submodules
1 parent 6a43e92 commit 0c15aec

File tree

2 files changed

+29
-8
lines changed

2 files changed

+29
-8
lines changed

docs/source/modules.rst

Lines changed: 0 additions & 8 deletions
This file was deleted.

driver-ci

Lines changed: 29 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -63,6 +63,35 @@ INDEX_DST="$DOCS_SOURCE_DIR/index.md"
6363
echo '```'
6464
} > "$INDEX_DST"
6565

66+
# === Generate modules.rst from amago package ===
67+
MODULES_RST="$DOCS_SOURCE_DIR/modules.rst"
68+
AMAGO_SRC="$TMP_DIR/amago-crr_k/amago"
69+
70+
echo "Generating modules.rst from $AMAGO_SRC..."
71+
72+
{
73+
echo "API"
74+
echo "==="
75+
echo ""
76+
echo ".. autosummary::"
77+
echo " :toctree: generated"
78+
echo " :recursive:"
79+
echo ""
80+
81+
find "$AMAGO_SRC" -type f -name '__init__.py' | while read -r init_file; do
82+
mod_path="${init_file%/__init__.py}"
83+
mod_path="${mod_path#"$TMP_DIR/amago-crr_k"/}"
84+
mod_path="${mod_path//\//.}"
85+
86+
# Exclude the top-level "amago" itself
87+
if [[ "$mod_path" != "amago" ]]; then
88+
echo " $mod_path"
89+
fi
90+
done | sort
91+
} > "$MODULES_RST"
92+
93+
echo "modules.rst updated."
94+
6695
# === Build Sphinx docs ===
6796
cd "$ROOT_DIR/docs"
6897
make clean

0 commit comments

Comments
 (0)