2018-04-13 23:30:53 +01:00
|
|
|
#!/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
|
2018-04-13 23:30:53 +01:00
|
|
|
|
2019-03-24 17:29:42 +01:00
|
|
|
pages=$(ls ./*.md)
|
2018-04-13 23:30:53 +01:00
|
|
|
dest="../../../generated/static/clippy/"
|
|
|
|
|
2018-04-14 14:03:54 +01:00
|
|
|
for page in $pages
|
2018-04-13 23:30:53 +01:00
|
|
|
do
|
2019-03-28 06:08:49 +01:00
|
|
|
fileroot=$(echo "$page" | cut -d'.' -f-2)
|
2018-04-13 23:30:53 +01:00
|
|
|
sed "/REPLACETHIS/,$ d" tutor.template.html > "$dest$fileroot.html"
|
2019-05-31 16:48:53 +01:00
|
|
|
"$(yarn bin)/marked" "$page" >> "$dest$fileroot.html"
|
2018-04-13 23:30:53 +01:00
|
|
|
sed "1,/REPLACETHIS/ d" tutor.template.html >> "$dest$fileroot.html"
|
2024-01-20 14:35:10 -08:00
|
|
|
sed -i.bak "s|\.md|.html|g" "$dest$fileroot.html"
|
2018-04-13 23:30:53 +01:00
|
|
|
done
|