-
Notifications
You must be signed in to change notification settings - Fork 1
Expand file tree
/
Copy pathbuild_docs.sh
More file actions
executable file
·51 lines (41 loc) · 1.17 KB
/
build_docs.sh
File metadata and controls
executable file
·51 lines (41 loc) · 1.17 KB
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
50
51
#!/bin/bash
# The path to the jupyter executable.
com=jupyter
# The path to the docs directory.
docs=./docs
# The path to the documentation image directory under docs.
images=img
# The path to the toc file. This file is combined with the welcome page.
toc=${docs}/toc.rst
# The path to the README file.
readme=./README
# The filename of the welcome page. This will be a combination of the README and toc file.
index=${docs}/index.rst
#index=sci_analysis_main
# The list of notebooks to be converted to md for documentation.
notebooks=(
getting_started
using_sci_analysis
pandas
distribution
frequency
bivariate
location_test
)
for nb in ${notebooks[*]}; do
notebook=${docs}/${nb}.ipynb
output=${docs}/${nb}.md
output_backup=${output}.bak
if [[ -f ${output} ]]; then
mv ${output} ${output_backup}
fi
${com} nbconvert --to markdown NbConvertApp.output_base=${docs} --NbConvertApp.output_files_dir=${images} ${notebook}
sed -i -e "s/> Note:/.. note::/g" ${output}
sed -i -e "s/.*warnings.*//" ${output}
done
m2r ${readme}.md
cat ${readme}.rst ${toc} > ${index}
make -C ${docs} html
rm ${readme}.rst
rm ${docs}/*-e
exit 0