utils/filtron.sh: add generic documentation

Signed-off-by: Markus Heiser <markus.heiser@darmarit.de>
This commit is contained in:
Markus Heiser 2020-04-03 20:24:40 +02:00
parent af988dbf71
commit 853be4e11c
5 changed files with 112 additions and 6 deletions

View file

@ -186,11 +186,7 @@ main() {
debug-off) echo; disable_debug ;;
*) usage "$_usage"; exit 42;;
esac ;;
doc)
echo
echo ".. generic utils/filtron.sh documentation"
;;
doc) rst-doc ;;
*) usage "unknown or missing command $1"; exit 42;;
esac
}
@ -469,6 +465,32 @@ This removes apache site ${APACHE_FILTRON_SITE}."
apache_remove_site "$APACHE_FILTRON_SITE"
}
rst-doc() {
eval "echo \"$(< "${REPO_ROOT}/docs/build-templates/filtron.rst")\""
echo -e "\n.. START install systemd unit"
cat <<EOF
.. tabs::
.. group-tab:: systemd
.. code:: bash
EOF
eval "echo \"$(< "${TEMPLATES}/${SERVICE_SYSTEMD_UNIT}")\"" | prefix_stdout " "
echo -e "\n.. END install systemd unit"
# for DIST_NAME in ubuntu-20.04 arch fedora; do
# (
# DIST_ID=${DIST_NAME%-*}
# DIST_VERS=${DIST_NAME#*-}
# [[ $DIST_VERS =~ $DIST_ID ]] && DIST_VERS=
# # ...
# )
# done
}
# ----------------------------------------------------------------------------
main "$@"
# ----------------------------------------------------------------------------