]> Cypherpunks repositories - gostls13.git/commitdiff
godoc: move example list into index section
authorRuss Cox <rsc@golang.org>
Tue, 11 Dec 2012 01:20:00 +0000 (20:20 -0500)
committerRuss Cox <rsc@golang.org>
Tue, 11 Dec 2012 01:20:00 +0000 (20:20 -0500)
Putting it before the Index (where it is now) is wrong:
we don't even know what's in the package yet.

Fixes #4484.

R=adg, dsymonds
CC=golang-dev
https://golang.org/cl/6868071

lib/godoc/package.html

index a94a43fd0959286bb46affb0dc23067f7a8a8964..1a17ad9b9ea84ebf9bd9e04b8ed64c8cc2d0debd 100644 (file)
                        </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}}
                </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>
                        </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>