1
0
This commit is contained in:
2026-05-12 20:00:01 +02:00
parent 1ac05decbd
commit 4869d575af
2 changed files with 25 additions and 1 deletions

View File

@@ -101,5 +101,5 @@ find . -type f -name "*.md" -print0 | while IFS= read -r -d '' mdfile; do
echo "$HTML_END"
} > "$html_final"
echo "Converted: $mdfile -> $html_final (+ .raw)"
echo "Converted: $mdfile"
done

24
watch.sh Executable file
View File

@@ -0,0 +1,24 @@
#!/bin/bash
cd "$(dirname "$0")"
run_converter() {
bash ./convert-md.sh
}
python3 -m http.server 8000 &
SERVER_PID=$!
cleanup() {
echo "Stopping server (PID: $SERVER_PID)..."
kill $SERVER_PID 2>/dev/null
exit 0
}
trap cleanup SIGINT SIGTERM
run_converter
inotifywait -m -e modify -e create -e delete --include '\.md$' -r . 2>/dev/null | while read -r path event file; do
echo "Change detected: $event on $path$file"
run_converter
done