#!/bin/bash # # Build and publish all docs into Pulish all notebooks to mxnet. set -x set -e # Clean build/chapter*/*ipynb and build/chapter*/*md that are no longer needed. for ch in chapter*; do if ! [ -e "../$ch" ]; then rm -rf $ch fi for f in $ch/*.md $ch/*.ipynb; do base=$(basename $f) md=${base%%.*}.md echo "../$ch/$md" if ! [ -e "../$ch/$md" ]; then rm $f fi done done # prepare the env conda env update -f build/build.yml source activate gluon_zh_docs pip list make html # avoid to put the downloaed data into the notebook package mv build/data build/data-bak make pkg # backup build/data to avoid download the dataset each time and put the rm -rf build/data mv build/data-bak build/data make pdf cp build/_build/latex/gluon_tutorials_zh.pdf build/_build/html/ [ -e build/_build/latex/gluon_tutorials_zh.aux ] && rm build/_build/latex/gluon_tutorials_zh.aux [ -e build/_build/latex/gluon_tutorials_zh.idx ] && rm build/_build/latex/gluon_tutorials_zh.idx cd build bash ipynb2mdd.sh cp mdd.zip _build/html/mdd.zip cd .. aws s3 sync --delete build/_build/html/ s3://zh.gluon.ai/ --acl public-read