Use gifs to improve documentation. (#21)

Former-commit-id: 40e5ccedcf5d1ca8f0d5cc373ba3b3c4cc2d6c6a
This commit is contained in:
David Himmelstrup 2019-09-28 21:35:42 +08:00 committed by GitHub
commit dfd52961ae
50 changed files with 512 additions and 129 deletions

11
docs/gen_doc_gifs.sh Executable file
View file

@ -0,0 +1,11 @@
#!/usr/bin/env bash
ROOT=`stack path --project-root`
for src in $ROOT/examples/doc_*.hs; do
BASE=`basename $src .hs`
DST=$ROOT/docs/gifs/$BASE.gif
if [[ "$src" -nt "$DST" ]]; then
echo stack $src render -o $DST
stack $src render -o $DST
fi
done

View file

@ -1,5 +1,6 @@
#!/usr/bin/env bash
ROOT=`stack path --project-root`
EXAMPLES='boundingbox colormaps goo latex_basic latex_color latex_draw
latex_wheel raster sphere sunflower tangent_and_normal vector_field'
@ -7,18 +8,18 @@ WIDTH=640
HEIGHT=$((WIDTH*9/16))
FPS=30
SRC_DIR=examples
DST_DIR=docs/rendered
SRC_DIR=$ROOT/examples
DST_DIR=$ROOT/docs/rendered
OPTS='--fps $FPS --width $WIDTH --height $HEIGHT'
cat << EOF > docs/gallery.md
cat << EOF > $ROOT/docs/gallery.md
# Gallery
This file is auto-generated by docs/render_all.sh. DO NOT EDIT.
EOF
for e in $EXAMPLES; do
cat << EOF >> docs/gallery.md
cat << EOF >> $ROOT/docs/gallery.md
## $e
<details>