13 lines
427 B
Bash
13 lines
427 B
Bash
#!/usr/bin/env bash
|
|
for wiki_file in $(find ./ -type f -name '*.md'); do
|
|
echo "Found file: $(basename $wiki_file)"
|
|
file_footnotes=$(grep -Eo "\^[0-9]{1,2}\^" $wiki_file)
|
|
echo -e "Found footnotes:\n$file_footnotes"
|
|
for footnote in $file_footnotes; do
|
|
#Stip ^ signs
|
|
footnote_index=$(echo $footnote | sed -e 's/\^//g')
|
|
markdown_footnote="[^$footnote_index]"
|
|
echo "Converted $footnote to $markdown_footnote"
|
|
done
|
|
done
|