-
Notifications
You must be signed in to change notification settings - Fork 9
/
Copy pathbuild.sh
executable file
·24 lines (24 loc) · 901 Bytes
/
build.sh
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
# clean up previous remains, if any
rm -rf Contents/Resources
rm -rf React_Native.docset
mkdir -p Contents/Resources/Documents
# create a fresh sqlite db
cd Contents/Resources
sqlite3 docSet.dsidx 'CREATE TABLE searchIndex(id INTEGER PRIMARY KEY, name TEXT, type TEXT, path TEXT)'
sqlite3 docSet.dsidx 'CREATE UNIQUE INDEX anchor ON searchIndex (name, type, path)'
# fetch the whole doc site
# TODO: Include Videos for offline possibly.
cd Documents
wget -m -p -E -k -np http://facebook.github.io/react-native/
# move it around a bit
mv facebook.github.io/react-native ./
rm -rf facebook.github.io
cd ../../../
# change the documentation markup layout a bit to fit dash's small window
node src/modifyDocsHTML.js
# read the previously fetched doc site and parse it into sqlite
node src/index.js
# bundle up!
mkdir React_Native.docset
cp -r Contents React_Native.docset
cp src/icon* React_Native.docset