Files
kumomta/docs/build.sh
T
Wez Furlong 831bfe9aab docs: skeleton for building the docs
Rather than edit SUMMARY.md, you edit docs/generate-toc.py
and it will flesh out sections based on the list of files
in a directory.
2023-02-25 10:50:58 -07:00

30 lines
765 B
Bash
Executable File

#!/bin/bash
tracked_markdown=$(mktemp)
trap "rm ${tracked_markdown}" "EXIT"
git ls-tree -r HEAD --name-only docs | egrep '\.(markdown|md)$' > $tracked_markdown
gelatyx --language lua --file-list $tracked_markdown --language-config stylua.toml
gelatyx --language lua --file-list $tracked_markdown --language-config stylua.toml --check || exit 1
set -x
python3 docs/generate-toc.py || exit 1
if ! hash mdbook 2>/dev/null ; then
cargo install mdbook --locked
fi
if ! hash mdbook-linkcheck 2>/dev/null ; then
cargo install mdbook-linkcheck --locked
fi
if ! hash mdbook-mermaid 2>/dev/null ; then
cargo install mdbook-mermaid --locked
fi
if ! hash gelatyx 2>/dev/null ; then
cargo install gelatyx --locked
fi
mdbook-mermaid install docs
mdbook build docs