diff --git a/scripts/gx-teaching b/scripts/gx-teaching index 8f7a296..163f567 100755 --- a/scripts/gx-teaching +++ b/scripts/gx-teaching @@ -69,6 +69,7 @@ echo "basedir = $BASEDIR" echo "docker_image = $DOCKER_IMAGE" echo "action = $ACTION" +## Detect Marp SCSS if [ -f "$BASEDIR/.marp/theme.scss" ]; then DOCKER_OPT_MARP_THEME="-v $BASEDIR/.marp:/app/.marp" echo "Theme: detected Marp files. Adding option to command line ($DOCKER_OPT_MARP_THEME)" @@ -76,11 +77,13 @@ else echo "Theme: no theme detected. Using default files" fi +## Detect Mkdocs configuration - old format (full) if [ -f "$BASEDIR/mkdocs.yml" ]; then >&2 echo "Mkdocs: detected mkdocs.yml file. Please rename to mkdocs-patch.yml" exit 1 fi +## Detect Mkdocs configuration - new format (patch) if [ -f "$BASEDIR/mkdocs-patch.yml" ]; then DOCKER_OPT_MKDOCS_CONFIG="-v $BASEDIR/mkdocs-patch.yml:/app/mkdocs-patch.yml" echo "Mkdocs: detected mkdocs-patch.yml file. Adding option to command line ($DOCKER_OPT_MKDOCS_CONFIG)" @@ -88,10 +91,12 @@ else echo "Mkdocs: no mkdocs-patch.yml detected. Using default files" fi +## Detect slides if [ -d "$BASEDIR/slides" ]; then DOCKER_OPT_MARP_PORT="-p 5200:5200" fi +## Detect docs if [ -d "$BASEDIR/docs" ]; then DOCKER_OPT_MKDOCS_PORT="-p 5100:5100" fi @@ -112,6 +117,7 @@ docker run -i $DOCKER_OPT_TTY \ $DOCKER_OPT_MKDOCS_PORT \ $DOCKER_OPT_MARP_PORT \ "$DOCKER_IMAGE" "$ACTION" + if [ "$VERBOSITY" -gt 0 ]; then set +x fi