-
Notifications
You must be signed in to change notification settings - Fork 53
/
Copy pathtext.txt
57 lines (52 loc) · 1.35 KB
/
text.txt
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
52
53
54
55
56
57
# add the following 2 lines into your .bashrc or .zhsrc (or your choice of bash shell):
# export TABML='/path/to/this/repo'
# alias 2tabml='cd $TABML; source tabml_env/bin/activate; source bashrc'
function tabml_build() {
cd $TABML
jupyter-book build book/
cp -R ./book/data_to_web ./book/_build/html/
}
function tabml_deploy() {
cd $TABML
export DEPLOY='_deploy'
rm -rf $DEPLOY
mkdir $DEPLOY
git clone --single-branch --branch gh-pages https://github.com/tiepvupsu/tabml_book $DEPLOY/
cd $DEPLOY
rm -Rf *
cp -r ../book/_build/html/ ./
git add -f --all .
DATE_WITH_TIME=`date "+%Y-%m-%d_%H:%M:%S"`
git commit -m ":rocket: Deploy at $DATE_WITH_TIME"
git push
cd ../
rm -rf $DEPLOY
# Save cache
export CACHE='_cache'
rm -rf $CACHE
mkdir $CACHE
git clone --single-branch --branch build https://github.com/tiepvupsu/tabml_book $CACHE/
cd $CACHE
rm -Rf *
cp -r ../book/_build/ ./
git add -f --all .
DATE_WITH_TIME=`date "+%Y-%m-%d_%H:%M:%S"`
git commit -m "Save _build at $DATE_WITH_TIME"
git push
cd -
rm -rf $CACHE
}
function convert_notebooks() {
# for every notebook in one folder:
# convert it to markdown using jupytext
# prefix it by nb_ to avoid multiple files with same filenames (even with diff exts)
for nb in $(ls *.ipynb)
do
jupytext $nb --to myst
done
for nb in $(ls *.ipynb)
do
mv $nb nb_$nb
done
ls
}