1. Generate TOC for package pages using template,
instead of using JavaScript magic. This makes the
pages generated by godoc -html easier to export
to other systems.
2. Make TOC one column. It's hard to do two columns
portably without invoking JavaScript.
3. Since the TOC is only one column, show full type
signatures for functions and methods. Many times
that's all you need to see anyway.
4. Name the section after the TOC "Overview".
Naming it something is important, to set it off
from the TOC and so that there's a quick link to
it in the TOC.
For now, some illustrative examples:
http://swtch.com:6060/pkg/io/http://swtch.com:6060/pkg/strings/http://swtch.com:6060/pkg/tabwriter/http://swtch.com:6060/pkg/unicode/Fixes#1982.
R=gri, bradfitz, r
CC=golang-dev
https://golang.org/cl/5303044
This CL introduces the go.Example type and go.Examples functions that
are used to represent and extract code samples from Go source.
They should be of the form:
// Output of this function.
func ExampleFoo() {
fmt.Println("Output of this function.")
}
It also modifies godoc to read example code from _test.go files,
and include them in the HTML output with JavaScript-driven toggles.
It also implements testing of example functions with gotest.
The stdout/stderr is compared against the output comment on the
function.
This CL includes examples for the sort.Ints function and the
sort.SortInts type. After patching this CL in and re-building go/doc
and godoc, try
godoc -http=localhost:6060
and visit http://localhost:6060/pkg/sort/
R=gri, r, rsc
CC=golang-dev
https://golang.org/cl/5137041
Fixes a JS crash which prevented the automatically generated
table of contents to not appear.
R=adg, bradfitz
CC=golang-dev
https://golang.org/cl/4460041
Uses placeholder attribute instead of changing the value of search
field on browsers that support it. On other browsers, the fake
placeholder text is restored when the empty box loses focus.
R=golang-dev, gri
CC=golang-dev
https://golang.org/cl/4441041
+ style sheet: like code.google.com but less feature-ful
+ JS with table-of-contents generation
+ tweaked go_spec.html and go_mem.html to use new style+JS
+ static-HTML-ified a few other Go docs:
+ static HTML versions of some wiki pages (which I'll turn
into links to these pages).
A notable thing that is _not_ in this changelist: any change
to the godoc tool or whatever thing generates http://go/godoc
R=r
APPROVED=r
DELTA=2472 (2307 added, 113 deleted, 52 changed)
OCL=34644
CL=34728