summaryrefslogtreecommitdiff
path: root/lib
diff options
context:
space:
mode:
authorRuss Cox <rsc@golang.org>2012-12-10 20:20:00 -0500
committerRuss Cox <rsc@golang.org>2012-12-10 20:20:00 -0500
commit8b8f0dedb40aaf01175d274636926dcc0db17a20 (patch)
tree53025c9e4a28e8889925c91b820e0803ebce269e /lib
parent611cf4eb5c4656116675961bf3823f325d00a0bf (diff)
downloadgo-8b8f0dedb40aaf01175d274636926dcc0db17a20.tar.gz
godoc: move example list into index section
Putting it before the Index (where it is now) is wrong: we don't even know what's in the package yet. Fixes issue 4484. R=adg, dsymonds CC=golang-dev https://codereview.appspot.com/6868071
Diffstat (limited to 'lib')
-rw-r--r--lib/godoc/package.html29
1 files changed, 12 insertions, 17 deletions
diff --git a/lib/godoc/package.html b/lib/godoc/package.html
index a94a43fd0..1a17ad9b9 100644
--- a/lib/godoc/package.html
+++ b/lib/godoc/package.html
@@ -17,10 +17,10 @@
</dl>
<dl>
<dd><a href="#pkg-overview" class="overviewLink">Overview</a></dd>
+ <dd><a href="#pkg-index" class="indexLink">Index</a></dd>
{{if $.Examples}}
<dd><a href="#pkg-examples" class="examplesLink">Examples</a></dd>
{{end}}
- <dd><a href="#pkg-index" class="indexLink">Index</a></dd>
{{if $.Dirs}}
<dd><a href="#pkg-subdirectories">Subdirectories</a></dd>
{{end}}
@@ -38,22 +38,6 @@
</div>
{{example_html "" $.Examples $.FSet}}
- {{if $.Examples}}
- <div id="pkg-examples" class="toggleVisible">
- <div class="collapsed">
- <h2 class="toggleButton" title="Click to show Examples section">Examples ▹</h2>
- </div>
- <div class="expanded">
- <h2 class="toggleButton" title="Click to hide Examples section">Examples ▾</h2>
- <dl>
- {{range $.Examples}}
- <dd><a class="exampleLink" href="#example_{{.Name}}">{{example_name .Name}}</a></dd>
- {{end}}
- </dl>
- </div>
- </div>
- {{end}}
-
<div id="pkg-index" class="toggleVisible">
<div class="collapsed">
<h2 class="toggleButton" title="Click to show Index section">Index ▹</h2>
@@ -92,6 +76,17 @@
</dl>
</div><!-- #manual-nav -->
+ {{if $.Examples}}
+ <div id="pkg-examples">
+ <h4>Examples</h4>
+ <dl>
+ {{range $.Examples}}
+ <dd><a class="exampleLink" href="#example_{{.Name}}">{{example_name .Name}}</a></dd>
+ {{end}}
+ </dl>
+ </div>
+ {{end}}
+
{{with .Filenames}}
<h4>Package files</h4>
<p>