-
Notifications
You must be signed in to change notification settings - Fork 20
/
Copy pathdocs
executable file
·58 lines (44 loc) · 1.61 KB
/
docs
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
#!/bin/bash
set -e
HERE=$(dirname "$(readlink --canonicalize "$BASH_SOURCE")")
. "$HERE/_env"
PORT=6060
DOCS="$ROOT/docs/html"
WORK=/tmp/puccini-docs
go get -u golang.org/x/tools/cmd/godoc
cd "$ROOT"
rm --recursive --force "$WORK"
mkdir --parents "$WORK/src/github.com/tliron/puccini"
cp --recursive . "$WORK/"
echo "http://localhost:$PORT/pkg/github.com/tliron/puccini/"
"$GOPATH/bin/godoc" -http=":$PORT" -goroot="$WORK"
#"$GOPATH/bin/godoc" -goroot="$WORK" -url="/pkg/github.com/tliron/puccini/"
exit
mkdir --parents "$DOCS"
cat << EOT > "$DOCS/index.html"
<!DOCTYPE html>
<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8">
<meta name="viewport" content="width=device-width, initial-scale=1.0">
<title>Puccini</title>
<link type="text/css" rel="stylesheet" href="bootstrap.min.css" />
<link type="text/css" rel="stylesheet" href="site.css" />
</head>
<body>
<div class="container">
EOT
"$GOPATH/bin/godoc" -goroot="$GOPATH" -html=github.com/tliron/puccini/tosca >> "$DOCS/index.html"
cat << EOT >> "$DOCS/index.html"
</div>
<script src="jquery-2.0.3.min.js"></script>
<script src="bootstrap.min.js"></script>
<script src="site.js"></script>
</body>
</html>
EOT
wget --quiet --output-document="$DOCS/jquery-2.0.3.min.js" https://godoc.org/-/jquery-2.0.3.min.js
wget --quiet --output-document="$DOCS/bootstrap.min.js" https://godoc.org/-/bootstrap.min.js
wget --quiet --output-document="$DOCS/bootstrap.min.css" https://godoc.org/-/bootstrap.min.css
wget --quiet --output-document="$DOCS/site.js" https://godoc.org/-/site.js
wget --quiet --output-document="$DOCS/site.css" https://godoc.org/-/site.css