Skip to content

Instantly share code, notes, and snippets.

@kfatehi
Created March 12, 2017 21:07
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save kfatehi/314967b90ec7bf8d226a32c091eaf800 to your computer and use it in GitHub Desktop.
Save kfatehi/314967b90ec7bf8d226a32c091eaf800 to your computer and use it in GitHub Desktop.
generate matrix-js-sdk docset
#!/bin/bash
set -e
DOCSET_NAME="MatrixJSSDK"
cat <<EOF > docset-config.json
{
"docset" : {
"name": "$DOCSET_NAME",
"icon": "scripts/icon.png"
}
}
EOF
NAME=`jq -r '.name' package.json`
VERSION=`jq -r '.version' package.json`
TMPL="node_modules/jsdoc-dash-template"
if [[ ! -d $TMPL ]]; then
yarn add jsdoc-dash-template
fi
echo "generating docset"
jsdoc -c docset-config.json -r lib -P package.json -R README.md -d docset -t $TMPL --pedantic
rm docset-config.json
DOCROOT=docset/MatrixJSSDK.docset/Contents/Resources/Documents/
# move the docs so the index path matches the actual path
mv $DOCROOT/$NAME/$VERSION/* $DOCROOT/
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment