convert_markdown_into_ipynb.sh 423 字节
Newer Older
G
gongweibao 已提交
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18
#!/bin/sh
command -v go >/dev/null 2>&1
if [ $? != 0 ]; then
    echo -e >&2 "Please install https://golang.org/doc/install#install"
    exit 1
fi

#convert to ipynb file
GOPATH=/tmp/go go get -u github.com/wangkuiyi/ipynb/markdown-to-ipynb

for file in $@ ; do
	/tmp/go/bin/markdown-to-ipynb < $file > ${file%.*}".ipynb"
    if [ $? != 0 ]; then
        echo -e "markdown-to-ipynb $file error"
        exit 1
    fi
done