-
Notifications
You must be signed in to change notification settings - Fork 1
/
make.sh
executable file
·52 lines (43 loc) · 1.33 KB
/
make.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
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
#!/bin/bash
set -f
set -e
IFS=$'\n'
index="`cat index.txt`"
body=""
for v in $index;
do
if [ "$v" != "" ];
then
body="$body <p><a href='./$v/index.html'>$v</a></p>"
fi
done
# Rebuild the webpage by merging header body and footer
if [ -f "header.html" ]; then cat "header.html" > index.html ; else echo "" > index.html ; fi
echo "$body" >> index.html
if [ -f "footer.html" ]; then cat "footer.html" >> index.html ; fi
# Customize the javadoc by injecting css (eg apply a dark theme)
for v in $index;
do
# Skip the old javadoc
if [ "$v" = "v3.x" ];then continue; fi
if [ -f "inject.css" -a -f "$v/stylesheet.css" ];
then
# marking comment: This marks the start of the custom css
s="/*** !!CUSTOM!! ***/"
# Rebuild the stylesheet line by line but stop if
# the marking comment is reached before the end
# Defacto removes any custom css that was injected before
stylesheet="`cat $v/stylesheet.css`"
echo "" > "$v/stylesheet.css"
for l in $stylesheet;
do
if [ "$l" = "$s" ];then break; fi
echo "$l" >> "$v/stylesheet.css"
done
echo "Inject CSS"
# Marking comment
echo -e "\n$s\n" >> "$v/stylesheet.css"
# Custom css
cat "inject.css" >> "$v/stylesheet.css"
fi
done