tridactyl/scripts/make_tutorial.sh

21 lines
545 B
Bash
Raw Permalink Normal View History

#!/bin/sh
# Combine tutorial markdown and template
2019-03-24 17:29:42 +01:00
if ! cd src/static/clippy; then
echo "Failed to cd in src/static/clippy. Aborting."
exit
fi
2019-03-24 17:29:42 +01:00
pages=$(ls ./*.md)
dest="../../../generated/static/clippy/"
2018-04-14 14:03:54 +01:00
for page in $pages
do
fileroot=$(echo "$page" | cut -d'.' -f-2)
sed "/REPLACETHIS/,$ d" tutor.template.html > "$dest$fileroot.html"
2019-05-31 16:48:53 +01:00
"$(yarn bin)/marked" "$page" >> "$dest$fileroot.html"
sed "1,/REPLACETHIS/ d" tutor.template.html >> "$dest$fileroot.html"
sed -i.bak "s|\.md|.html|g" "$dest$fileroot.html"
done