From 7fa25b41f965d9d6ecc6360001606b9fb6dcfaec Mon Sep 17 00:00:00 2001 From: Juergen Repp Date: Thu, 5 Dec 2024 21:05:32 +0100 Subject: [PATCH] readthedocs: add sphinx-finished.sh A script to fix index.html is added. Signed-off-by: Juergen Repp --- sphinx/sphinx-finished.sh | 23 +++++++++++++++++++++++ 1 file changed, 23 insertions(+) create mode 100755 sphinx/sphinx-finished.sh diff --git a/sphinx/sphinx-finished.sh b/sphinx/sphinx-finished.sh new file mode 100755 index 000000000..83a670a72 --- /dev/null +++ b/sphinx/sphinx-finished.sh @@ -0,0 +1,23 @@ +#!/usr/bin/env bash +# SPDX-License-Identifier: BSD-2 + +# +# This script is configured to run as part of the sphinx build +# through API events registered in conf.py. +# This script runs on event build-finished. +# +# This would be better served by handling the events +# html-collect-page --> for add .nojekyll +# html-page-context --> for fixing the span's done with sed. +# +# For the case of time, we just left this script as is and run it as a +# post sphinx build command event :-p +# + +set -eo pipefail + +find "${SPHINX_OUTDIR}" -name \*.html -exec \ + sed -i 's/\&\#/\&\#/g' {} \; +touch "${SPHINX_OUTDIR}"/.nojekyll + +exit 0