-
Notifications
You must be signed in to change notification settings - Fork 2
/
Copy pathgenerate
executable file
·51 lines (39 loc) · 1.01 KB
/
generate
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
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
#!/usr/bin/env bash
# SPDX-FileCopyrightText: 2022 Robin Vobruba <hoijui.quaero@gmail.com>
#
# SPDX-License-Identifier: CC0-1.0
# Exit immediately on each error and unset variable;
# see: https://vaneyckt.io/posts/safer_bash_scripts_with_set_euxo_pipefail/
set -Eeuo pipefail
#set -Eeu
title="LOSH Report 2022"
mkdir -p output/imgs
function dl_img() {
local url="$1"
local file
file="output/imgs/$(basename "$url")"
if ! [ -f "$file" ]
then
curl "$url" --output "$file"
fi
}
dl_img "https://mntre.com/media/reform_v2_images/reform_v2_prototype_top.jpg"
dl_img "https://openflexure.org/assets/ds-photos/ds_v1.2.0_wide.jpg"
dl_img "https://upload.wikimedia.org/wikipedia/commons/7/73/Upsatinspace.jpg"
cp report.ipynb "$title.ipynb"
for outfmt in pdf html markdown
do
jupyter nbconvert \
--to "$outfmt" \
--output-dir=output \
--no-input \
"$title.ipynb"
done
rm "$title.ipynb"
for rep in "output/$title."*
do
mv "$rep" "${rep/$title/report}"
done
echo
echo "Successfully created:"
ls -1 "output/report."*