metamaps--metamaps/bin/build-apidocs.sh

18 lines
408 B
Bash
Raw Normal View History

2016-10-04 14:02:07 +08:00
#!/bin/bash
# Note: you need to run `npm install` before using this script or raml2html won't be installed
2016-10-12 11:08:09 +08:00
OLD_DIR=$(pwd)
cd $(dirname $0)/..
if [[ ! -x ./node_modules/.bin/raml2html ]]; then
npm install
fi
2016-10-12 11:08:09 +08:00
./node_modules/.bin/raml2html -i ./doc/api/api.raml -o ./public/api/index.html -t doc/api/templates/template.nunjucks
2016-10-12 11:11:33 +08:00
if [[ -x $(which open) ]]; then
open public/api/index.html
fi
2016-10-12 11:08:09 +08:00
cd $OLD_DIR