├── README.md ├── markdown-to-pdf ├── README.md └── markdown-to-pdf.sh └── pecha-kucha ├── README.md └── pecha-kucha.sh /README.md: -------------------------------------------------------------------------------- 1 | # Deckset Scripts 2 | 3 | A collection of macOS command line scripts using AppleScript to control 4 | [Deckset](https://www.deckset.com/) in smart ways. 5 | 6 | 7 | ## List of scripts 8 | 9 | | Name | Description | Author | 10 | |---|---|--| 11 | | [Markdown to PDF](./markdown-to-pdf) | Convert a (list of) Deckset presentation(s) to PDF | [@infinitesteps](https://github.com/infinitesteps) | 12 | | [PechaKucha](./pecha-kucha) | Show every slide for 20s, then advance to the next one | [@chriseidhof](https://github.com/chriseidhof) | 13 | 14 | ## Documentation 15 | 16 | For an overview of supported classes and commands for Deckset, please open `Script Editor.app` on your Mac and select `Deckset` from the `Open Dictionary…` dialog. 17 | 18 | ## Contribute 19 | 20 | Did you come up with your own script for Deckset? We'd love to include it in this repo. 21 | Please fork this repo, add a new folder with your script and a `README.md` file that 22 | explains what your script does and how to install and use it, and finally create a pull 23 | request. 24 | 25 | Thanks for your contribution! 26 | -------------------------------------------------------------------------------- /markdown-to-pdf/README.md: -------------------------------------------------------------------------------- 1 | # Markdown to PDF 2 | 3 | This script allows you to convert Deckset presentations to PDF files 4 | from the command line. 5 | 6 | 7 | ## Installation 8 | 9 | 1. Copy _markdown-to-pdf.sh_ from this folder to a directory in your `$PATH`. 10 | `mv markdown-to-pdf.sh /usr/local/bin/markdown-to-pdf` 11 | 2. Make the script executable 12 | `chmod +x /path/to/markdown-to-pdf` 13 | 14 | 15 | ## Usage 16 | 17 | ### Convert a single file 18 | 19 | ```shell 20 | $ markdown-to-pdf /path/to/file.md 21 | ``` 22 | 23 | The PDF file will be placed right next to the source file, e.g. _/path/to/file.pdf_. 24 | 25 | 26 | ### Convert multiple files 27 | 28 | ```shell 29 | $ markdown-to-pdf /path/to/file-one.md /path/to/file-two.md /path/to/file-three.md 30 | ``` 31 | 32 | 33 | ### Author 34 | 35 | Original script by [@infinitesteps](https://github.com/infinitesteps) 36 | -------------------------------------------------------------------------------- /markdown-to-pdf/markdown-to-pdf.sh: -------------------------------------------------------------------------------- 1 | #!/bin/bash 2 | 3 | show_usage() { 4 | echo "Markdown to PDF" 5 | echo "" 6 | echo "Usage: $0 [options] file [file...]" 7 | echo "" 8 | echo "Options:" 9 | echo " -f Overwrite existing output files." 10 | echo " -s Separate slides for all build steps (lists, code highlights)" 11 | echo " -p Include presenter notes" 12 | echo " -h Print usage." 13 | } 14 | 15 | OVERWRITE=0 16 | PRINT_ALL_STEPS=false 17 | INCLUDE_PRESENTER_NOTES=false 18 | 19 | while getopts fsph option 20 | do 21 | case "${option}" 22 | in 23 | f) 24 | OVERWRITE=1; 25 | ;; 26 | s) 27 | PRINT_ALL_STEPS=true; 28 | ;; 29 | p) 30 | INCLUDE_PRESENTER_NOTES=true; 31 | ;; 32 | h) 33 | show_usage; 34 | exit 0; 35 | esac 36 | done 37 | shift $((OPTIND - 1)) 38 | 39 | if [ $# -eq 0 ] 40 | then 41 | show_usage 42 | exit 1 43 | fi 44 | 45 | for FILE in "$@" ; do 46 | md_file="$(cd "$(dirname "$FILE")"; pwd)/$(basename "$FILE")" 47 | pdf_file="${FILE%.*}.pdf" 48 | 49 | if [ ! -e $md_file ] 50 | then 51 | echo "Input file $md_file does not exist!" 52 | exit 2 53 | fi 54 | 55 | if [ -e $pdf_file ] && [ $OVERWRITE = 0 ] 56 | then 57 | echo "Error: output file $pdf_file exists. Please use -f option if you want to overwrite it." 58 | exit 3 59 | fi 60 | 61 | osascript < Set the interval in which the slides should advance (default: 20)" 10 | echo " -h Print usage." 11 | } 12 | 13 | INTERVAL=20 14 | 15 | while getopts i:h option 16 | do 17 | case "${option}" 18 | in 19 | i) 20 | INTERVAL=$OPTARG; 21 | shift $((OPTIND-1));; 22 | h) 23 | show_usage; 24 | exit 0; 25 | esac 26 | done 27 | 28 | 29 | osascript <