tridactyl/scripts/make_tutorial.sh

17 lines
405 B
Bash
Raw Normal View History

#!/bin/sh
# Combine tutorial markdown and template
cd src/static/clippy
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-1)
sed "/REPLACETHIS/,$ d" tutor.template.html > "$dest$fileroot.html"
2018-09-30 15:25:14 +00:00
"$(npm bin)/marked" $page >> "$dest$fileroot.html"
sed "1,/REPLACETHIS/ d" tutor.template.html >> "$dest$fileroot.html"
done