Created
May 2, 2023 14:41
-
-
Save manfromth3m0oN/fe8d6892c8266a9cf3a170fc879d37e3 to your computer and use it in GitHub Desktop.
Markdown Wordcount Script
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/bin/bash | |
if [ $(uname -s) == "Linux" ] | |
then | |
sed=sed | |
elif [ $(uname -s) == "Darwin" ] | |
then | |
sed=gsed | |
fi | |
$sed '/^```/,/^```/d' | $sed 's/#\+ //g;s/\\\w\+\({\w\+}\)\?//g;s/\[\w\]//g;s/{[[:digit:]]\.[[:digit:]]\(cm\)\?}//g;s/!\[\w\+\](\w\+)//g;s/!\[[A-Z a-z]\+\].\+//g;/^[[:space:]]*$/d;/`*\+`/d' | tr -d "{}|-()[]!:>" |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
cat *.md | ./coverage.sh | wc -l |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment