summaryrefslogtreecommitdiff
path: root/lib
diff options
context:
space:
mode:
Diffstat (limited to 'lib')
-rw-r--r--lib/codereview/codereview.py1
-rw-r--r--lib/godoc/codewalk.html24
-rw-r--r--lib/godoc/codewalkdir.html11
-rw-r--r--lib/godoc/dirlist.html12
-rw-r--r--lib/godoc/error.html2
-rw-r--r--lib/godoc/godoc.html46
-rw-r--r--lib/godoc/package.html169
-rw-r--r--lib/godoc/package.txt137
-rw-r--r--lib/godoc/search.html121
-rw-r--r--lib/godoc/search.txt83
10 files changed, 289 insertions, 317 deletions
diff --git a/lib/codereview/codereview.py b/lib/codereview/codereview.py
index adaff3287..63f67fff9 100644
--- a/lib/codereview/codereview.py
+++ b/lib/codereview/codereview.py
@@ -1722,6 +1722,7 @@ def submit(ui, repo, *pats, **opts):
print Indent('\n'.join(cl.files), "\t")
return "dry run; not submitted"
+ set_status("pushing " + cl.name + " to remote server")
m = match.exact(repo.root, repo.getcwd(), cl.files)
node = repo.commit(ustr(opts['message']), ustr(userline), opts.get('date'), m)
if not node:
diff --git a/lib/godoc/codewalk.html b/lib/godoc/codewalk.html
index 47f8a22e2..2835c6e82 100644
--- a/lib/godoc/codewalk.html
+++ b/lib/godoc/codewalk.html
@@ -18,9 +18,9 @@
<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">
- {.repeated section File}
- <option value="/doc/codewalk/?fileprint=/{@|html-esc}">{@|html-esc}</option>
- {.end}
+ {{range .File}}
+ <option value="/doc/codewalk/?fileprint=/{{urlquery .}}">{{html .}}</option>
+ {{end}}
</select>
</div>
<div id="code">
@@ -35,19 +35,19 @@
</div>
<div class="right" id="comment-column">
<div id="comment-area">
- {.repeated section Step}
+ {{range .Step}}
<div class="comment first last">
- <a class="comment-link" href="/doc/codewalk/?fileprint=/{File|html-esc}&lo={Lo|html-esc}&hi={Hi|html-esc}#mark" target="code-display"></a>
- <div class="comment-title">{Title|html-esc}</div>
+ <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">
- {.section Err}
- ERROR LOADING FILE: {Err|html-esc}<br/><br/>
- {.end}
- {XML}
+ {{with .Err}}
+ ERROR LOADING FILE: {{html .}}<br/><br/>
+ {{end}}
+ {{.XML}}
</div>
- <div class="comment-text file-name"><span class="path-file">{@|html-esc}</span></div>
+ <div class="comment-text file-name"><span class="path-file">{{html .}}</span></div>
</div>
- {.end}
+ {{end}}
</div>
<div id="comment-options" class="setting">
<a id="prev-comment" href="#"><span class="hotkey">p</span>revious step</a>
diff --git a/lib/godoc/codewalkdir.html b/lib/godoc/codewalkdir.html
index 61a9a8b3b..b7674c6ce 100644
--- a/lib/godoc/codewalkdir.html
+++ b/lib/godoc/codewalkdir.html
@@ -5,11 +5,12 @@
-->
<table class="layout">
-{.repeated section @}
+{{range .}}
<tr>
- <td><a href="{Name|html-esc}">{Name|html-esc}</a></td>
- <td width="25">&nbsp;</td>
- <td>{Title|html-esc}</td>
+ {{$name_html := html .Name}}
+ <td><a href="{{$name_html}}">{{$name_html}}</a></td>
+ <td width="25">&nbsp;</td>
+ <td>{{html .Title}}</td>
</tr>
-{.end}
+{{end}}
</table>
diff --git a/lib/godoc/dirlist.html b/lib/godoc/dirlist.html
index 29b4b2435..a3e1a2fa8 100644
--- a/lib/godoc/dirlist.html
+++ b/lib/godoc/dirlist.html
@@ -16,14 +16,16 @@
<tr>
<td><a href="..">..</a></td>
</tr>
-{.repeated section @}
+{{range .}}
<tr>
- <td align="left"><a href="{@|fileInfoName}">{@|fileInfoName}</a></td>
+ {{$name_html := fileInfoName . | html}}
+ <td align="left"><a href="{{$name_html}}">{{$name_html}}</a></td>
<td></td>
- <td align="right">{@|fileInfoSize}</td>
+ <td align="right">{{html .Size}}</td>
<td></td>
- <td align="left">{@|fileInfoTime}</td>
+ <td align="left">{{fileInfoTime . | html}}</td>
</tr>
-{.end}
+{{end}}
+
</table>
</p>
diff --git a/lib/godoc/error.html b/lib/godoc/error.html
index c14c57405..7573aa236 100644
--- a/lib/godoc/error.html
+++ b/lib/godoc/error.html
@@ -5,5 +5,5 @@
-->
<p>
-<span class="alert" style="font-size:120%">{@|html-esc}</span>
+<span class="alert" style="font-size:120%">{{html .}}</span>
</p>
diff --git a/lib/godoc/godoc.html b/lib/godoc/godoc.html
index bd53f2615..671160d5a 100644
--- a/lib/godoc/godoc.html
+++ b/lib/godoc/godoc.html
@@ -2,11 +2,11 @@
<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8"/>
-{.section Title}
- <title>{@|html-esc} - The Go Programming Language</title>
-{.or}
+{{with .Title}}
+ <title>{{html .}} - The Go Programming Language</title>
+{{else}}
<title>The Go Programming Language</title>
-{.end}
+{{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">
@@ -23,19 +23,17 @@
</ul>
<div class="quickref">
<form method="GET" action="/search">
- {.section PkgRoots}
- {.repeated section PkgRoots}
- <a href="/pkg/{@|html-esc}">{@|html-esc}</a> <span class="sep">|</span>
- {.end}
- {.or}
+ {{range .PkgRoots}}
+ <a href="/pkg/{{html .}}">{{html .}}</a> <span class="sep">|</span>
+ {{else}}
References:
- {.end}
+ {{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>
- {.section SearchBox}
- <input id="search" type="search" name="q" value="{.section Query}{Query|html-esc}{.end}" class="{.section Query}{.or}inactive{.end}" placeholder="code search" results="0" />
- {.end}
+ {{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>
@@ -43,28 +41,28 @@
</div>
<div id="content">
<!-- Menu is HTML-escaped elsewhere -->
- {.section Menu}
+ {{with .Menu}}
<div id="menu">
- {@}
+ {{printf "%s" .}}
</div>
- {.end}
+ {{end}}
- {.section Title}
- <h1 id="generatedHeader">{@|html-esc}</h1>
- {.end}
- {.section Subtitle}
- <span class="subtitle">{@|html-esc}</span>
- {.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 -->
- {Content}
+ {{printf "%s" .Content}}
</div>
<div id="site-info">
- <p>Build version {Version|html-esc}. 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>
+ <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>
diff --git a/lib/godoc/package.html b/lib/godoc/package.html
index cb3ffa2a7..7a89d780c 100644
--- a/lib/godoc/package.html
+++ b/lib/godoc/package.html
@@ -3,119 +3,120 @@
Use of this source code is governed by a BSD-style
license that can be found in the LICENSE file.
-->
-
-{.section PAst}
- <pre>{@ FSet|html-esc}</pre>
-{.end}
-{.section PDoc}
+{{with .PAst}}
+ <pre>{{node_html . $.FSet}}</pre>
+{{end}}
+{{with .PDoc}}
<!-- PackageName is printed as title by the top-level template -->
- {.section IsPkg}
- {# ImportPath is a string - no need for FSet}
- <p><code>import "{ImportPath|html-esc}"</code></p>
- {.end}
- {Doc|html-comment}
- {.section IsPkg}
- {.section Filenames}
- {# Filenames are strings - no need for FSet}
+ {{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%">
- {.repeated section @}
- <a href="/{@|url-src}">{@|localname}</a>
- {.end}
+ {{range .}}
+ <a href="/{{.|srcLink}}">{{.|filename|html}}</a>
+ {{end}}
</span>
</p>
- {.end}
- {.end}
- {.section Consts}
+ {{end}}
+ {{end}}
+ {{with .Consts}}
<h2 id="Constants">Constants</h2>
- {.repeated section @}
- {Doc|html-comment}
- <pre>{Decl FSet|html-esc}</pre>
- {.end}
- {.end}
- {.section Vars}
+ {{range .}}
+ {{comment_html .Doc}}
+ <pre>{{node_html .Decl $.FSet}}</pre>
+ {{end}}
+ {{end}}
+ {{with .Vars}}
<h2 id="Variables">Variables</h2>
- {.repeated section @}
- {Doc|html-comment}
- <pre>{Decl FSet|html-esc}</pre>
- {.end}
- {.end}
- {.section Funcs}
- {.repeated section @}
- {# Name is a string - no need for FSet}
- <h2 id="{Name|html-esc}">func <a href="/{Decl FSet|url-pos}">{Name|html-esc}</a></h2>
- <p><code>{Decl FSet|html-esc}</code></p>
- {Doc|html-comment}
- {.end}
- {.end}
- {.section Types}
- {.repeated section @}
- <h2 id="{Type.Name FSet|html-esc}">type <a href="/{Decl FSet|url-pos}">{Type.Name FSet|html-esc}</a></h2>
- {Doc|html-comment}
- <p><pre>{Decl FSet|html-esc}</pre></p>
- {.repeated section Consts}
- {Doc|html-comment}
- <pre>{Decl FSet|html-esc}</pre>
- {.end}
- {.repeated section Vars}
- {Doc|html-comment}
- <pre>{Decl FSet|html-esc}</pre>
- {.end}
- {.repeated section Factories}
- <h3 id="{Type.Name FSet|html-esc}.{Name|html-esc}">func <a href="/{Decl FSet|url-pos}">{Name|html-esc}</a></h3>
- <p><code>{Decl FSet|html-esc}</code></p>
- {Doc|html-comment}
- {.end}
- {.repeated section Methods}
- <h3 id="{Type.Name FSet|html-esc}.{Name|html-esc}">func ({Recv FSet|html-esc}) <a href="/{Decl FSet|url-pos}">{Name|html-esc}</a></h3>
- <p><code>{Decl FSet|html-esc}</code></p>
- {Doc|html-comment}
- {.end}
- {.end}
- {.end}
- {.section Bugs}
+ {{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>
- {.repeated section @}
- {@|html-comment}
- {.end}
- {.end}
-{.end}
-{.section PList}
+ {{range .}}
+ {{comment_html .}}
+ {{end}}
+ {{end}}
+{{end}}
+{{with .PList}}
<h2>Other packages</h2>
<p>
- {# PLIst entries are strings - no need for FSet}
- {.repeated section @}
- <a href="?p={@|html-esc}">{@|html-esc}</a><br />
- {.end}
+ {{/* PList entries are strings - no need for FSet */}}
+ {{range .}}
+ <a href="?p={{urlquery .}}">{{html .}}</a><br />
+ {{end}}
</p>
-{.end}
-{.section Dirs}
+{{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}
+ {{/* DirList entries are numbers and strings - no need for FSet */}}
<h2 id="Subdirectories">Subdirectories</h2>
<p>
<table class="layout">
<tr>
- <th align="left" colspan="{MaxHeight|html-esc}">Name</th>
+ <th align="left" colspan="{{html .MaxHeight}}">Name</th>
<td width="25">&nbsp;</td>
<th align="left">Synopsis</th>
</tr>
<tr>
<th align="left"><a href="..">..</a></th>
</tr>
- {.repeated section List}
+ {{range .List}}
<tr>
- {Depth|padding}
- <td align="left" colspan="{Height|html-esc}"><a href="{Path|html-esc}">{Name|html-esc}</a></td>
+ {{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">{Synopsis|html-esc}</td>
+ <td align="left">{{html .Synopsis}}</td>
</tr>
- {.end}
+ {{end}}
</table>
</p>
-{.end}
+{{end}}
diff --git a/lib/godoc/package.txt b/lib/godoc/package.txt
index 6fe992dbe..179b33493 100644
--- a/lib/godoc/package.txt
+++ b/lib/godoc/package.txt
@@ -1,95 +1,82 @@
-{.section PAst}
-{@ FSet}
-{.end}
-{.section PDoc}
-{.section IsPkg}
-PACKAGE
-
-package {PackageName}
-import "{ImportPath}"
-{.or}
-COMMAND DOCUMENTATION
-{.end}
-{.section Doc}
-
-{@ FSet}
-{.end}
-{.section Consts}
+{{with .PAst}}{{node . $.FSet}}{{end}}{{/*
+---------------------------------------
+
+*/}}{{with .PDoc}}{{if $.IsPkg}}PACKAGE
+
+package {{.PackageName}}
+import "{{.ImportPath}}"
+
+{{else}}COMMAND DOCUMENTATION
+
+{{end}}{{.Doc}}{{/*
+
+---------------------------------------
+
+*/}}{{with .Consts}}
CONSTANTS
-{.repeated section @}
-{Decl FSet}
-{Doc}
-{.end}
-{.end}
-{.section Vars}
+{{range .}}{{node .Decl $.FSet}}
+{{.Doc}}{{end}}
+{{end}}{{/*
+---------------------------------------
+
+*/}}{{with .Vars}}
VARIABLES
-{.repeated section @}
-{Decl FSet}
-{Doc}
-{.end}
-{.end}
-{.section Funcs}
+{{range .}}{{node .Decl $.FSet}}
+{{.Doc}}{{end}}
+{{end}}{{/*
+
+---------------------------------------
+*/}}{{with .Funcs}}
FUNCTIONS
-{.repeated section @}
-{Decl FSet}
-{Doc}
-{.end}
-{.end}
-{.section Types}
+{{range .}}{{node .Decl $.FSet}}
+{{.Doc}}
+{{end}}{{end}}{{/*
-TYPES
+---------------------------------------
-{.repeated section @}
-{Decl FSet}
-{Doc}
-{.repeated section Consts}
-{Decl FSet}
-{Doc}
-{.end}
-{.repeated section Vars}
-{Decl FSet}
-{Doc}
-{.end}
-{.repeated section Factories}
-{Decl FSet}
-{Doc}
-{.end}
-{.repeated section Methods}
-{Decl FSet}
-{Doc}
-{.end}
-{.end}
-{.end}
-{.section Bugs}
+*/}}{{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
-{.repeated section @}
-{@}
-{.end}
-{.end}
-{.end}
-{.section PList}
+{{range .}}{{.}}
+{{end}}{{end}}{{end}}{{/*
+
+---------------------------------------
+*/}}{{with .PList}}
OTHER PACKAGES
-{.repeated section @}
-{@}
-{.end}
-{.end}
-{.section Dirs}
-{.section Dirs}
+{{range .}}
+{{.}}{{end}}
+{{end}}{{/*
+
+---------------------------------------
+*/}}{{with .Dirs}}
SUBDIRECTORIES
-{.repeated section List}
- {Name}
-{.end}
-{.end}
-{.end}
+{{range .List}}
+ {{.Name}}{{end}}
+{{end}}
diff --git a/lib/godoc/search.html b/lib/godoc/search.html
index 58a933fef..36c34f54d 100644
--- a/lib/godoc/search.html
+++ b/lib/godoc/search.html
@@ -3,93 +3,96 @@
Use of this source code is governed by a BSD-style
license that can be found in the LICENSE file.
-->
-
-{.section Alert}
+{{$query_url := urlquery .Query}}
+{{with .Alert}}
<p>
- <span class="alert" style="font-size:120%">{@}</span>
+ <span class="alert" style="font-size:120%">{{html .}}</span>
</p>
-{.end}
-{.section Alt}
+{{end}}
+{{with .Alt}}
<p>
<span class="alert" style="font-size:120%">Did you mean: </span>
- {.repeated section Alts}
- <a href="search?q={@|html-esc}" style="font-size:120%">{@|html-esc}</a>
- {.end}
+ {{range .Alts}}
+ <a href="search?q={{urlquery .}}" style="font-size:120%">{{html .}}</a>
+ {{end}}
</p>
-{.end}
-{.section Hit}
- {.section Decls}
+{{end}}
+{{with .Hit}}
+ {{with .Decls}}
<h2 id="Global">Package-level declarations</h2>
- {.repeated section @}
- <h3 id="Global_{Pak.Path|url-pkg}">package <a href="/{Pak.Path|url-pkg}">{Pak.Name|html-esc}</a></h3>
- {.repeated section Files}
- {.repeated section Groups}
- {.repeated section Infos}
- <a href="/{File.Path|url-src}?h={Query|urlquery-esc}#L{@|infoLine}">{File.Path|url-src}:{@|infoLine}</a>
- {@|infoSnippet}
- {.end}
- {.end}
- {.end}
- {.end}
- {.end}
- {.section Others}
+ {{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>
- {.repeated section @}
- <h3 id="Local_{Pak.Path|url-pkg}">package <a href="/{Pak.Path|url-pkg}">{Pak.Name|html-esc}</a></h3>
- {.repeated section Files}
- <a href="/{File.Path|url-src}?h={Query|urlquery-esc}">{File.Path|url-src}</a>
+ {{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">
- {.repeated section Groups}
+ {{range .Groups}}
<tr>
<td width="25"></td>
- <th align="left" valign="top">{Kind|infoKind}</th>
+ <th align="left" valign="top">{{infoKind_html .Kind}}</th>
<td align="left" width="4"></td>
<td>
- {.repeated section Infos}
- <a href="/{File.Path|url-src}?h={Query|urlquery-esc}#L{@|infoLine}">{@|infoLine}</a>
- {.end}
+ {{range .Infos}}
+ <a href="/{{$src_html}}?h={{$query_url}}#L{{infoLine .}}">{{infoLine .}}</a>
+ {{end}}
</td>
</tr>
- {.end}
+ {{end}}
</table>
- {.end}
- {.end}
- {.end}
-{.end}
-{.section Textual}
- {.section Complete}
- <h2 id="Textual">{Found|html-esc} textual occurrences</h2>
- {.or}
- <h2 id="Textual">More than {Found|html-esc} textual occurrences</h2>
+ {{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 "{Query|html-esc}" are shown.</span>
+ <span class="alert" style="font-size:120%">Not all files or lines containing "{{html $.Query}}" are shown.</span>
</p>
- {.end}
+ {{end}}
<p>
<table class="layout">
- {.repeated section @}
+ {{range .}}
+ {{$src_html := srcLink .Filename | html}}
<tr>
<td align="left" valign="top">
- <a href="/{Filename|url-src}?h={Query|urlquery-esc}">{Filename|url-src}</a>:
+ <a href="/{{$src_html}}?h={{$query_url}}">{{$src_html}}</a>:
</td>
<td align="left" width="4"></td>
- <th align="left" valign="top">{Lines|numlines}</th>
+ <th align="left" valign="top">{{len .Lines}}</th>
<td align="left" width="4"></td>
<td align="left">
- {.repeated section Lines}
- <a href="/{Filename|url-src}?h={Query|urlquery-esc}#L{@|html-esc}">{@|html-esc}</a>
- {.end}
- {.section Complete}
- {.or}
+ {{range .Lines}}
+ <a href="/{{$src_html}}?h={{$query_url}}#L{{html .}}">{{html .}}</a>
+ {{end}}
+ {{if not $.Complete}}
...
- {.end}
+ {{end}}
</td>
</tr>
- {.end}
- {.section Complete}
- {.or}
+ {{end}}
+ {{if not $.Complete}}
<tr><td align="left">...</td></tr>
- {.end}
+ {{end}}
</table>
</p>
-{.end}
+{{end}}
diff --git a/lib/godoc/search.txt b/lib/godoc/search.txt
index 967c1ac01..1dd64afdb 100644
--- a/lib/godoc/search.txt
+++ b/lib/godoc/search.txt
@@ -1,61 +1,40 @@
QUERY
- {Query}
+ {{.Query}}
+{{with .Alert}}
+{{.}}
+{{end}}{{/* .Alert */}}{{/*
-{.section Alert}
-{@}
+---------------------------------------
-{.end}
-{.section Alt}
+*/}}{{with .Alt}}
DID YOU MEAN
-{.repeated section Alts}
- {@}
-{.end}
+{{range .Alts}} {{.}}
+{{end}}{{end}}{{/* .Alts */}}{{/*
-{.end}
-{.section Hit}
-{.section Decls}
+---------------------------------------
+
+*/}}{{with .Hit}}{{with .Decls}}
PACKAGE-LEVEL DECLARATIONS
-{.repeated section @}
-package {Pak.Name}
-{.repeated section Files}
-{.repeated section Groups}
-{.repeated section Infos}
- {File.Path|url-src}:{@|infoLine}
-{.end}
-{.end}
-{.end}
-
-{.end}
-{.end}
-{.section Others}
+{{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
-{.repeated section @}
-package {Pak.Name}
-{.repeated section Files}
-{.repeated section Groups}
-{.repeated section Infos}
- {File.Path|url-src}:{@|infoLine}
-{.end}
-{.end}
-{.end}
-
-{.end}
-{.end}
-{.end}
-{.section Textual}
-{.section Complete}
-{Found} TEXTUAL OCCURRENCES
-{.or}
-MORE THAN {Found} TEXTUAL OCCURRENCES
-{.end}
-
-{.repeated section @}
-{Lines|numlines} {Filename|url-src}
-{.end}
-{.section Complete}
-{.or}
-... ...
-{.end}
-{.end}
+{{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}}