Files
kumomta/docs/build.sh
T
Wez Furlong a40cf617d3 docs/build.sh: always enable coloring in output
should make it easier to spot the source of the issue
2023-03-11 06:46:07 -07:00

31 lines
787 B
Bash
Executable File

#!/bin/bash
set -e
tracked_markdown=$(mktemp)
trap "rm ${tracked_markdown}" "EXIT"
git ls-tree -r HEAD --name-only docs | egrep '\.(markdown|md)$' > $tracked_markdown
for doc_dep in gelatyx mdbook mdbook-linkcheck mdbook-mermaid mdbook-admonish ; do
if ! hash $doc_dep 2>/dev/null ; then
cargo install $doc_dep --locked
fi
done
if test -z "${CHECK_ONLY}" ; then
gelatyx --language lua --file-list $tracked_markdown --language-config stylua.toml
fi
if ! gelatyx --language lua --color always --file-list $tracked_markdown --language-config stylua.toml --check ; then
echo
echo "Be sure to run ./docs/build.sh to apply formatting before you push changes."
echo
exit 1
fi
set -x
python3 docs/generate-toc.py || exit 1
mdbook-mermaid install docs
mdbook build docs