forked from DataONEorg/hub_lessons
-
Notifications
You must be signed in to change notification settings - Fork 0
/
remark2pdf
executable file
·31 lines (29 loc) · 1.04 KB
/
remark2pdf
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
#!/bin/sh
###
# This script generates:
# 1. a PDF of a lesson
# 2. a screen shot of the first page of the lesson
#
# It requires that you have a copy of decktape installed in
# the bin folder of your home directory. See:
# https://github.com/astefanutti/decktape
#
# The script assumes that jekyll is running locally and the slides
# are accessible through http://localhost:4000/dataone_lessons/lessons/
#
# Run the script from the same folder that the script is located in like:
#
# remark2pdf 00_markdown
#
DEST="$(pwd)/lessons"
DECKTAPE="${HOME}/bin/decktape-1.0.0"
BASEURL="http://localhost:4000/dataone_lessons/lessons/"
SSIZE="251x188"
SSHOT="--screenshots --screenshots-size ${SSIZE} --slides 1"
#SSHOT="${SSHOT} --screenshots-directory ${1}"
SSHOT="${SSHOT} --screenshots-format png"
cd ${DECKTAPE}
#./phantomjs decktape.js ${SSHOT} "${BASEURL}${1}/index.html" "${1}.pdf"
#rm "${DECKTAPE}/${1}.pdf"
#mv "${DECKTAPE}/screenshots/${1}_1_${SSIZE}.png" "${DEST}/${1}/${1}.png"
./phantomjs decktape.js "${BASEURL}${1}/index.html" "${DEST}/${1}/${1}.pdf"