To structure larger sections of comments in html output headings
are detected in comments and formated as h3 in the generated html.
A simple heuristic is used to detect headings in comments:
A heading is a non-blank, non-indented line preceded by a blank
line. It is followed by a blank and a non-blank, non-indented line.
A heading must start with an uppercase letter and end with a letter,
digit or a colon. A heading may not contain punctuation characters.
R=jan.mercl, gri, adg, rsc, r
CC=golang-dev
https://golang.org/cl/5437056
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
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
Regular expressions may now be used in conjuction with full text
search. Godoc will show the first 10000 occurences in the source
code and highlight the respective text segments.
- added new flag -testDir to specify a small directory for testing
(fast index creation; default = "")
- use new FormatText function to format text and Go source
code in HTML, supporting multiple kinds of text selections
simulatenously); this replaces the uses of go/printer
Stylers
- for now removed currently unused mechanism for identifier-
specific JS popups (will come back in some form once we
have type or other useful information)
- various typo fixes and minor cleanups throughout
Missing:
- indexing of non-.go files
R=r, r2
CC=golang-dev, rsc
https://golang.org/cl/3699041
The front page remains fixed-width.
All other pages should look good in windows >=500px wide.
Includes additional styles for search result highlighting,
code comments, and general CSS clean-ups.
Tested with Chrome 6, Firefox 3.6, IE 7, and IE 8.
R=gri, r
CC=golang-dev
https://golang.org/cl/2229041