summaryrefslogtreecommitdiff
path: root/lib
diff options
context:
space:
mode:
authorRobert Griesemer <gri@golang.org>2010-03-24 16:28:59 -0700
committerRobert Griesemer <gri@golang.org>2010-03-24 16:28:59 -0700
commite2854b2f5f4789b20941f5b35082d9fa33c152e3 (patch)
tree06b758d75bb7a76942f54851de8a4c44a545965e /lib
parent944db95d1e486b9b7db9ad4958179d52b4da9717 (diff)
downloadgolang-e2854b2f5f4789b20941f5b35082d9fa33c152e3.tar.gz
godoc: show relative file names without leading '/' (per r's request)
- change the various url-xxx formatters to return a relative URL path - make the leading '/' for URLs explicit in the template - on the way change some |html formatters to |html-esc (html should only be used for formatting AST nodes) R=rsc, r CC=golang-dev http://codereview.appspot.com/740041
Diffstat (limited to 'lib')
-rw-r--r--lib/godoc/dirlist.html4
-rw-r--r--lib/godoc/godoc.html6
-rw-r--r--lib/godoc/package.html16
-rw-r--r--lib/godoc/search.html12
4 files changed, 19 insertions, 19 deletions
diff --git a/lib/godoc/dirlist.html b/lib/godoc/dirlist.html
index a94f249d9..3c1e3aae0 100644
--- a/lib/godoc/dirlist.html
+++ b/lib/godoc/dirlist.html
@@ -18,9 +18,9 @@
</tr>
{.repeated section @}
<tr>
- <td align="left"><a href="{Name|html-esc}{@|dir/}">{Name|html}{@|dir/}</a></td>
+ <td align="left"><a href="{Name|html-esc}{@|dir/}">{Name|html-esc}{@|dir/}</a></td>
<td></td>
- <td align="right">{Size|html}</td>
+ <td align="right">{Size|html-esc}</td>
<td></td>
<td align="left">{Mtime_ns|time}</td>
</tr>
diff --git a/lib/godoc/godoc.html b/lib/godoc/godoc.html
index f41b46a27..99cd55eae 100644
--- a/lib/godoc/godoc.html
+++ b/lib/godoc/godoc.html
@@ -4,7 +4,7 @@
<head>
<meta http-equiv="content-type" content="text/html; charset=utf-8">
- <title>{Title|html}</title>
+ <title>{Title|html-esc}</title>
<link rel="stylesheet" type="text/css" href="/doc/style.css">
<script type="text/javascript" src="/doc/godocs.js"></script>
@@ -121,7 +121,7 @@
<li class="blank">&nbsp;</li>
<li class="navhead">Last update</li>
<li>{Timestamp|time}</li>
- <li>Build version {Version|html}</li>
+ <li>Build version {Version|html-esc}</li>
</ul>
</div>
@@ -133,7 +133,7 @@
</div>
{.end}
- <h1 id="generatedHeader">{Title|html}</h1>
+ <h1 id="generatedHeader">{Title|html-esc}</h1>
<!-- The Table of Contents is automatically inserted in this <div>.
Do not delete this <div>. -->
diff --git a/lib/godoc/package.html b/lib/godoc/package.html
index d0a5970b3..0eff78e45 100644
--- a/lib/godoc/package.html
+++ b/lib/godoc/package.html
@@ -12,7 +12,7 @@
{.section PDoc}
<!-- PackageName is printed as title by the top-level template -->
{.section IsPkg}
- <p><code>import "{ImportPath|html}"</code></p>
+ <p><code>import "{ImportPath|html-esc}"</code></p>
{.end}
{Doc|html-comment}
{.section IsPkg}
@@ -21,7 +21,7 @@
<h4>Package files</h4>
<span style="font-size:90%">
{.repeated section @}
- <a href="{@|url-src}">{@|localname}</a>
+ <a href="/{@|url-src}">{@|localname}</a>
{.end}
</span>
</p>
@@ -43,14 +43,14 @@
{.end}
{.section Funcs}
{.repeated section @}
- <h2 id="{Name|html-esc}">func <a href="{Decl|url-pos}">{Name|html}</a></h2>
+ <h2 id="{Name|html-esc}">func <a href="/{Decl|url-pos}">{Name|html-esc}</a></h2>
<p><code>{Decl|html}</code></p>
{Doc|html-comment}
{.end}
{.end}
{.section Types}
{.repeated section @}
- <h2 id="{Type.Name|html-esc}">type <a href="{Decl|url-pos}">{Type.Name|html}</a></h2>
+ <h2 id="{Type.Name|html-esc}">type <a href="/{Decl|url-pos}">{Type.Name|html-esc}</a></h2>
{Doc|html-comment}
<p><pre>{Decl|html}</pre></p>
{.repeated section Consts}
@@ -62,12 +62,12 @@
<pre>{Decl|html}</pre>
{.end}
{.repeated section Factories}
- <h3 id="{Type.Name|html-esc}.{Name|html-esc}">func <a href="{Decl|url-pos}">{Name|html}</a></h3>
+ <h3 id="{Type.Name|html-esc}.{Name|html-esc}">func <a href="/{Decl|url-pos}">{Name|html-esc}</a></h3>
<p><code>{Decl|html}</code></p>
{Doc|html-comment}
{.end}
{.repeated section Methods}
- <h3 id="{Type.Name|html-esc}.{Name|html-esc}">func ({Recv|html}) <a href="{Decl|url-pos}">{Name|html}</a></h3>
+ <h3 id="{Type.Name|html-esc}.{Name|html-esc}">func ({Recv|html}) <a href="/{Decl|url-pos}">{Name|html-esc}</a></h3>
<p><code>{Decl|html}</code></p>
{Doc|html-comment}
{.end}
@@ -103,9 +103,9 @@
{.repeated section List}
<tr>
{Depth|padding}
- <td align="left" colspan="{Height|html-esc}"><a href="{Path|html-esc}">{Name|html}<a></td>
+ <td align="left" colspan="{Height|html-esc}"><a href="{Path|html-esc}">{Name|html-esc}<a></td>
<td></td>
- <td align="left">{Synopsis|html}</td>
+ <td align="left">{Synopsis|html-esc}</td>
</tr>
{.end}
</table>
diff --git a/lib/godoc/search.html b/lib/godoc/search.html
index 3d417aa27..febd7e569 100644
--- a/lib/godoc/search.html
+++ b/lib/godoc/search.html
@@ -14,7 +14,7 @@
<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}</a>
+ <a href="search?q={@|html-esc}" style="font-size:120%">{@|html-esc}</a>
{.end}
</p>
{.end}
@@ -22,11 +22,11 @@
{.section 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}</a></h3>
+ <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|html-esc}#L{@|infoLine}">{File.Path|url-src}:{@|infoLine}</a>
+ <a href="/{File.Path|url-src}?h={Query|html-esc}#L{@|infoLine}">{File.Path|url-src}:{@|infoLine}</a>
<pre>{@|infoSnippet}</pre>
{.end}
{.end}
@@ -36,9 +36,9 @@
{.section 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}</a></h3>
+ <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|html-esc}">{File.Path|url-src}</a>
+ <a href="/{File.Path|url-src}?h={Query|html-esc}">{File.Path|url-src}</a>
<table class="layout">
{.repeated section Groups}
<tr>
@@ -47,7 +47,7 @@
<td align="left" width="4"></td>
<td>
{.repeated section Infos}
- <a href="{File.Path|url-src}?h={Query|html-esc}#L{@|infoLine}">{@|infoLine}</a>
+ <a href="/{File.Path|url-src}?h={Query|html-esc}#L{@|infoLine}">{@|infoLine}</a>
{.end}
</td>
</tr>