2024-03-29 19:12:32 +00:00
#!/usr/bin/env bash
function error_handler() {
>&2 echo "Exited with BAD EXIT CODE '${2}' in ${0} script at line: ${1}."
exit "$2"
}
trap 'error_handler ${LINENO} $?' ERR
set -o errtrace -o errexit -o nounset -o pipefail
2024-06-26 02:55:03 +00:00
# function to update single file
function update_file() {
2024-06-28 15:03:25 +00:00
local file="$1"
if [[ "$file" == "./Support/FAQ.md" ]]; then
echo "skipping $file since it is in a question and answer format that LLMs cannot handle. They assume you are doing few-shot learning and do not return the full doc."
return
fi
markdown_to_ventilated_prose.py "$file" "$file"
./bin/edit "$file"
markdown_to_ventilated_prose.py "$file" "$file"
2024-06-26 02:55:03 +00:00
}
2024-06-28 15:03:25 +00:00
while IFS= read -r -d '' file; do
update_file "$file"
done < <(find . -type f -name "*.md" -print0)
# update_file "Support/Welcome_Messages.md"
2024-06-26 02:55:03 +00:00
# these are long, problematic files, good for testing.
# not sure why documentation.md likes to get lots of extra newlines added.
2024-06-28 15:03:25 +00:00
# echo 'fyi, running test files, not all files'
# for file in Getting_Started/quick_start.md Support/FAQ.md documentation/documentation.md; do
# update_file "$file"
# done