blob: 176e90ba02fea2c7b140e1a52ecc6dbc1cad7557 [file] [log] [blame]
{{define "Head"}}
{{template "PkgCmdHeader" $}}
{{if sidebarEnabled}}
<link href="{{staticPath "/-/sidebar.css"}}" rel="stylesheet">
{{end}}
{{end}}
{{define "Body"}}
{{with .pdoc}}
{{if sidebarEnabled}}
<div class="row">
<!-- Sidebar -->
<div class="gddo-sidebar col-md-3 hidden-xs hidden-sm">
<ul id="sidebar-nav" class="nav" data-spy="affix" data-offset-top="70">
<li class="active"><a href="#pkg-overview">Overview</a></li>
<li><a href="#pkg-index">Index</a></li>
{{if .Examples}}<li><a href="#pkg-examples">Examples</a></li>{{end}}
{{if .Consts}}<li><a href="#pkg-constants">Constants</a></li>{{end}}
{{if .Vars}}<li><a href="#pkg-variables">Variables</a></li>{{end}}
{{if .Funcs}}
<li>
<a href="#pkg-functions">Functions</a>
<ul class="nav">
{{range .Funcs}}<li><a href="#{{.Name}}">{{.Name}}</a></li>{{end}}
</ul>
</li>
{{end}}
{{if .Types}}
<li>
<a href="#pkg-types">Types</a>
<ul class="nav">
{{range .Types}}<li><a href="#{{.Name}}">{{.Name}}</a></li>{{end}}
</ul>
</li>
{{end}}
{{if .Notes.BUG}}<li><a href="#pkg-note-bug">Bugs</a></li>{{end}}
{{if $.pkgs}}<li><a href="#pkg-subdirectories">Directories</a></li>{{end}}
</ul>
</div>
<!-- Content -->
<div class="col-md-9">
{{end}}<!-- end sidebarEnabled -->
{{template "ProjectNav" $}}
<h2 id="pkg-overview">package {{.Name}}</h2>
<p><code>import "{{.ImportPath}}"</code>
{{.Doc|comment}}
{{template "Examples" .|$.pdoc.ObjExamples}}
<!-- Index -->
<h3 id="pkg-index" class="section-header">Index <a class="permalink" href="#pkg-index">&para;</a></h3>
{{if .Truncated}}
<div class="alert">The documentation displayed here is incomplete. Use the godoc command to read the complete documentation.</div>
{{end}}
<ul class="list-unstyled">
{{if .Consts}}<li><a href="#pkg-constants">Constants</a></li>{{end}}
{{if .Vars}}<li><a href="#pkg-variables">Variables</a></li>{{end}}
{{range .Funcs}}<li><a href="#{{.Name}}">{{.Decl.Text}}</a></li>{{end}}
{{range $t := .Types}}
<li><a href="#{{.Name}}">type {{.Name}}</a></li>
{{if or .Funcs .Methods}}<ul>{{end}}
{{range .Funcs}}<li><a href="#{{.Name}}">{{.Decl.Text}}</a></li>{{end}}
{{range .Methods}}<li><a href="#{{$t.Name}}.{{.Name}}">{{.Decl.Text}}</a></li>{{end}}
{{if or .Funcs .Methods}}</ul>{{end}}
{{end}}
</ul>
<!-- Examples -->
{{with .AllExamples}}
<h4 id="pkg-examples">Examples <a class="permalink" href="#pkg-examples">&para;</a></h4>
<ul class="list-unstyled">
{{range . }}<li><a href="#example-{{.Id}}" onclick="$('#ex-{{.Id}}').addClass('in').removeClass('collapse').height('auto')">{{.Label}}</a></li>{{end}}
</ul>
{{else}}
<span id="pkg-examples"></span>
{{end}}
<!-- Files -->
<h4 id="pkg-files">
{{with .BrowseURL}}<a href="{{.}}">Package Files</a>{{else}}Package Files{{end}}
<a class="permalink" href="#pkg-files">&para;</a>
</h4>
<p>{{range .Files}}{{if .URL}}<a href="{{.URL}}">{{.Name}}</a>{{else}}{{.Name}}{{end}} {{end}}</p>
<!-- Contants -->
{{if .Consts}}
<h3 id="pkg-constants">Constants <a class="permalink" href="#pkg-constants">&para;</a></h3>
{{range .Consts}}<pre data-kind="c">{{code .Decl nil}}</pre>{{.Doc|comment}}{{end}}
{{end}}
<!-- Variables -->
{{if .Vars}}
<h3 id="pkg-variables">Variables <a class="permalink" href="#pkg-variables">&para;</a></h3>
{{range .Vars}}<pre data-kind="v">{{code .Decl nil}}</pre>{{.Doc|comment}}{{end}}
{{end}}
<!-- Functions -->
{{if sidebarEnabled}}{{if .Funcs}}
<h3 id="pkg-functions" class="section-header">Functions <a class="permalink" href="#pkg-functions">&para;</a></h3>
{{end}}{{end}}
{{range .Funcs}}
<h3 id="{{.Name}}" data-kind="f">func {{$.pdoc.SourceLink .Pos .Name .Name}} <a class="permalink" href="#{{.Name}}">&para;</a></h3>
<pre class="funcdecl">{{code .Decl nil}}</pre>{{.Doc|comment}}
{{template "Examples" .|$.pdoc.ObjExamples}}
{{end}}
<!-- Types -->
{{if sidebarEnabled}}{{if .Types}}
<h3 id="pkg-types" class="section-header">Types <a class="permalink" href="#pkg-types">&para;</a></h3>
{{end}}{{end}}
{{range $t := .Types}}
<h3 id="{{.Name}}" data-kind="t">type {{$.pdoc.SourceLink .Pos .Name .Name}} <a class="permalink" href="#{{.Name}}">&para;</a></h3>
<pre data-kind="{{if isInterface $t}}m{{else}}d{{end}}">{{code .Decl $t}}</pre>{{.Doc|comment}}
{{range .Consts}}<pre data-kind="c">{{code .Decl nil}}</pre>{{.Doc|comment}}{{end}}
{{range .Vars}}<pre data-kind="v">{{code .Decl nil}}</pre>{{.Doc|comment}}{{end}}
{{template "Examples" .|$.pdoc.ObjExamples}}
{{range .Funcs}}
<h4 id="{{.Name}}" data-kind="f">func {{$.pdoc.SourceLink .Pos .Name .Name}} <a class="permalink" href="#{{.Name}}">&para;</a></h4>
<pre class="funcdecl">{{code .Decl nil}}</pre>{{.Doc|comment}}
{{template "Examples" .|$.pdoc.ObjExamples}}
{{end}}
{{range .Methods}}
<h4 id="{{$t.Name}}.{{.Name}}" data-kind="m">func ({{.Recv}}) {{$.pdoc.SourceLink .Pos .Name (printf "%s.%s" $t.Name .Name)}} <a class="permalink" href="#{{$t.Name}}.{{.Name}}">&para;</a></h4>
<pre class="funcdecl">{{code .Decl nil}}</pre>{{.Doc|comment}}
{{template "Examples" .|$.pdoc.ObjExamples}}
{{end}}
{{end}}
{{template "PkgCmdFooter" $}}
<div id="x-jump" tabindex="-1" class="modal">
<div class="modal-dialog">
<div class="modal-content">
<div class="modal-header">
<h4 class="modal-title">Jump to identifier</h4>
<br class="clearfix">
<input id="x-jump-filter" class="form-control" autocomplete="off" type="text">
</div>
<div id="x-jump-body" class="modal-body" style="height: 260px; overflow: auto;">
<div id="x-jump-list" class="list-group" style="margin-bottom: 0;"></div>
</div>
<div class="modal-footer">
<button type="button" class="btn" data-dismiss="modal">Close</button>
</div>
</div>
</div>
</div>
{{if sidebarEnabled}}
</div>
</div>
{{end}}
{{end}}
{{end}}
{{define "Examples"}}
{{if .}}
<div class="panel-group">
{{range .}}
<div class="panel panel-default" id="example-{{.Id}}">
<div class="panel-heading"><a class="accordion-toggle" data-toggle="collapse" href="#ex-{{.Id}}">Example{{with .Example.Name}} ({{.}}){{end}}</a></div>
<div id="ex-{{.Id}}" class="panel-collapse collapse"><div class="panel-body">
{{with .Example.Doc}}<p>{{.|comment}}{{end}}
<p>Code:{{if .Example.Play}}<span class="pull-right"><a href="?play={{.Id}}">play</a>&nbsp;</span>{{end}}
<pre>{{code .Example.Code nil}}</pre>
{{with .Example.Output}}<p>Output:<pre>{{.}}</pre>{{end}}
</div></div>
</div>
{{end}}
</div>
{{end}}
{{end}}