-
Notifications
You must be signed in to change notification settings - Fork 1
/
structs.doc.template.html
50 lines (50 loc) · 1.73 KB
/
structs.doc.template.html
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
{{define "gorest.structs"}}
<html>
<head>
<link rel="stylesheet" href="https://maxcdn.bootstrapcdn.com/bootstrap/3.3.1/css/bootstrap.min.css">
<link rel="stylesheet" href="https://maxcdn.bootstrapcdn.com/bootstrap/3.3.1/css/bootstrap-theme.min.css">
<script src="https://maxcdn.bootstrapcdn.com/bootstrap/3.3.1/js/bootstrap.min.js"></script>
<script src="https://ajax.googleapis.com/ajax/libs/jquery/1.11.1/jquery.min.js"></script>
<script>
function toggleFold(what) {
if ($("#" + what).is(":visible")) {
$("#" + what).hide();
} else {
$("#" + what).show();
}
return false;
}
</script>
</head>
<body>
<div class="jumbotron">
<h1>Data Types</h1>
</div>
<div class="container">
<h3>Data Types</h3>
<ul>
{{range $struc := .Structs}}
<li>
<a href="#{{$struc.PackageName}}-{{$struc.Name}}">{{$struc.PackageName}}.{{$struc.Name}}</a>
</li>
{{end}}
</ul>
</div>
{{range $struc := .Structs}}
<div class="container">
<h3 id="{{$struc.PackageName}}-{{$struc.Name}}">{{$struc.Name}}</h3>
<pre class="well">{{$struc.Doc}}</pre>
<table class="table">
{{range $field := $struc.Fields}}
<tr>
<td>{{$field.Name}}</td>
<td>{{$field.Type}}</td>
<td>{{$field.Doc}}</td>
</tr>
{{end}}
</table>
</div>
{{end}}
</body>
</html>
{{end}}