BOSL2/scripts/make_all_docs.sh

28 lines
938 B
Bash
Raw Normal View History

#!/bin/bash
2019-04-24 10:32:38 +00:00
if [[ $# > 0 ]]; then
PREVIEW_LIBS="$@"
else
2019-04-26 10:02:47 +00:00
PREVIEW_LIBS="compat attachments math arrays vectors matrices coords geometry triangulation quaternions hull constants transforms primitives shapes masks paths beziers walls metric_screws threading involute_gears sliders joiners linear_bearings nema_steppers wiring phillips_drive torx_drive debug"
2019-04-24 10:32:38 +00:00
fi
dir="$(basename $PWD)"
2019-04-19 06:45:46 +00:00
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 tmpscad*.scad
for lib in $PREVIEW_LIBS; do
2019-04-24 10:32:38 +00:00
lib="$(basename $lib .scad)"
mkdir -p images/$lib
# rm -f images/$lib/*.png images/$lib/*.gif
echo ../scripts/docs_gen.py ../$lib.scad -o $lib.scad.md -c -i -I images/$lib/
../scripts/docs_gen.py ../$lib.scad -o $lib.scad.md -c -i -I images/$lib/ || exit 1
open -a Typora $lib.scad.md
done