tridactyl/scripts/make_tutorial.sh
glacambre ce0da074a5
Fix make_tutorial
PR#1412 broke tutorial generation by adding a dot at the beginning of
$page. This fixes that.
2019-03-28 06:08:49 +01:00

19 lines
490 B
Bash
Executable file

#!/bin/sh
# Combine tutorial markdown and template
if ! cd src/static/clippy; then
echo "Failed to cd in src/static/clippy. Aborting."
exit
fi
pages=$(ls ./*.md)
dest="../../../generated/static/clippy/"
for page in $pages
do
fileroot=$(echo "$page" | cut -d'.' -f-2)
sed "/REPLACETHIS/,$ d" tutor.template.html > "$dest$fileroot.html"
"$(npm bin)/marked" "$page" >> "$dest$fileroot.html"
sed "1,/REPLACETHIS/ d" tutor.template.html >> "$dest$fileroot.html"
done