#!/bin/sh
# script/fmt: format the repo's own top-level markdown docs (README.md,
# TODO.md, ...) with prettier, using our standard settings. Scope is
# deliberately limited to top-level docs: site content under content/
# is left untouched so rendered output cannot change.
set -eu

ROOT="$(cd "$(dirname "$0")/.." && pwd -P)"

PRETTIER_VERSION="3.4.2"

main() {
    cd "$ROOT"
    npx --yes "prettier@${PRETTIER_VERSION}" --write \
        '*.md' --tab-width 4 --prose-wrap always
}

main "$@"
