Skip to content
Projects
Groups
Snippets
Help
Loading...
Sign in
Toggle navigation
G
golang
Project
Project
Details
Activity
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Board
Labels
Milestones
Merge Requests
0
Merge Requests
0
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Commits
Issue Boards
Open sidebar
go
golang
Commits
5e48e648
Commit
5e48e648
authored
Aug 13, 2011
by
David Symonds
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
exp/template: rename filter: url -> urlquery.
R=r, rsc CC=golang-dev
https://golang.org/cl/4873046
parent
c71b6767
Hide whitespace changes
Inline
Side-by-side
Showing
9 changed files
with
32 additions
and
32 deletions
+32
-32
codewalk.html
lib/godoc/codewalk.html
+2
-2
codewalkdir.html
lib/godoc/codewalkdir.html
+1
-1
dirlist.html
lib/godoc/dirlist.html
+1
-1
godoc.html
lib/godoc/godoc.html
+1
-1
package.html
lib/godoc/package.html
+1
-1
search.html
lib/godoc/search.html
+8
-8
doc.go
src/pkg/exp/template/doc.go
+2
-2
exec_test.go
src/pkg/exp/template/exec_test.go
+2
-2
funcs.go
src/pkg/exp/template/funcs.go
+14
-14
No files found.
lib/godoc/codewalk.html
View file @
5e48e648
...
...
@@ -19,7 +19,7 @@
</a>
<select
id=
"code-selector"
>
{{range .File}}
<option
value=
"/doc/codewalk/?fileprint=/{{url .}}"
>
{{html .}}
</option>
<option
value=
"/doc/codewalk/?fileprint=/{{url
query
.}}"
>
{{html .}}
</option>
{{end}}
</select>
</div>
...
...
@@ -37,7 +37,7 @@
<div
id=
"comment-area"
>
{{range .Step}}
<div
class=
"comment first last"
>
<a
class=
"comment-link"
href=
"/doc/codewalk/?fileprint=/{{url
.File}}&lo={{url .Lo}}&hi={{url
.Hi}}#mark"
target=
"code-display"
></a>
<a
class=
"comment-link"
href=
"/doc/codewalk/?fileprint=/{{url
query .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}}
...
...
lib/godoc/codewalkdir.html
View file @
5e48e648
...
...
@@ -7,7 +7,7 @@
<table
class=
"layout"
>
{{range .}}
<tr>
<td><a
href=
"{{
ur
l .Name}}"
>
{{html .Name}}
</a></td>
<td><a
href=
"{{
htm
l .Name}}"
>
{{html .Name}}
</a></td>
<td
width=
"25"
>
</td>
<td>
{{html .Title}}
</td>
</tr>
...
...
lib/godoc/dirlist.html
View file @
5e48e648
...
...
@@ -18,7 +18,7 @@
</tr>
{{range .}}
<tr>
<td
align=
"left"
><a
href=
"{{.|fileInfoName|
ur
l}}"
>
{{.|fileInfoName|html}}
</a></td>
<td
align=
"left"
><a
href=
"{{.|fileInfoName|
htm
l}}"
>
{{.|fileInfoName|html}}
</a></td>
<td></td>
<td
align=
"right"
>
{{html .Size}}
</td>
<td></td>
...
...
lib/godoc/godoc.html
View file @
5e48e648
...
...
@@ -25,7 +25,7 @@
<form
method=
"GET"
action=
"/search"
>
{{with .PkgRoots}}
{{range .PkgRoots}}
<a
href=
"/pkg/{{
ur
l .}}"
>
{{html .}}
</a>
<span
class=
"sep"
>
|
</span>
<a
href=
"/pkg/{{
htm
l .}}"
>
{{html .}}
</a>
<span
class=
"sep"
>
|
</span>
{{end}}
{{else}}
References:
...
...
lib/godoc/package.html
View file @
5e48e648
...
...
@@ -87,7 +87,7 @@
<p>
{{/* PList entries are strings - no need for FSet */}}
{{range .}}
<a
href=
"?p={{url .}}"
>
{{html .}}
</a><br
/>
<a
href=
"?p={{url
query
.}}"
>
{{html .}}
</a><br
/>
{{end}}
</p>
{{end}}
...
...
lib/godoc/search.html
View file @
5e48e648
...
...
@@ -12,7 +12,7 @@
<p>
<span
class=
"alert"
style=
"font-size:120%"
>
Did you mean:
</span>
{{range .Alts}}
<a
href=
"search?q={{url .}}"
style=
"font-size:120%"
>
{{html .}}
</a>
<a
href=
"search?q={{url
query
.}}"
style=
"font-size:120%"
>
{{html .}}
</a>
{{end}}
</p>
{{end}}
...
...
@@ -21,12 +21,12 @@
<h2
id=
"Global"
>
Package-level declarations
</h2>
{{range .}}
{{$pkg := pkgLink .Pak.Path}}
<h3
id=
"Global_{{html $pkg}}"
>
package
<a
href=
"/{{
url
$pkg}}"
>
{{html .Pak.Name}}
</a></h3>
<h3
id=
"Global_{{html $pkg}}"
>
package
<a
href=
"/{{$pkg}}"
>
{{html .Pak.Name}}
</a></h3>
{{range .Files}}
{{$src := srcLink .File.Path}}
{{range .Groups}}
{{range .Infos}}
<a
href=
"/{{
url $src}}?h={{url
$.Query}}#L{{infoLine .}}"
>
{{html $src}}:{{infoLine .}}
</a>
<a
href=
"/{{
$src}}?h={{urlquery
$.Query}}#L{{infoLine .}}"
>
{{html $src}}:{{infoLine .}}
</a>
{{infoSnippet_html .}}
{{end}}
{{end}}
...
...
@@ -37,10 +37,10 @@
<h2
id=
"Local"
>
Local declarations and uses
</h2>
{{range .}}
{{$pkg := pkgLink .Pak.Path}}
<h3
id=
"Local_{{html $pkg}}"
>
package
<a
href=
"/{{
url
$pkg}}"
>
{{html .Pak.Name}}
</a></h3>
<h3
id=
"Local_{{html $pkg}}"
>
package
<a
href=
"/{{$pkg}}"
>
{{html .Pak.Name}}
</a></h3>
{{range .Files}}
{{$src := srcLink .File.Path}}
<a
href=
"/{{
url $src}}?h={{url
$.Query}}"
>
{{html $src}}
</a>
<a
href=
"/{{
$src}}?h={{urlquery
$.Query}}"
>
{{html $src}}
</a>
<table
class=
"layout"
>
{{range .Groups}}
<tr>
...
...
@@ -49,7 +49,7 @@
<td
align=
"left"
width=
"4"
></td>
<td>
{{range .Infos}}
<a
href=
"/{{
url $src}}?h={{url
$.Query}}#L{{infoLine .}}"
>
{{infoLine .}}
</a>
<a
href=
"/{{
$src}}?h={{urlquery
$.Query}}#L{{infoLine .}}"
>
{{infoLine .}}
</a>
{{end}}
</td>
</tr>
...
...
@@ -74,14 +74,14 @@
{{$src := srcLink .Filename}}
<tr>
<td
align=
"left"
valign=
"top"
>
<a
href=
"/{{
url $src}}?h={{url
$.Query}}"
>
{{html $src}}
</a>
:
<a
href=
"/{{
$src}}?h={{urlquery
$.Query}}"
>
{{html $src}}
</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=
"/{{
url $src}}?h={{url $.Query}}#L{{url
.}}"
>
{{html .}}
</a>
<a
href=
"/{{
$src}}?h={{urlquery $.Query}}#L{{
.}}"
>
{{html .}}
</a>
{{end}}
{{if not $.Complete}}
...
...
...
src/pkg/exp/template/doc.go
View file @
5e48e648
...
...
@@ -247,9 +247,9 @@ Predefined global functions are named as follows.
An alias for fmt.Sprintf
println
An alias for fmt.Sprintln
url
url
query
Returns the escaped value of the textual representation of
its arguments in a form suitable for embedding in a URL.
its arguments in a form suitable for embedding in a URL
query
.
The boolean functions take any zero value to be false and a non-zero value to
be true.
...
...
src/pkg/exp/template/exec_test.go
View file @
5e48e648
...
...
@@ -313,8 +313,8 @@ var execTests = []execTest{
// JavaScript.
{
"js"
,
`{{js .}}`
,
`It\'d be nice.`
,
`It'd be nice.`
,
true
},
// URL.
{
"url
"
,
`{{"http://www.example.org/"|url
}}`
,
"http%3A%2F%2Fwww.example.org%2F"
,
nil
,
true
},
// URL
query
.
{
"url
query"
,
`{{"http://www.example.org/"|urlquery
}}`
,
"http%3A%2F%2Fwww.example.org%2F"
,
nil
,
true
},
// Booleans
{
"not"
,
"{{not true}} {{not false}}"
,
"false true"
,
nil
,
true
},
...
...
src/pkg/exp/template/funcs.go
View file @
5e48e648
...
...
@@ -23,17 +23,17 @@ import (
type
FuncMap
map
[
string
]
interface
{}
var
builtins
=
FuncMap
{
"and"
:
and
,
"html"
:
HTMLEscaper
,
"index"
:
index
,
"js"
:
JSEscaper
,
"len"
:
length
,
"not"
:
not
,
"or"
:
or
,
"print"
:
fmt
.
Sprint
,
"printf"
:
fmt
.
Sprintf
,
"println"
:
fmt
.
Sprintln
,
"url
"
:
URL
Escaper
,
"and"
:
and
,
"html"
:
HTMLEscaper
,
"index"
:
index
,
"js"
:
JSEscaper
,
"len"
:
length
,
"not"
:
not
,
"or"
:
or
,
"print"
:
fmt
.
Sprint
,
"printf"
:
fmt
.
Sprintf
,
"println"
:
fmt
.
Sprintln
,
"url
query"
:
URLQuery
Escaper
,
}
var
builtinFuncs
=
createValueFuncs
(
builtins
)
...
...
@@ -354,9 +354,9 @@ func JSEscaper(args ...interface{}) string {
return
JSEscapeString
(
s
)
}
// URL
Escaper returns the escaped value of the textual representation of its
//
arguments in a form suitable for embedding in a URL
.
func
URLEscaper
(
args
...
interface
{})
string
{
// URL
QueryEscaper returns the escaped value of the textual representation of
//
its arguments in a form suitable for embedding in a URL query
.
func
URL
Query
Escaper
(
args
...
interface
{})
string
{
s
,
ok
:=
""
,
false
if
len
(
args
)
==
1
{
s
,
ok
=
args
[
0
]
.
(
string
)
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment