spiff-arena/docs/bin/edit_all
Kevin Burnett 5df1262dca
Proofing updates (#1838)
* update in place with python

* split files into chunks

* working chunking and updated quick start

* edits

* sanity check

* give up on faq page, long docs work

* debug

* system prompt updates, etc

* use temp file for output

* refactor

* remove dup import

* generate diff file

* check diff output to make sure it looks reasonable

* add overall results

* update script

* update script

* update script

* edits

* fix function

---------

Co-authored-by: burnettk <burnettk@users.noreply.github.com>
2024-06-28 08:03:25 -07:00

34 lines
1.1 KiB
Bash
Executable File

#!/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
# function to update single file
function update_file() {
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"
}
while IFS= read -r -d '' file; do
update_file "$file"
done < <(find . -type f -name "*.md" -print0)
# update_file "Support/Welcome_Messages.md"
# these are long, problematic files, good for testing.
# not sure why documentation.md likes to get lots of extra newlines added.
# 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