#!/bin/bash # # Convert Reveal.js slides found in sub-directories. # # requires: # Docker-Engine to be installed and running # Docker 'astefanutti/decktape' image to be installed or downloadable if ! docker info >/dev/null ; then echo "Error: Seems that Docker-Engine is not running..." >&2 exit 1 fi current_local_dir="$(pwd)" for directory in $(find "$current_local_dir" -maxdepth 1 -type d) do for file in "$directory"/*.html do file_path="$(basename "$directory")/$(basename "$file")" docker run --rm \ -t \ -v "$current_local_dir":/slides \ -v "$current_local_dir"/:/home/user \ astefanutti/decktape:1.0.0 /home/user/"$file_path" "$(basename "$file")".pdf done done