1
0
mirror of https://github.com/funkypenguin/geek-cookbook/ synced 2025-12-18 20:21:45 +00:00
Files
geek-cookbook/scripts/markdown-to-markua.sh
2020-06-03 14:42:58 +12:00

16 lines
463 B
Bash
Executable File

#!/bin/bash
for file in `find manuscript -type f -name "*.md"`
do
echo "Processing $file..."
# Markua doesn't know what to do with 4 backticks (````), so convert to 3:
sed -i "s/\`\`\`\`/\`\`\`/g" $file
# Can't use relative paths in a book, so make all paths static
sed -i 's/](\//\](https:\/\/geek-cookbook.funkypenguin.co.nz\//g' $file
# strip emojis
tr -cd '\11\12\15\40-\176' < $file > $file-clean
mv $file-clean $file
done