-
Notifications
You must be signed in to change notification settings - Fork 15
/
update.sh
executable file
·45 lines (43 loc) · 1.54 KB
/
update.sh
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
#!/usr/bin/env bash
rm ./tutorials.rst
cp ./tutorials_template ./tutorials.rst
echo " " >> ./tutorials.rst
jupyter nbconvert --TagRemovePreprocessor.remove_cell_tags='{"remove_cell"}' --to rst ../notebooks/overview.ipynb
for notebook in `ls ../notebooks/tutorials/*.ipynb | sort -g` ; do
jupyter nbconvert --TagRemovePreprocessor.remove_cell_tags='{"remove_cell"}' --to rst $notebook
jupyter nbconvert --TagRemovePreprocessor.remove_cell_tags='{"remove_cell"}' --to rst $notebook
jupyter nbconvert --TagRemovePreprocessor.remove_cell_tags='{"remove_cell"}' --to rst $notebook
filename1=${notebook##*/}
filename=${filename1%??????}
echo " tutorials/$filename" >> ./tutorials.rst
done
rm -r ./tutorials
mkdir ./tutorials
mv ../notebooks/tutorials/*.rst ./tutorials
for fils in ../notebooks/tutorials/*_files ; do
mv $fils ./tutorials
done
mv ../notebooks/overview.rst .
mkdir ./figs
for ext in png jpg pdf; do
cp ../notebooks/figs/*.$ext ./figs
mkdir ./tutorials/notebooks
for f in ../notebooks/tutorials/*.ipynb ; do
cp $f ./tutorials/notebooks
done
for f in ../notebooks/tutorials/*.gif ; do
cp $f ./tutorials/notebooks
done
for rstfile in ./tutorials/*.rst; do
filename1=${rstfile##*/}
filename=${filename1%????}
echo "" >> $rstfile
# echo ".. only:: builder_html">> $rstfile
echo "" >> $rstfile
echo "Download :download:\`Notebook<notebooks/$filename.ipynb>\`." >> $rstfile
echo "" >> $rstfile
echo "" >> $rstfile
done
echo "------------------------------------------------"
make clean
rm -r api