-
Notifications
You must be signed in to change notification settings - Fork 5
Expand file tree
/
Copy pathbuild_app_docs.sh
More file actions
executable file
·77 lines (64 loc) · 1.97 KB
/
build_app_docs.sh
File metadata and controls
executable file
·77 lines (64 loc) · 1.97 KB
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
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
#!/bin/sh
#
# Friction - https://friction.graphics
#
# Copyright (c) Ole-André Rodlie and contributors
#
# This program is free software: you can redistribute it and/or modify
# it under the terms of the GNU General Public License as published by
# the Free Software Foundation, version 3.
#
# This program is distributed in the hope that it will be useful,
# but WITHOUT ANY WARRANTY; without even the implied warranty of
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
# GNU General Public License for more details.
#
# You should have received a copy of the GNU General Public License
# along with this program. If not, see <http://www.gnu.org/licenses/>.
#
set -e -x
CWD=`pwd`
BUILD=${CWD}/build-docs
if [ -d "${BUILD}" ]; then
rm -rf ${BUILD}
fi
mkdir -p ${BUILD}
cd ${BUILD}
mkdir -p _layouts assets/backgrounds assets/documentation
cp ${CWD}/_config_app.yml _config.yml
cp ${CWD}/_layouts_app/* _layouts/
cp ${CWD}/assets/style-doc.css assets/style.css
cp ${CWD}/assets/badge-alt.svg assets/logo.svg
PAGES="
animation_techniques.md
effects.md
export.md
expressions.md
faq.md
index.md
learning.md
shaders.md
shortcuts.md
tips.md
usage.md
userinterface.md
"
for page in ${PAGES}; do cp ${CWD}/documentation/${page} . ; done
ASSETS=`grep -ho 'assets/[^"'\''\)]*' ${PAGES} | sort | uniq`
sed -i '/Default interface/d' index.md
sed -i 's/permalink: documentation\//permalink: /g; s/\/assets/assets/g' ${PAGES}
sed -i 's/permalink: /permalink: index/g' index.md
sed -i 's/\/assets\///g' assets/style.css
for asset in ${ASSETS}; do
relative_path=${asset#assets/}
asset_dir=$(dirname "${relative_path}")
mkdir -p "${BUILD}/assets/${asset_dir}"
cp "${CWD}/${asset}" "${BUILD}/assets/${relative_path}"
done
tree -lah
echo "source 'https://rubygems.org'" > Gemfile
echo "gem 'jekyll'" >> Gemfile
bundle exec jekyll build
echo "### Auto generated from build_app_docs.sh" > ${BUILD}/_site/README.md
mv ${CWD}/offline ${CWD}/offline.old
mv ${BUILD}/_site ${CWD}/offline