Skip to content

Commit

Permalink
Update format-markdown.sh
Browse files Browse the repository at this point in the history
  • Loading branch information
ralfhandl committed Aug 27, 2024
1 parent 4a8c4ca commit 59decdf
Showing 1 changed file with 3 additions and 1 deletion.
4 changes: 3 additions & 1 deletion scripts/format-markdown.sh
Original file line number Diff line number Diff line change
@@ -1,5 +1,7 @@
#!/bin/bash

SRCDIR="$(dirname "${BASH_SOURCE[0]}")" # check on Windows

for filename in $*; do
# mostly to format code blocks with examples, unfortunately messes up bullet lists and tables
npx prettier --write --single-quote $filename
Expand All @@ -9,5 +11,5 @@ for filename in $*; do
sed -E -e "s/ +\|/ |/g" -e "s/\| +/| /g" -e "s/-----+/----/g" $filename > $filename.tmp && mv $filename.tmp $filename

# repair the bullet lists and various other markdown formatting issues
npx --yes markdownlint-cli --fix --config .markdownlint.yaml $filename
npx --yes markdownlint-cli --fix --config $SRCDIR/../.markdownlint.yaml $filename
done

0 comments on commit 59decdf

Please sign in to comment.