diff --git a/.ldoc/build_versioned_docs.sh b/.ldoc/build_versioned_docs.sh new file mode 100755 index 0000000..728103f --- /dev/null +++ b/.ldoc/build_versioned_docs.sh @@ -0,0 +1,98 @@ +#!/usr/bin/env bash + +# place this file in mod ".ldoc" directory + + +d_config="$(dirname $(readlink -f $0))" + +cd "${d_config}/.." + +d_root="$(pwd)" +d_export="${d_export:-${d_root}/docs/reference}" + +cmd_ldoc="${d_root}/../ldoc/ldoc.lua" +if test -f "${cmd_ldoc}"; then + if test ! -x "${cmd_ldoc}"; then + chmod +x "${cmd_ldoc}" + fi +else + cmd_ldoc="ldoc" +fi + +# clean old files +rm -rf "${d_export}" + +# store current branch +main_branch="$(git branch --show-current)" + +html_out="\n\n\n\n\n\n\n" + +cd "${d_root}" +git checkout ${main_branch} + +echo -e "${html_out}" > "${d_export}/index.html" + +echo -e "\nDone!"