forked from RackHD/on-http
-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathinstall-task-doc.sh
More file actions
executable file
·27 lines (20 loc) · 882 Bytes
/
install-task-doc.sh
File metadata and controls
executable file
·27 lines (20 loc) · 882 Bytes
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
# Copyright 2016, EMC, Inc.
set -e
if [ ! -d './node_modules/on-tasks/' ]; then
echo 'on-tasks folder not found, please run npm install.'
exit 1
fi
# Generate task doc from task schemas
cd ./node_modules/on-tasks/
node task-annotation-generator.js
# Parse task doc data json to api_data.js so that it can be `require` by template
echo 'define({"api":' > api_data.js
cat task_doc_data.json >> api_data.js
echo '});' >> api_data.js
cd ../../
# Copy templates from apidoc, taskdoc leverage apidoc templates for html rendering
cp -rf ./node_modules/apidoc/template/* ./static/taskdoc/
# Copy generated json file to ./static folder, override existing files
mv -f ./node_modules/on-tasks/api_data.js ./static/taskdoc
mv -f ./node_modules/on-tasks/task_doc_data.json ./static/taskdoc/api_data.json
echo "Visit http://<server>:<port>/taskdoc for task documentation web page"