docs: add Sphinx documentation build and deploy workflow
Some checks failed
CVE Scan & Docker Build / security-scan (push) Successful in 3m12s
CVE Scan & Docker Build / build-and-push (push) Successful in 2m38s
Build & Deploy Docs / build-and-deploy (push) Failing after 1m31s

- Add Gitea Actions workflow to build and deploy docs on push to main
- Generate Sphinx reference documentation for all apps and modules
- Deploy versioned and latest docs via rsync over SSH
This commit is contained in:
2026-05-23 06:11:05 -04:00
parent 50dffe688b
commit f8a2cf0c3d
114 changed files with 1797 additions and 2 deletions

42
docs/regenerate_docs.sh Executable file
View File

@@ -0,0 +1,42 @@
#!/usr/bin/env bash
# Regenerate Sphinx API reference for every Mnemosyne app, then build HTML.
# Drives both local development and the CI pipeline.
set -euo pipefail
cd "$(dirname "$0")"
APPS=(themis library llm_manager mcp_server)
SOURCE_REF=source/reference/apps
PACKAGE_ROOT=../mnemosyne
make clean
mkdir -p "$SOURCE_REF"
# Per-app subdir so each app gets its own modules.rst (sphinx-apidoc
# overwrites the file otherwise, leaving only the last app in the index).
for app in "${APPS[@]}"; do
sphinx-apidoc \
--force \
--separate \
--module-first \
--output-dir "$SOURCE_REF/$app" \
"$PACKAGE_ROOT/$app" \
"$PACKAGE_ROOT/$app/migrations" \
"$PACKAGE_ROOT/$app/tests"
done
# Write a top-level apps.rst that toctree's every app's modules.rst.
{
echo "Applications"
echo "============"
echo
echo ".. toctree::"
echo " :maxdepth: 2"
echo
for app in "${APPS[@]}"; do
echo " $app/modules"
done
} > "$SOURCE_REF/index.rst"
make html