1
0
mirror of https://github.com/golang/go synced 2024-10-03 13:21:22 -06:00
Commit Graph

307 Commits

Author SHA1 Message Date
Cosmos Nicolaou
d6a057c90e cmd/godoc: add support for display Notes parsed by pkg/go/doc
pkg/go/doc: move BUG notes from Package.Bugs to the general Package.Notes field.
Removing .Bugs would break existing code so it's left in for now.

R=gri, gri, gary.burd, dsymonds, rsc, kevlar
CC=golang-dev
https://golang.org/cl/7341053
2013-02-25 20:34:09 -08:00
Volker Dobler
d97b975d5c cmd/godoc: show examples in text mode
Added the command line flag -ex to godoc to print examples in
text output.

Samples from the generated output:

$ godoc -ex strings Index
...
func Index(s, sep string) int
    Index returns the index of the first instance of sep in s, or -1 if sep
    is not present in s.

    Example:
        fmt.Println(strings.Index("chicken", "ken"))
        fmt.Println(strings.Index("chicken", "dmr"))
        // Output:
        // 4
        // -1
...

$ godoc -ex container/heap
...
package heap
    import "container/heap"

    Package heap provides heap operations for any type that implements
    heap.Interface. A heap is a tree with the property that each node is the
    minimum-valued node in its subtree.

    Example:
        // This example demonstrates an integer heap built using the heap interface.
        package heap_test

        import (
            "container/heap"
            "fmt"
        ...

    Example:
        // This example demonstrates a priority queue built using the heap interface.
        package heap_test

        import (
            "container/heap"
            "fmt"
        )
...

Fixes #3587.

R=golang-dev, minux.ma, adg, rsc, gri
CC=golang-dev
https://golang.org/cl/7356043
2013-02-25 10:37:17 +11:00
Robert Griesemer
3ee87d02b0 cmd/godoc: use go/build to determine package and example files
Also:
- faster code for example extraction
- simplify handling of command documentation:
  all "main" packages are treated as commands
- various minor cleanups along the way

For commands written in Go, any doc.go file containing
documentation must now be part of package main (rather
then package documentation), otherwise the documentation
won't show up in godoc (it will still build, though).

For commands written in C, documentation may still be
in doc.go files defining package documentation, but the
recommended way is to explicitly ignore those files with
a +build ignore constraint to define package main.

Fixes #4806.

R=adg, rsc, dave, bradfitz
CC=golang-dev
https://golang.org/cl/7333046
2013-02-19 11:19:58 -08:00
Russ Cox
f19cf640d4 codereview: give up on http fetch after 30 seconds
If Python blocks in the SSL handshake it seems to be
completely uninterruptible, and I've been seeing it
block for at least hours recently. I don't know if the
problem is on the client side or the server side or
somewhere in the network, but setting the timeout
at least means you're guaranteed a new shell prompt
(after printing some errors).

R=golang-dev, bradfitz, minux.ma
CC=golang-dev
https://golang.org/cl/7337048
2013-02-19 10:18:16 -05:00
Cosmos Nicolaou
c5b4292eb3 cmd/godoc: add support for doc.Package.Notes
Add support for displaying the notes of the form 'MARKER(userid): comment' now collected by the go/doc package. Any two or more uppercase letters are recognised as a marker.

R=gri, rsc, bradfitz
CC=golang-dev
https://golang.org/cl/7334044
2013-02-14 20:35:08 -08:00
Russ Cox
8035cbd97c codereview: use hgapplydiff instead of hgpatch
Depends on https://golang.org/cl/7308067

R=golang-dev, bradfitz
CC=golang-dev
https://golang.org/cl/7312064
2013-02-07 23:15:08 -05:00
Russ Cox
e1448c07e1 codereview: show 'not lgtms' in hg p output (with lgtms)
R=golang-dev, iant
CC=golang-dev
https://golang.org/cl/7245043
2013-01-29 09:32:49 -08:00
Andrew Gerrand
2ee06a51be lib/godoc: link to Projects wiki page instead of dashboard
R=golang-dev, minux.ma
CC=golang-dev
https://golang.org/cl/7139057
2013-01-18 19:25:45 +11:00
Shenghou Ma
e470b3354c lib/godoc/example.html: htmlify the play code
Fixes #4539.

R=golang-dev, dsymonds
CC=golang-dev
https://golang.org/cl/6942043
2012-12-13 19:08:51 +08:00
Russ Cox
c3d881b361 lib/codereview: suggest argument to hg mail / hg submit
R=golang-dev, iant
CC=golang-dev
https://golang.org/cl/6924050
2012-12-11 13:36:55 -05:00
Russ Cox
dffdece819 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 #4484.

R=adg, dsymonds
CC=golang-dev
https://golang.org/cl/6868071
2012-12-10 20:20:00 -05:00
Brad Fitzpatrick
372cf8fe87 codereview: always use HTTPS
The new version of rietveld pushed 1.5 hours ago
requires HTTPS now, otherwise it issues a 301
to HTTPS which we barfed on.

R=golang-dev
CC=golang-dev
https://golang.org/cl/6782135
2012-11-29 11:19:55 -08:00
Shenghou Ma
792e664ee4 lib/godoc/codewalk.html: remove duplicate jquery inclusion
now we load jquery in its parent--godoc.html.

R=golang-dev, adg
CC=golang-dev
https://golang.org/cl/6814112
2012-11-18 02:28:54 +08:00
Shenghou Ma
bcdb7926dd codereview: protect against read-only upstream repository
R=golang-dev, bradfitz
CC=golang-dev
https://golang.org/cl/6742053
2012-10-20 17:23:48 +08:00
Uriel Mangado
df7b720708 codereview.py: Fix crash on auth error handling.
In recent Python versions .reason is a read-only property that simply gives you the msg value.

Fixes #4024

R=golang-dev, adg
CC=golang-dev
https://golang.org/cl/6545052
2012-10-11 00:23:53 +08:00
Andrew Gerrand
8438641629 godoc: add dropdown playground to nav bar
R=gri, dsymonds, skybrian
CC=golang-dev
https://golang.org/cl/6631057
2012-10-10 11:17:47 +11:00
Andrew Gerrand
236e79cab3 godoc: fetch jQuery via https
R=rsc, bradfitz
CC=golang-dev
https://golang.org/cl/6614064
2012-10-08 10:40:56 +11:00
Shenghou Ma
eca37e1eed codereview: more mercurial interface fixes
Fixes #4131.

R=golang-dev, rsc
CC=golang-dev
https://golang.org/cl/6614061
2012-10-08 04:19:36 +08:00
Shenghou Ma
593a628572 lib/godoc/godoc.html: try Google hosted jQuery first, fallback to locally hosted one
R=golang-dev, adg
CC=golang-dev
https://golang.org/cl/6593078
2012-10-04 15:14:20 +08:00
Andrew Gerrand
3fd5e0be9d godoc: make examples editable and runnable in playground
R=dsymonds
CC=golang-dev
https://golang.org/cl/6523045
2012-10-04 16:53:05 +10:00
Andrew Gerrand
65dbe6786d godoc: add jQuery to Go repository, rewrite godocs.js to use jQuery
For golang.org I intend to rewrite the jquery link in godoc.html
to point to the Google-hosted jquery.js.

R=dsymonds, minux.ma
CC=golang-dev
https://golang.org/cl/6589071
2012-10-04 15:31:25 +10:00
Andrew Gerrand
e7f453148c godoc: show contents in correct order, expand sections on click
R=dsymonds
CC=gobot, golang-dev
https://golang.org/cl/6588079
2012-10-04 11:21:37 +10:00
Andrew Gerrand
516306f677 godoc: move Examples above Index and make them both collapsable
R=golang-dev, dsymonds, bradfitz, r
CC=golang-dev
https://golang.org/cl/6591066
2012-10-03 15:05:08 +10:00
Robert Hencke
10ea3254a8 codereview.py: suggest installing Mercurial from official website
Continuation of https://golang.org/cl/6499053/

R=golang-dev, minux.ma
CC=golang-dev
https://golang.org/cl/6584059
2012-10-03 06:58:24 +10:00
Shivakumar GN
b7331f9b3a codereview: use subprocess.call() instead of os.spawnvp() for portability
Fixes #4121.

R=golang-dev, minux.ma, dave, r
CC=golang-dev
https://golang.org/cl/6555049
2012-09-27 01:50:59 +08:00
Uriel Mangado
9b8c94a46f codereview.py: correct error handling without decorator
The decorator hides the number of function arguments from Mercurial,
so Mercurial cannot give proper error messages about commands
invoked with the wrong number of arguments.

Left a 'dummy' hgcommand decorator in place as a way to document
what functions are hg commands, and just in case we need some other
kind of hack in the future.

R=adg, rsc
CC=golang-dev
https://golang.org/cl/6488059
2012-09-01 19:55:29 -04:00
Robert Griesemer
f597fa67c1 godoc: report error for directories with multiple packages
Fixes #3922.

R=rsc, adg
CC=golang-dev
https://golang.org/cl/6453094
2012-08-09 16:10:46 -07:00
Robert Griesemer
3601f27708 godoc: make id attributes unique
Some browsers (e.g. IE9) ignore the case of 'id' attributes
which can lead to conflicts. Prefix non-generated 'id's with
"pkg-" to make them different from any generated attribute.

Also: Added missing entry for "Other packages" to top-level
index.

Fixes #3851.

R=adg, dsymonds
CC=golang-dev
https://golang.org/cl/6449105
2012-08-07 17:45:58 -07:00
Dave Cheney
82cbcb0dd5 website: various html fixes
Fixes #3424.

R=fullung, adg
CC=golang-dev
https://golang.org/cl/6343088
2012-07-11 09:41:08 -07:00
Shenghou Ma
dbf6215dd6 codereview: support mercurial 2.2.1
We explicitly use plainformatter to avoid the
        user's debug setting changing our behavior.
        Fixes #3603.

R=golang-dev, rsc
CC=golang-dev
https://golang.org/cl/6201069
2012-05-17 02:54:03 +08:00
Russ Cox
d2e70054c9 codereview: look for new release branches
R=adg
CC=golang-dev
https://golang.org/cl/6127048
2012-04-25 13:44:30 -07:00
Andrew Gerrand
f8dde60e2b doc: don't wrap package names in directory listing
Fixes #3522.

R=golang-dev, dsymonds
CC=golang-dev
https://golang.org/cl/6063054
2012-04-20 10:04:13 -04:00
Anthony Martin
d3889ff322 codereview: restore help messages
Docstrings were not being set for the wrapper
functions returned by the hgcommand decorator.

R=golang-dev, minux.ma, rsc
CC=golang-dev
https://golang.org/cl/6059043
2012-04-17 15:51:05 -07:00
Russ Cox
3b7feb7001 codereview: give advice on 'cannot create CL outside default branch'
Fixes #3430.

R=golang-dev, bradfitz
CC=golang-dev
https://golang.org/cl/5981047
2012-04-02 12:55:23 -04:00
Robert Griesemer
5b5b42ea84 godoc: replace servePage's positional argument list
R=golang-dev, adg, bradfitz
CC=golang-dev
https://golang.org/cl/5869050
2012-03-30 10:42:56 -07:00
Andrew Gerrand
16fd9fd640 doc: link to Go Project Dashboard from package list
R=golang-dev, r
CC=golang-dev
https://golang.org/cl/5937048
2012-03-28 11:38:34 +11:00
Andrew Gerrand
c748689277 doc: update licensing text one more time
R=golang-dev, r
CC=golang-dev
https://golang.org/cl/5916046
2012-03-27 15:09:13 +11:00
Andrew Gerrand
308cc100e6 doc: update footer text
R=golang-dev, rsc
CC=golang-dev
https://golang.org/cl/5920043
2012-03-27 13:35:01 +11:00
Andrew Gerrand
d2991229bc doc: add Terms of Service
R=r
CC=golang-dev
https://golang.org/cl/5913044
2012-03-27 09:27:43 +11:00
Benny Siegert
f4ec146454 doc: Change id of footer
The heading "Copyright" uses id="copyright" as the anchor name.
However, there is also a <div id="copyright"> at the bottom.
Using the same ID value twice in the same file is illegal
(http://www.w3.org/TR/html401/struct/links.html#h-12.2.3).

R=golang-dev, bradfitz, rsc
CC=golang-dev
https://golang.org/cl/5909045
2012-03-26 09:12:15 -07:00
Andrew Gerrand
0b762d9523 godoc: make 'Overview' section collapsable
This makes packages with lengthly package comments easier to browse.

R=golang-dev, r
CC=golang-dev
https://golang.org/cl/5901055
2012-03-26 14:10:27 +11:00
Robert Griesemer
cfd8b84f07 godoc: use shorter titles for tabs
In a browser with many open tabs, the tab titles become short
and uninformative because they all start with the same prefix
("Package ", "Directory ", etc.).

Permit use of shorter tab titles that start with the relevant
information first.

Fixes #3365.

R=golang-dev, bradfitz
CC=golang-dev
https://golang.org/cl/5865056
2012-03-21 11:29:30 -07:00
Russ Cox
b4e0aeac32 lib/godoc: removing leading / from search links
srcLink includes the / now; adding another yields //,
which means something else entirely in URLs.

Fixes #3327.

R=golang-dev, gri
CC=golang-dev
https://golang.org/cl/5823060
2012-03-15 14:50:51 -04:00
Andrew Gerrand
9d08068d21 godoc: style example headings like links
R=golang-dev, gri
CC=golang-dev
https://golang.org/cl/5819048
2012-03-15 08:09:54 +11:00
Andrew Gerrand
2b8bc93f32 godoc: use elastic layout for most pages
We use the absence of a Title to detect the front page.
I can't find other pages without titles, so this seems reasonable.

R=golang-dev, bradfitz, gri
CC=golang-dev
https://golang.org/cl/5797076
2012-03-13 10:17:10 +11:00
Russ Cox
bd71072eee codereview: fix for Mercurial 2.1
Mercurial: the Python of version control systems.
Python: the Mercurial of programming languages.

R=golang-dev, bradfitz
CC=golang-dev
https://golang.org/cl/5777066
2012-03-12 14:39:44 -04:00
Andrew Gerrand
4191ff2436 godoc: switch on +1 buttons
R=golang-dev, r
CC=golang-dev
https://golang.org/cl/5754048
2012-03-06 15:16:45 +11:00
Andrew Gerrand
f200b72a7c doc: add more gophers
R=golang-dev, bradfitz, r
CC=golang-dev
https://golang.org/cl/5753047
2012-03-06 12:50:52 +11:00
Ugorji Nwoke
0eb4df0bc8 cmd/godoc: remove extra / in paths
If I click on links which should send you to source code (e.g. type, function, etc),
the link is to //src/... (instead of /src/...).
This causes a DNS resolution failure on the browser.

Quick fix is to remove the leading / from package.html
(since godoc.go src links automatically add a leading / as necessary).

Fixes #3193.

R=golang-dev, rsc
CC=golang-dev
https://golang.org/cl/5730059
2012-03-05 15:36:33 -05:00
Russ Cox
fae0d35043 godoc: support $GOPATH, simplify file system code
The motivation for this CL is to support $GOPATH well.
Since we already have a FileSystem interface, implement a
Plan 9-style name space.  Bind each of the $GOPATH src
directories onto the $GOROOT src/pkg directory: now
everything is laid out exactly like a normal $GOROOT and
needs very little special case code.

The filter files are no longer used (by us), so I think they
can just be deleted.  Similarly, the Mapping code and the
FileSystem interface were two different ways to accomplish
the same end, so delete the Mapping code.

Within the implementation, since FileSystem is defined to be
slash-separated, use package path consistently, leaving
path/filepath only for manipulating operating system paths.

I kept the -path flag, but I think it can be deleted too.

Fixes #2234.
Fixes #3046.

R=gri, r, r, rsc
CC=golang-dev
https://golang.org/cl/5711058
2012-03-05 10:02:46 -05:00