diff options
Diffstat (limited to 'lib/godoc')
-rw-r--r-- | lib/godoc/codewalk.html | 58 | ||||
-rw-r--r-- | lib/godoc/codewalkdir.html | 16 | ||||
-rw-r--r-- | lib/godoc/dirlist.html | 31 | ||||
-rw-r--r-- | lib/godoc/error.html | 9 | ||||
-rw-r--r-- | lib/godoc/godoc.html | 69 | ||||
-rw-r--r-- | lib/godoc/package.html | 122 | ||||
-rw-r--r-- | lib/godoc/package.txt | 82 | ||||
-rw-r--r-- | lib/godoc/search.html | 98 | ||||
-rw-r--r-- | lib/godoc/search.txt | 40 |
9 files changed, 525 insertions, 0 deletions
diff --git a/lib/godoc/codewalk.html b/lib/godoc/codewalk.html new file mode 100644 index 000000000..2835c6e82 --- /dev/null +++ b/lib/godoc/codewalk.html @@ -0,0 +1,58 @@ +<!-- + Copyright 2010 The Go Authors. All rights reserved. + Use of this source code is governed by a BSD-style + license that can be found in the LICENSE file. +--> + +<script src="http://www.google.com/jsapi"></script> +<script>google.load("jquery", "1.3.2");</script> +<style type='text/css'>@import "/doc/codewalk/codewalk.css";</style> +<script type="text/javascript" src="/doc/codewalk/codewalk.js"></script> + +<div id="codewalk-main"> + <div class="left" id="code-column"> + <div id='sizer'></div> + <div id="code-area"> + <div id="code-header" align="center"> + <a id="code-popout-link" href="" target="_blank"> + <img title="View code in new window" alt="Pop Out Code" src="/doc/codewalk/popout.png" style="display: block; float: right;"/> + </a> + <select id="code-selector"> + {{range .File}} + <option value="/doc/codewalk/?fileprint=/{{urlquery .}}">{{html .}}</option> + {{end}} + </select> + </div> + <div id="code"> + <iframe class="code-display" name="code-display" id="code-display"></iframe> + </div> + </div> + <div id="code-options" class="setting"> + <span>code on <a id="set-code-left" class="selected" href="#">left</a> • <a id="set-code-right" href="#">right</a></span> + <span>code width <span id="code-column-width">70%</span></span> + <span>filepaths <a id="show-filepaths" class="selected" href="#">shown</a> • <a id="hide-filepaths" href="#">hidden</a></span> + </div> + </div> + <div class="right" id="comment-column"> + <div id="comment-area"> + {{range .Step}} + <div class="comment first last"> + <a class="comment-link" href="/doc/codewalk/?fileprint=/{{urlquery .File}}&lo={{urlquery .Lo}}&hi={{urlquery .Hi}}#mark" target="code-display"></a> + <div class="comment-title">{{html .Title}}</div> + <div class="comment-text"> + {{with .Err}} + ERROR LOADING FILE: {{html .}}<br/><br/> + {{end}} + {{.XML}} + </div> + <div class="comment-text file-name"><span class="path-file">{{html .}}</span></div> + </div> + {{end}} + </div> + <div id="comment-options" class="setting"> + <a id="prev-comment" href="#"><span class="hotkey">p</span>revious step</a> + • + <a id="next-comment" href="#"><span class="hotkey">n</span>ext step</a> + </div> + </div> +</div> diff --git a/lib/godoc/codewalkdir.html b/lib/godoc/codewalkdir.html new file mode 100644 index 000000000..b7674c6ce --- /dev/null +++ b/lib/godoc/codewalkdir.html @@ -0,0 +1,16 @@ +<!-- + Copyright 2010 The Go Authors. All rights reserved. + Use of this source code is governed by a BSD-style + license that can be found in the LICENSE file. +--> + +<table class="layout"> +{{range .}} +<tr> + {{$name_html := html .Name}} + <td><a href="{{$name_html}}">{{$name_html}}</a></td> + <td width="25"> </td> + <td>{{html .Title}}</td> +</tr> +{{end}} +</table> diff --git a/lib/godoc/dirlist.html b/lib/godoc/dirlist.html new file mode 100644 index 000000000..a3e1a2fa8 --- /dev/null +++ b/lib/godoc/dirlist.html @@ -0,0 +1,31 @@ +<!-- + Copyright 2009 The Go Authors. All rights reserved. + Use of this source code is governed by a BSD-style + license that can be found in the LICENSE file. +--> + +<p> +<table class="layout"> +<tr> + <th align="left">File</th> + <td width="25"> </td> + <th align="right">Bytes</th> + <td width="25"> </td> + <th align="left">Modified</th> +</tr> +<tr> + <td><a href="..">..</a></td> +</tr> +{{range .}} +<tr> + {{$name_html := fileInfoName . | html}} + <td align="left"><a href="{{$name_html}}">{{$name_html}}</a></td> + <td></td> + <td align="right">{{html .Size}}</td> + <td></td> + <td align="left">{{fileInfoTime . | html}}</td> +</tr> +{{end}} + +</table> +</p> diff --git a/lib/godoc/error.html b/lib/godoc/error.html new file mode 100644 index 000000000..7573aa236 --- /dev/null +++ b/lib/godoc/error.html @@ -0,0 +1,9 @@ +<!-- + Copyright 2009 The Go Authors. All rights reserved. + Use of this source code is governed by a BSD-style + license that can be found in the LICENSE file. +--> + +<p> +<span class="alert" style="font-size:120%">{{html .}}</span> +</p> diff --git a/lib/godoc/godoc.html b/lib/godoc/godoc.html new file mode 100644 index 000000000..671160d5a --- /dev/null +++ b/lib/godoc/godoc.html @@ -0,0 +1,69 @@ +<!DOCTYPE html> +<html> +<head> +<meta http-equiv="Content-Type" content="text/html; charset=utf-8"/> +{{with .Title}} + <title>{{html .}} - The Go Programming Language</title> +{{else}} + <title>The Go Programming Language</title> +{{end}} +<link rel="stylesheet" href="/doc/all.css" type="text/css" media="all" charset="utf-8"> +<!--[if lt IE 8]> +<link rel="stylesheet" href="/doc/ie.css" type="text/css"> +<![endif]--> +<script type="text/javascript" src="/doc/godocs.js"></script> +</head> +<body> +<div id="container"> + <div id="topnav"> + <h1 id="title">The Go Programming Language</h1> + <div id="nav-main"> + <ul> + <li><a href="/">Home</a></li><li><a href="/doc/install.html">Getting Started</a></li><li><a href="/doc/docs.html">Documentation</a></li><li><a href="/doc/contrib.html">Contributing</a></li><li><a href="/doc/community.html">Community</a></li> + </ul> + <div class="quickref"> + <form method="GET" action="/search"> + {{range .PkgRoots}} + <a href="/pkg/{{html .}}">{{html .}}</a> <span class="sep">|</span> + {{else}} + References: + {{end}} + <a href="/pkg/">Packages</a> <span class="sep">|</span> + <a href="/cmd/">Commands</a> <span class="sep">|</span> + <a href="/doc/go_spec.html">Specification</a> + {{if .SearchBox}} + <input id="search" type="search" name="q" value="{{with .Query}}{{html .}}{{end}}" class="{{if not .Query}}inactive{{end}}" placeholder="code search" results="0" /> + {{end}} + </form> + </div> + </div> + <a id="logo-box" href="/"></a> + </div> + <div id="content"> + <!-- Menu is HTML-escaped elsewhere --> + {{with .Menu}} + <div id="menu"> + {{printf "%s" .}} + </div> + {{end}} + + {{with .Title}} + <h1 id="generatedHeader">{{html .}}</h1> + {{end}} + {{with .Subtitle}} + <span class="subtitle">{{html .}}</span> + {{end}} + + <!-- The Table of Contents is automatically inserted in this <div>. + Do not delete this <div>. --> + <div id="nav"></div> + + <!-- Content is HTML-escaped elsewhere --> + {{printf "%s" .Content}} + </div> + <div id="site-info"> + <p>Build version {{html .Version}}. Except as noted, this content is licensed under a <a rel="license" href="http://creativecommons.org/licenses/by/3.0/">Creative Commons Attribution 3.0 License</a>.</p> + </div> +</div> +</body> +</html> diff --git a/lib/godoc/package.html b/lib/godoc/package.html new file mode 100644 index 000000000..7a89d780c --- /dev/null +++ b/lib/godoc/package.html @@ -0,0 +1,122 @@ +<!-- + Copyright 2009 The Go Authors. All rights reserved. + Use of this source code is governed by a BSD-style + license that can be found in the LICENSE file. +--> +{{with .PAst}} + <pre>{{node_html . $.FSet}}</pre> +{{end}} +{{with .PDoc}} + <!-- PackageName is printed as title by the top-level template --> + {{if $.IsPkg}} + <p><code>import "{{html .ImportPath}}"</code></p> + {{end}} + {{comment_html .Doc}} + {{if $.IsPkg}} + {{with .Filenames}} + <p> + <h4>Package files</h4> + <span style="font-size:90%"> + {{range .}} + <a href="/{{.|srcLink}}">{{.|filename|html}}</a> + {{end}} + </span> + </p> + {{end}} + {{end}} + {{with .Consts}} + <h2 id="Constants">Constants</h2> + {{range .}} + {{comment_html .Doc}} + <pre>{{node_html .Decl $.FSet}}</pre> + {{end}} + {{end}} + {{with .Vars}} + <h2 id="Variables">Variables</h2> + {{range .}} + {{comment_html .Doc}} + <pre>{{node_html .Decl $.FSet}}</pre> + {{end}} + {{end}} + {{with .Funcs}} + {{range .}} + {{/* Name is a string - no need for FSet */}} + {{$name_html := html .Name}} + <h2 id="{{$name_html}}">func <a href="/{{posLink_url .Decl $.FSet}}">{{$name_html}}</a></h2> + <p><code>{{node_html .Decl $.FSet}}</code></p> + {{comment_html .Doc}} + {{end}} + {{end}} + {{with .Types}} + {{range .}} + {{$tname_html := node_html .Type.Name $.FSet}} + <h2 id="{{$tname_html}}">type <a href="/{{posLink_url .Decl $.FSet}}">{{$tname_html}}</a></h2> + {{comment_html .Doc}} + <p><pre>{{node_html .Decl $.FSet}}</pre></p> + {{range .Consts}} + {{comment_html .Doc}} + <pre>{{node_html .Decl $.FSet}}</pre> + {{end}} + {{range .Vars}} + {{comment_html .Doc}} + <pre>{{node_html .Decl $.FSet}}</pre> + {{end}} + {{range .Factories}} + {{$name_html := html .Name}} + <h3 id="{{$tname_html}}.{{$name_html}}">func <a href="/{{posLink_url .Decl $.FSet}}">{{$name_html}}</a></h3> + <p><code>{{node_html .Decl $.FSet}}</code></p> + {{comment_html .Doc}} + {{end}} + {{range .Methods}} + {{$name_html := html .Name}} + <h3 id="{{$tname_html}}.{{$name_html}}">func ({{node_html .Recv $.FSet}}) <a href="/{{posLink_url .Decl $.FSet}}">{{$name_html}}</a></h3> + <p><code>{{node_html .Decl $.FSet}}</code></p> + {{comment_html .Doc}} + {{end}} + {{end}} + {{end}} + {{with .Bugs}} + <h2 id="Bugs">Bugs</h2> + {{range .}} + {{comment_html .}} + {{end}} + {{end}} +{{end}} +{{with .PList}} + <h2>Other packages</h2> + <p> + {{/* PList entries are strings - no need for FSet */}} + {{range .}} + <a href="?p={{urlquery .}}">{{html .}}</a><br /> + {{end}} + </p> +{{end}} +{{with .Dirs}} + <p class="detail"> + Need more packages? The + <a href="http://godashboard.appspot.com/package">Package Dashboard</a> + provides a list of <a href="/cmd/goinstall/">goinstallable</a> packages. + </p> + {{/* DirList entries are numbers and strings - no need for FSet */}} + <h2 id="Subdirectories">Subdirectories</h2> + <p> + <table class="layout"> + <tr> + <th align="left" colspan="{{html .MaxHeight}}">Name</th> + <td width="25"> </td> + <th align="left">Synopsis</th> + </tr> + <tr> + <th align="left"><a href="..">..</a></th> + </tr> + {{range .List}} + <tr> + {{repeat `<td width="25"></td>` .Depth}} + <td align="left" colspan="{{html .Height}}"><a href="{{html .Path}}">{{html .Name}}</a></td> + <td></td> + <td align="left">{{html .Synopsis}}</td> + </tr> + {{end}} + </table> + </p> +{{end}} diff --git a/lib/godoc/package.txt b/lib/godoc/package.txt new file mode 100644 index 000000000..179b33493 --- /dev/null +++ b/lib/godoc/package.txt @@ -0,0 +1,82 @@ +{{with .PAst}}{{node . $.FSet}}{{end}}{{/* + +--------------------------------------- + +*/}}{{with .PDoc}}{{if $.IsPkg}}PACKAGE + +package {{.PackageName}} +import "{{.ImportPath}}" + +{{else}}COMMAND DOCUMENTATION + +{{end}}{{.Doc}}{{/* + +--------------------------------------- + +*/}}{{with .Consts}} +CONSTANTS + +{{range .}}{{node .Decl $.FSet}} +{{.Doc}}{{end}} +{{end}}{{/* + +--------------------------------------- + +*/}}{{with .Vars}} +VARIABLES + +{{range .}}{{node .Decl $.FSet}} +{{.Doc}}{{end}} +{{end}}{{/* + +--------------------------------------- + +*/}}{{with .Funcs}} +FUNCTIONS + +{{range .}}{{node .Decl $.FSet}} +{{.Doc}} +{{end}}{{end}}{{/* + +--------------------------------------- + +*/}}{{with .Types}} +TYPES + +{{range .}}{{node .Decl $.FSet}} +{{.Doc}} +{{range .Consts}}{{node .Decl $.FSet}} +{{.Doc}} +{{end}}{{range .Vars}}{{node .Decl $.FSet}} +{{.Doc}} +{{end}}{{range .Factories}}{{node .Decl $.FSet}} +{{.Doc}} +{{end}}{{range .Methods}}{{node .Decl $.FSet}} +{{.Doc}} +{{end}}{{end}}{{end}}{{/* + +--------------------------------------- + +*/}}{{with .Bugs}} +BUGS + +{{range .}}{{.}} +{{end}}{{end}}{{end}}{{/* + +--------------------------------------- + +*/}}{{with .PList}} +OTHER PACKAGES + +{{range .}} +{{.}}{{end}} +{{end}}{{/* + +--------------------------------------- + +*/}}{{with .Dirs}} +SUBDIRECTORIES + +{{range .List}} + {{.Name}}{{end}} +{{end}} diff --git a/lib/godoc/search.html b/lib/godoc/search.html new file mode 100644 index 000000000..36c34f54d --- /dev/null +++ b/lib/godoc/search.html @@ -0,0 +1,98 @@ +<!-- + Copyright 2009 The Go Authors. All rights reserved. + Use of this source code is governed by a BSD-style + license that can be found in the LICENSE file. +--> +{{$query_url := urlquery .Query}} +{{with .Alert}} + <p> + <span class="alert" style="font-size:120%">{{html .}}</span> + </p> +{{end}} +{{with .Alt}} + <p> + <span class="alert" style="font-size:120%">Did you mean: </span> + {{range .Alts}} + <a href="search?q={{urlquery .}}" style="font-size:120%">{{html .}}</a> + {{end}} + </p> +{{end}} +{{with .Hit}} + {{with .Decls}} + <h2 id="Global">Package-level declarations</h2> + {{range .}} + {{$pkg_html := pkgLink .Pak.Path | html}} + <h3 id="Global_{{$pkg_html}}">package <a href="/{{$pkg_html}}">{{html .Pak.Name}}</a></h3> + {{range .Files}} + {{$src_html := srcLink .File.Path | html}} + {{range .Groups}} + {{range .Infos}} + <a href="/{{$src_html}}?h={{$query_url}}#L{{infoLine .}}">{{$src_html}}:{{infoLine .}}</a> + {{infoSnippet_html .}} + {{end}} + {{end}} + {{end}} + {{end}} + {{end}} + {{with .Others}} + <h2 id="Local">Local declarations and uses</h2> + {{range .}} + {{$pkg_html := pkgLink .Pak.Path | html}} + <h3 id="Local_{{$pkg_html}}">package <a href="/{{$pkg_html}}">{{html .Pak.Name}}</a></h3> + {{range .Files}} + {{$src_html := srcLink .File.Path | html}} + <a href="/{{$src_html}}?h={{$query_url}}">{{$src_html}}</a> + <table class="layout"> + {{range .Groups}} + <tr> + <td width="25"></td> + <th align="left" valign="top">{{infoKind_html .Kind}}</th> + <td align="left" width="4"></td> + <td> + {{range .Infos}} + <a href="/{{$src_html}}?h={{$query_url}}#L{{infoLine .}}">{{infoLine .}}</a> + {{end}} + </td> + </tr> + {{end}} + </table> + {{end}} + {{end}} + {{end}} +{{end}} +{{with .Textual}} + {{if $.Complete}} + <h2 id="Textual">{{html $.Found}} textual occurrences</h2> + {{else}} + <h2 id="Textual">More than {{html $.Found}} textual occurrences</h2> + <p> + <span class="alert" style="font-size:120%">Not all files or lines containing "{{html $.Query}}" are shown.</span> + </p> + {{end}} + <p> + <table class="layout"> + {{range .}} + {{$src_html := srcLink .Filename | html}} + <tr> + <td align="left" valign="top"> + <a href="/{{$src_html}}?h={{$query_url}}">{{$src_html}}</a>: + </td> + <td align="left" width="4"></td> + <th align="left" valign="top">{{len .Lines}}</th> + <td align="left" width="4"></td> + <td align="left"> + {{range .Lines}} + <a href="/{{$src_html}}?h={{$query_url}}#L{{html .}}">{{html .}}</a> + {{end}} + {{if not $.Complete}} + ... + {{end}} + </td> + </tr> + {{end}} + {{if not $.Complete}} + <tr><td align="left">...</td></tr> + {{end}} + </table> + </p> +{{end}} diff --git a/lib/godoc/search.txt b/lib/godoc/search.txt new file mode 100644 index 000000000..1dd64afdb --- /dev/null +++ b/lib/godoc/search.txt @@ -0,0 +1,40 @@ +QUERY + {{.Query}} +{{with .Alert}} +{{.}} +{{end}}{{/* .Alert */}}{{/* + +--------------------------------------- + +*/}}{{with .Alt}} +DID YOU MEAN +{{range .Alts}} {{.}} +{{end}}{{end}}{{/* .Alts */}}{{/* + +--------------------------------------- + +*/}}{{with .Hit}}{{with .Decls}} +PACKAGE-LEVEL DECLARATIONS + +{{range .}}package {{.Pak.Name}} +{{range $file := .Files}}{{range .Groups}}{{range .Infos}} {{srcLink $file.File.Path}}:{{infoLine .}}{{end}} +{{end}}{{end}}{{/* .Files */}} +{{end}}{{end}}{{/* .Decls */}}{{/* + +--------------------------------------- + +*/}}{{with .Others}} +LOCAL DECLARATIONS AND USES + +{{range .}}package {{.Pak.Name}} +{{range $file := .Files}}{{range .Groups}}{{range .Infos}} {{srcLink $file.File.Path}}:{{infoLine .}} +{{end}}{{end}}{{end}}{{/* .Files */}} +{{end}}{{end}}{{/* .Others */}}{{end}}{{/* .Hit */}}{{/* + +--------------------------------------- + +*/}}{{if .Textual}}{{if .Complete}}{{.Found}} TEXTUAL OCCURRENCES{{else}}MORE THAN {{.Found}} TEXTUAL OCCURRENCES{{end}} + +{{range .Textual}}{{len .Lines}} {{srcLink .Filename}} +{{end}}{{if not .Complete}}... ... +{{end}}{{end}} |