-
Notifications
You must be signed in to change notification settings - Fork 0
/
pages_java.sh
executable file
·23 lines (20 loc) · 1.04 KB
/
pages_java.sh
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
#!/bin/sh -e
# IAL 1.6.0 script for Java API Doc, (c) 2023 Ma_Sys.ma <[email protected]>
target=java
version=11
! [ -d "$target" ] || rm -r "$target"
mkdir -p "$target"
[ -n "$MDVL_CI_PHOENIX_ROOT" ] || MDVL_CI_PHOENIX_ROOT="$(cd \
"$(dirname "$0")/.." && pwd)"
"$MDVL_CI_PHOENIX_ROOT/co-maartifact/maartifact.pl" extract \
"ial_in_java_$version.deb" "$target" "openjdk-$version-doc"
mv "$target/usr/share/doc/openjdk-$version-jre-headless"/* "$target"
rm -r "$target/usr"
printf "%s\n" "ial_add_data([" > "$target/script.js"
grep -E '^<li>.*title=".*$' < "$target/api/allclasses.html" | sed \
-e 's/<span class="[^"]\+">\([^<]\+\)<\/span>/\1/g' \
-e 's/<li><a href="\([^"]\+\)" title="[a-z0-9]\+ in \([^"]\+\)"[^>]*>\(<i>\)\?\([^<]\+\)\(<\/i>\)\?<\/a><\/li>$/ { id: "java'"$version"'", box: "doc", title: "\2.\4", link: "'"$target"'\/api\/\1", primary: ["\2.\4", "\4"], secondary: [] },/g' \
>> "$target/script.js"
printf "\t{}\n]);\n" >> "$target/script.js"
printf "\n<script type=\"text/javascript\" src=\"%s\"></script>\n" \
"$target/script.js"