-
Notifications
You must be signed in to change notification settings - Fork 4
/
Makefile
executable file
·31 lines (25 loc) · 1.15 KB
/
Makefile
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
.PHONY: docs
run:
docker pull bakingbad/michelson-kernel
docker run --rm -it -p 127.0.0.1:8888:8888 -v $$(pwd)/notebooks:/home/jupyter/notebooks bakingbad/michelson-kernel
install:
yarn
pip install nbconvert==5.6.1
sudo apt install rename -y
postprocess:
cd $$MDIR && rename 's/^([0-9]+).*/$$1.md/' *.md
cd $$MDIR && sed -i 's/"/"/g' *.md
cd $$MDIR && sed -r -i 's/^>\sNote:\s(.*)$$/::: warning NOTE\n\1\n:::/g' *.md
cd $$MDIR && sed -r -i 's/^>\sTip:\s(.*)$$/::: tip\n\1\n:::/g' *.md
docs:
rm docs/chapters/*.md || true
jupyter nbconvert notebooks/tutorials/**/*.ipynb --TemplateExporter.template_file=jupyter.tpl --Exporter.preprocessors='["preprocess.RemoveExerciceCells", "preprocess.AddBinderComponent"]' --to markdown --output-dir docs/chapters
MDIR=docs/chapters $(MAKE) postprocess
# rm docs/advanced/*.md || true
# jupyter nbconvert notebooks/examples/*.ipynb --TemplateExporter.template_file=jupyter.tpl --Exporter.preprocessors=[\"preprocess.AddBinderComponent\"] --to markdown --output-dir docs/advanced
# MDIR=docs/advanced $(MAKE) postprocess
build:
yarn build
echo "michelson.baking-bad.org" > ./docs/.vuepress/dist/CNAME
dev:
yarn dev