mirror of
https://github.com/revarbat/BOSL2.git
synced 2025-09-25 20:20:01 +02:00
Initial script to generate tutorial images.
This commit is contained in:
41
scripts/make_tutorials.sh
Executable file
41
scripts/make_tutorials.sh
Executable file
@@ -0,0 +1,41 @@
|
||||
#!/bin/bash
|
||||
|
||||
FORCED=""
|
||||
FILES=""
|
||||
DISPMD=""
|
||||
for opt in "$@" ; do
|
||||
case $opt in
|
||||
-f ) FORCED=$opt ;;
|
||||
-d ) DISPMD=$opt ;;
|
||||
-* ) echo "Unknown option $opt"; exit -1 ;;
|
||||
* ) FILES="$FILES $opt" ;;
|
||||
esac
|
||||
done
|
||||
|
||||
if [[ "$FILES" != "" ]]; then
|
||||
PREVIEW_LIBS="$FILES"
|
||||
else
|
||||
PREVIEW_LIBS="FractalTree"
|
||||
fi
|
||||
|
||||
dir="$(basename $PWD)"
|
||||
if [ "$dir" = "BOSL2" ]; then
|
||||
cd BOSL2.wiki
|
||||
elif [ "$dir" != "BOSL2.wiki" ]; then
|
||||
echo "Must run this script from the BOSL2 or BOSL2/BOSL2.wiki directories."
|
||||
exit 1
|
||||
fi
|
||||
|
||||
rm -f tmp_*.scad
|
||||
for base in $PREVIEW_LIBS; do
|
||||
base="$(basename $base .md)"
|
||||
mkdir -p images/tutorials
|
||||
rm -f images/tutorials/*.png images/tutorials/*.gif
|
||||
echo "$base.md"
|
||||
../scripts/tutorial_gen.py ../tutorials/$base.md -o Tutorial-$base.md $FORCED -I images/tutorials/ || exit 1
|
||||
if [ "$DISPMD" != "" ]; then
|
||||
open -a Typora Tutorial-$base.md
|
||||
fi
|
||||
done
|
||||
|
||||
|
Reference in New Issue
Block a user