github.com/graybobo/golang.org-package-offline-cache@v0.0.0-20200626051047-6608995c132f/x/tools/godoc/static/package.html (about)

     1  <!--
     2  	Copyright 2009 The Go Authors. All rights reserved.
     3  	Use of this source code is governed by a BSD-style
     4  	license that can be found in the LICENSE file.
     5  -->
     6  <!--
     7  	Note: Static (i.e., not template-generated) href and id
     8  	attributes start with "pkg-" to make it impossible for
     9  	them to conflict with generated attributes (some of which
    10  	correspond to Go identifiers).
    11  -->
    12  {{with .PDoc}}
    13  	<script type='text/javascript'>
    14  	document.ANALYSIS_DATA = {{$.AnalysisData}};
    15  	document.CALLGRAPH = {{$.CallGraph}};
    16  	</script>
    17  
    18  	{{if $.IsMain}}
    19  		{{/* command documentation */}}
    20  		{{comment_html .Doc}}
    21  	{{else}}
    22  		{{/* package documentation */}}
    23  		<div id="short-nav">
    24  			<dl>
    25  			<dd><code>import "{{html .ImportPath}}"</code></dd>
    26  			</dl>
    27  			<dl>
    28  			<dd><a href="#pkg-overview" class="overviewLink">Overview</a></dd>
    29  			<dd><a href="#pkg-index" class="indexLink">Index</a></dd>
    30  			{{if $.Examples}}
    31  				<dd><a href="#pkg-examples" class="examplesLink">Examples</a></dd>
    32  			{{end}}
    33  			{{if $.Dirs}}
    34  				<dd><a href="#pkg-subdirectories">Subdirectories</a></dd>
    35  			{{end}}
    36  			</dl>
    37  		</div>
    38  		<!-- The package's Name is printed as title by the top-level template -->
    39  		<div id="pkg-overview" class="toggleVisible">
    40  			<div class="collapsed">
    41  				<h2 class="toggleButton" title="Click to show Overview section">Overview ▹</h2>
    42  			</div>
    43  			<div class="expanded">
    44  				<h2 class="toggleButton" title="Click to hide Overview section">Overview ▾</h2>
    45  				{{comment_html .Doc}}
    46  			</div>
    47  		</div>
    48  		{{example_html $ ""}}
    49  
    50  		<div id="pkg-index" class="toggleVisible">
    51  		<div class="collapsed">
    52  			<h2 class="toggleButton" title="Click to show Index section">Index ▹</h2>
    53  		</div>
    54  		<div class="expanded">
    55  			<h2 class="toggleButton" title="Click to hide Index section">Index ▾</h2>
    56  
    57  		<!-- Table of contents for API; must be named manual-nav to turn off auto nav. -->
    58  			<div id="manual-nav">
    59  			<dl>
    60  			{{if .Consts}}
    61  				<dd><a href="#pkg-constants">Constants</a></dd>
    62  			{{end}}
    63  			{{if .Vars}}
    64  				<dd><a href="#pkg-variables">Variables</a></dd>
    65  			{{end}}
    66  			{{range .Funcs}}
    67  				{{$name_html := html .Name}}
    68  				<dd><a href="#{{$name_html}}">{{node_html $ .Decl false | sanitize}}</a></dd>
    69  			{{end}}
    70  			{{range .Types}}
    71  				{{$tname_html := html .Name}}
    72  				<dd><a href="#{{$tname_html}}">type {{$tname_html}}</a></dd>
    73  				{{range .Funcs}}
    74  					{{$name_html := html .Name}}
    75  					<dd>&nbsp; &nbsp; <a href="#{{$name_html}}">{{node_html $ .Decl false | sanitize}}</a></dd>
    76  				{{end}}
    77  				{{range .Methods}}
    78  					{{$name_html := html .Name}}
    79  					<dd>&nbsp; &nbsp; <a href="#{{$tname_html}}.{{$name_html}}">{{node_html $ .Decl false | sanitize}}</a></dd>
    80  				{{end}}
    81  			{{end}}
    82  			{{if $.Notes}}
    83  				{{range $marker, $item := $.Notes}}
    84  				<dd><a href="#pkg-note-{{$marker}}">{{noteTitle $marker | html}}s</a></dd>
    85  				{{end}}
    86  			{{end}}
    87  			</dl>
    88  			</div><!-- #manual-nav -->
    89  
    90  		{{if $.Examples}}
    91  		<div id="pkg-examples">
    92  			<h4>Examples</h4>
    93  			<dl>
    94  			{{range $.Examples}}
    95  			<dd><a class="exampleLink" href="#example_{{.Name}}">{{example_name .Name}}</a></dd>
    96  			{{end}}
    97  			</dl>
    98  		</div>
    99  		{{end}}
   100  
   101  		{{with .Filenames}}
   102  			<h4>Package files</h4>
   103  			<p>
   104  			<span style="font-size:90%">
   105  			{{range .}}
   106  				<a href="{{.|srcLink|html}}">{{.|filename|html}}</a>
   107  			{{end}}
   108  			</span>
   109  			</p>
   110  		{{end}}
   111  		</div><!-- .expanded -->
   112  		</div><!-- #pkg-index -->
   113  
   114  		<div id="pkg-callgraph" class="toggle" style="display: none">
   115  		<div class="collapsed">
   116  			<h2 class="toggleButton" title="Click to show Internal Call Graph section">Internal call graph ▹</h2>
   117  		</div> <!-- .expanded -->
   118  		<div class="expanded">
   119  			<h2 class="toggleButton" title="Click to hide Internal Call Graph section">Internal call graph ▾</h2>
   120  			<p>
   121  			  In the call graph viewer below, each node
   122  			  is a function belonging to this package
   123  			  and its children are the functions it
   124  			  calls&mdash;perhaps dynamically.
   125  			</p>
   126  			<p>
   127  			  The root nodes are the entry points of the
   128  			  package: functions that may be called from
   129  			  outside the package.
   130  			  There may be non-exported or anonymous
   131  			  functions among them if they are called
   132  			  dynamically from another package.
   133  			</p>
   134  			<p>
   135  			  Click a node to visit that function's source code.
   136  			  From there you can visit its callers by
   137  			  clicking its declaring <code>func</code>
   138  			  token.
   139  			</p>
   140  			<p>
   141  			  Functions may be omitted if they were
   142  			  determined to be unreachable in the
   143  			  particular programs or tests that were
   144  			  analyzed.
   145  			</p>
   146  			<!-- Zero means show all package entry points. -->
   147  			<ul style="margin-left: 0.5in" id="callgraph-0" class="treeview"></ul>
   148  		</div>
   149  		</div> <!-- #pkg-callgraph -->
   150  
   151  		{{with .Consts}}
   152  			<h2 id="pkg-constants">Constants</h2>
   153  			{{range .}}
   154  				<pre>{{node_html $ .Decl true}}</pre>
   155  				{{comment_html .Doc}}
   156  			{{end}}
   157  		{{end}}
   158  		{{with .Vars}}
   159  			<h2 id="pkg-variables">Variables</h2>
   160  			{{range .}}
   161  				<pre>{{node_html $ .Decl true}}</pre>
   162  				{{comment_html .Doc}}
   163  			{{end}}
   164  		{{end}}
   165  		{{range .Funcs}}
   166  			{{/* Name is a string - no need for FSet */}}
   167  			{{$name_html := html .Name}}
   168  			<h2 id="{{$name_html}}">func <a href="{{posLink_url $ .Decl}}">{{$name_html}}</a></h2>
   169  			<pre>{{node_html $ .Decl true}}</pre>
   170  			{{comment_html .Doc}}
   171  			{{example_html $ .Name}}
   172  			{{callgraph_html $ "" .Name}}
   173  
   174  		{{end}}
   175  		{{range .Types}}
   176  			{{$tname := .Name}}
   177  			{{$tname_html := html .Name}}
   178  			<h2 id="{{$tname_html}}">type <a href="{{posLink_url $ .Decl}}">{{$tname_html}}</a></h2>
   179  			<pre>{{node_html $ .Decl true}}</pre>
   180  			{{comment_html .Doc}}
   181  
   182  			{{range .Consts}}
   183  				<pre>{{node_html $ .Decl true}}</pre>
   184  				{{comment_html .Doc}}
   185  			{{end}}
   186  
   187  			{{range .Vars}}
   188  				<pre>{{node_html $ .Decl true}}</pre>
   189  				{{comment_html .Doc}}
   190  			{{end}}
   191  
   192  			{{example_html $ $tname}}
   193  			{{implements_html $ $tname}}
   194  			{{methodset_html $ $tname}}
   195  
   196  			{{range .Funcs}}
   197  				{{$name_html := html .Name}}
   198  				<h3 id="{{$name_html}}">func <a href="{{posLink_url $ .Decl}}">{{$name_html}}</a></h3>
   199  				<pre>{{node_html $ .Decl true}}</pre>
   200  				{{comment_html .Doc}}
   201  				{{example_html $ .Name}}
   202  				{{callgraph_html $ "" .Name}}
   203  			{{end}}
   204  
   205  			{{range .Methods}}
   206  				{{$name_html := html .Name}}
   207  				<h3 id="{{$tname_html}}.{{$name_html}}">func ({{html .Recv}}) <a href="{{posLink_url $ .Decl}}">{{$name_html}}</a></h3>
   208  				<pre>{{node_html $ .Decl true}}</pre>
   209  				{{comment_html .Doc}}
   210  				{{$name := printf "%s_%s" $tname .Name}}
   211  				{{example_html $ $name}}
   212  				{{callgraph_html $ .Recv .Name}}
   213  			{{end}}
   214  		{{end}}
   215  	{{end}}
   216  
   217  	{{with $.Notes}}
   218  		{{range $marker, $content := .}}
   219  			<h2 id="pkg-note-{{$marker}}">{{noteTitle $marker | html}}s</h2>
   220  			<ul style="list-style: none; padding: 0;">
   221  			{{range .}}
   222  			<li><a href="{{posLink_url $ .}}">&#x261e;</a> {{html .Body}}</li>
   223  			{{end}}
   224  			</ul>
   225  		{{end}}
   226  	{{end}}
   227  {{end}}
   228  
   229  {{with .PAst}}
   230  	{{range $filename, $ast := .}}
   231  		<a href="{{$filename|srcLink|html}}">{{$filename|filename|html}}</a>:<pre>{{node_html $ $ast false}}</pre>
   232  	{{end}}
   233  {{end}}
   234  
   235  {{with .Dirs}}
   236  	{{/* DirList entries are numbers and strings - no need for FSet */}}
   237  	{{if $.PDoc}}
   238  		<h2 id="pkg-subdirectories">Subdirectories</h2>
   239  	{{end}}
   240  	{{if eq $.Dirname "/src"}}
   241  		<div id="manual-nav">
   242  			<dl>
   243  				<dt><a href="#stdlib">Standard library</a></dt>
   244  				<dt><a href="#other">Other packages</a></dt>
   245  				<dd><a href="#subrepo">Sub-repositories</a></dd>
   246  				<dd><a href="#community">Community</a></dd>
   247  			</dl>
   248  		</div>
   249  		<h2 id="stdlib">Standard library</h2>
   250  		<img class="gopher" src="/doc/gopher/pkg.png"/>
   251  	{{end}}
   252  
   253  
   254  	<div class="pkg-dir">
   255  		<table>
   256  			<tr>
   257  				<th class="pkg-name">Name</th>
   258  				<th class="pkg-synopsis">Synopsis</th>
   259  			</tr>
   260  
   261  			{{if not (or (eq $.Dirname "/src") (eq $.Dirname "/src/cmd") $.DirFlat)}}
   262  			<tr>
   263  				<td colspan="2"><a href="..">..</a></td>
   264  			</tr>
   265  			{{end}}
   266  
   267  			{{range .List}}
   268  				{{if $.DirFlat}}
   269  					{{if .HasPkg}}
   270  						<tr>
   271  							<td class="pkg-name">
   272  								<a href="{{html .Path}}/">{{html .Path}}</a>
   273  							</td>
   274  							<td class="pkg-synopsis">
   275  								{{html .Synopsis}}
   276  							</td>
   277  						</tr>
   278  					{{end}}
   279  				{{else}}
   280  					<tr>
   281  						<td class="pkg-name" style="padding-left: {{multiply .Depth 20}}px;">
   282  							<a href="{{html .Path}}/">{{html .Name}}</a>
   283  						</td>
   284  						<td class="pkg-synopsis">
   285  							{{html .Synopsis}}
   286  						</td>
   287  					</tr>
   288  				{{end}}
   289  			{{end}}
   290  		</table>
   291  	</div>
   292  
   293  
   294  	{{if eq $.Dirname "/src"}}
   295  	<h2 id="other">Other packages</h2>
   296  
   297  	<h3 id="subrepo">Sub-repositories</h3>
   298  	<p>
   299  	These packages are part of the Go Project but outside the main Go tree.
   300  	They are developed under looser <a href="/doc/go1compat">compatibility requirements</a> than the Go core.
   301  	Install them with "<a href="/cmd/go/#hdr-Download_and_install_packages_and_dependencies">go get</a>".
   302  	</p>
   303  	<ul>
   304  		<li><a href="//godoc.org/golang.org/x/benchmarks">benchmarks</a> — benchmarks to measure Go as it is developed.</li>
   305  		<li><a href="//godoc.org/golang.org/x/blog">blog</a> — <a href="//blog.golang.org">blog.golang.org</a>'s implementation.</li>
   306  		<li><a href="//godoc.org/golang.org/x/build">build</a> — <a href="//build.golang.org">build.golang.org</a>'s implementation.</li>
   307  		<li><a href="//godoc.org/golang.org/x/crypto">crypto</a> — additional cryptography packages.</li>
   308  		<li><a href="//godoc.org/golang.org/x/debug">debug</a> — an experimental debugger for Go.</li>
   309  		<li><a href="//godoc.org/golang.org/x/image">image</a> — additional imaging packages.</li>
   310  		<li><a href="//godoc.org/golang.org/x/mobile">mobile</a> — experimental support for Go on mobile platforms.</li>
   311  		<li><a href="//godoc.org/golang.org/x/net">net</a> — additional networking packages.</li>
   312  		<li><a href="//godoc.org/golang.org/x/sys">sys</a> — packages for making system calls.</li>
   313  		<li><a href="//godoc.org/golang.org/x/text">text</a> — packages for working with text.</li>
   314  		<li><a href="//godoc.org/golang.org/x/tools">tools</a> — godoc, goimports, gorename, and other tools.</li>
   315  		<li><a href="//godoc.org/golang.org/x/tour">tour</a> — <a href="//tour.golang.org">tour.golang.org</a>'s implementation.</li>
   316  		<li><a href="//godoc.org/golang.org/x/exp">exp</a> — experimental and deprecated packages (handle with care; may change without warning).</li>
   317  	</ul>
   318  
   319  	<h3 id="community">Community</h3>
   320  	<p>
   321  	These services can help you find Open Source packages provided by the community.
   322  	</p>
   323  	<ul>
   324  		<li><a href="//godoc.org">GoDoc</a> - a package index and search engine.</li>
   325  		<li><a href="http://go-search.org">Go Search</a> - a code search engine.</li>
   326  		<li><a href="/wiki/Projects">Projects at the Go Wiki</a> - a curated list of Go projects.</li>
   327  	</ul>
   328  	{{end}}
   329  {{end}}