Commit: 277ba90d2b35be4d1a5093c02d00aec3d30853f6
Parent: ba7c3bb94e0a23d983f20f1a50500105d0650a5c
Author: Randy Palamar
Date: Wed, 25 Oct 2023 05:46:12 -0600
deck2data: replace smu with md2html
md2html makes less mistakes and is faster:
average time from 5 runs of `time deck2data foo.deck > /dev/null`
on a ~4700 card deck:
smu:
0m10.78s real 0m2.51s user 0m00.73s system
md2html:
0m10.04s real 0m2.41s user 0m00.72s system
Diffstat:
1 file changed, 4 insertions(+), 6 deletions(-)
diff --git a/deck2data b/deck2data
@@ -21,9 +21,9 @@ IFS=$(printf $DELIM)
while read id _; do
path="$deck"/"$id"
- front=$(smu "$path"/front.md | tr -d '\n' |
+ front=$(md2html "$path"/front.md | tr -d '\n' |
sed 's;src="\([^"]*\)";src="/_/'$path'/\1";g')
- back=$(smu "$path"/back.md | tr -d '\n' |
+ back=$(md2html "$path"/back.md | tr -d '\n' |
sed 's;src="\([^"]*\)";src="/_/'$path'/\1";g')
extra="$path"/extra.html
@@ -35,7 +35,5 @@ while read id _; do
printf "%s\t%s\t%s\n" "$id" "$front" "$back"
done < $1 \
-| rubify \
-| sed -e 's:/\>:>:g' \
- -e 's:\<\(/audio\):<\1:g' \
- -e 's:\(/audio\)\>:\1>:g'
+| sed 's:\*\(\[[^*]*\)\*:<em>\1</em>:g' \
+| rubify