1
0
mirror of https://github.com/funkypenguin/geek-cookbook/ synced 2025-12-13 01:36:23 +00:00

Prevent markdown formatting from breaking leanpub render

This commit is contained in:
David Young
2020-06-04 09:57:15 +12:00
committed by GitHub
parent 9c0b3942a5
commit 418ca08c08
10 changed files with 134 additions and 111 deletions

View File

@@ -5,10 +5,22 @@ do
echo "Processing $file..."
# Markua doesn't know what to do with 4 backticks (````), so convert to 3:
sed -ie "s/\`\`\`\`/\`\`\`/g" $file
sed -i "s/\`\`\`\`/\`\`\`/g" $file
# Can't use relative paths in a book, so make all paths static
sed -ie 's/(\//(https:\/\/geek-cookbook.funkypenguin.co.nz\/)/g' $file
sed -i 's/](\//\](https:\/\/geek-cookbook.funkypenguin.co.nz\//g' $file
# GitHub emojis look beautiful but don't render nicely
sed -i 's/:[a-z\ ]://g' $file
# Animated gifs make leanpub fail, so strip 'em out by deleting the entire line
sed -i '/.gif/d' $file
# Strip out mkdocs admonitions
sed -i '/!!!/d' $file
# Change highlights to bold underlines
sed -iE 's/==(.*)==/___\1___/' $file
# strip emojis
tr -cd '\11\12\15\40-\176' < $file > $file-clean