-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathbuild.sh
More file actions
28 lines (23 loc) · 813 Bytes
/
build.sh
File metadata and controls
28 lines (23 loc) · 813 Bytes
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
set -eu
# Config vars
SRCDIR=notebook
TGTDIR=docs
for article_type in article blog; do
for nb_path in $(ls -1 ${SRCDIR}/${article_type}); do
base=$(basename ${nb_path})
indir=${SRCDIR}/${article_type}/${base}
outdir=${TGTDIR}/${article_type}/${base}
if [ ! -e "${outdir}" ]; then
echo "Create output directory at ${outdir}"
mkdir -p ${outdir}
fi
# Convert Jupyter notebook to markdown
echo jupyter nbconvert ${indir}/index.ipynb --to markdown --stdout
jupyter nbconvert ${indir}/index.ipynb --to markdown --stdout >${outdir}/index.md
# Copy images
for png in $(ls -1 ${indir}/*.png ${indir}/*.jpg); do
echo cp ${png} ${outdir}/
cp ${png} ${outdir}/
done
done
done