#!/bin/sh # script/fmt: format this repo's markdown and CSS with prettier, using # our standard settings. Scope is every markdown and CSS file in the # tree, per REPO_POLICIES.md ("prettier for JS/CSS/Markdown/HTML"). # What is deliberately NOT covered is recorded in .prettierignore, with # the reason next to each entry: the Hugo layout templates, which are # Go templates and not HTML, and content/, whose reformatting was # measured to change the rendered page. set -eu ROOT="$(cd "$(dirname "$0")/.." && pwd -P)" PRETTIER_VERSION="3.4.2" main() { cd "$ROOT" npx --yes "prettier@${PRETTIER_VERSION}" --write \ '**/*.md' '**/*.css' --tab-width 4 --prose-wrap always } main "$@"