1
0
mirror of https://github.com/golang/go synced 2024-11-17 09:54:46 -07:00
Commit Graph

327 Commits

Author SHA1 Message Date
Andrew Gerrand
4fa83edf06 cmd/godoc: delete from core repository
The godoc command now lives at code.google.com/p/go.tools/cmd/godoc.

R=golang-dev, r
CC=golang-dev
https://golang.org/cl/12206044
2013-08-01 11:21:17 +10:00
Andrew Gerrand
d920d8d849 doc: don't block page load on JavaScript fetch
R=golang-dev, dsymonds
CC=golang-dev
https://golang.org/cl/12050045
2013-07-30 14:22:14 +10:00
Andrew Gerrand
493538adbf cmd/godoc: set up playground for examples that are already visible
This fixes an issue where linking directly to an example makes it not
runnable and visible only in a tiny window. To see the bug in action,
visit this link: http://golang.org/pkg/strings/#example_Map

R=golang-dev, r
CC=golang-dev
https://golang.org/cl/10679050
2013-07-02 08:44:25 +10:00
Russ Cox
75aab13741 codereview: force hg update after hg pull -u during hg sync
If you hg update your client to an earlier CL, then
hg sync will move you back to tip if it pulls anything in,
but it will leave you where you are if it doesn't pull anything in.
That's confusing: make hg sync always update to tip.

R=golang-dev, bradfitz, r, dsymonds
CC=golang-dev
https://golang.org/cl/10456044
2013-06-25 17:23:21 -04:00
Andrew Gerrand
573c2fd4fe godoc: always use local jQuery script
Fixes #5075.

R=golang-dev, dsymonds
CC=golang-dev
https://golang.org/cl/10084044
2013-06-07 10:46:56 +10:00
Anthony Martin
2bcc30891c codereview: don't warn about secret commits
Normally the codereview plugin disables adding new commits
when not using the submit command. Unfortunately this makes
it impossible to use the Mercurial Queues extension at the
same time.

A feature called "Phases" was introduced in Mercurial 2.1
that allows marking commits as being secret; this means
they will never be pushed to the upstream repository.

We can take advantage of this feature to allow the use of
Mercurial Queues if the mq.secret option has been set in
hgrc(5) and a recent version of Mercurial is used.

R=golang-dev, rsc, minux.ma
CC=golang-dev
https://golang.org/cl/7398055
2013-06-04 15:02:28 -07:00
Francesc Campoy
4b2eb3f9f8 codereview.py: improve error message when user is not a committer
R=adg, bradfitz, r
CC=golang-dev
https://golang.org/cl/9626045
2013-05-22 16:27:39 -07:00
Rob Pike
05e8db985a lib/time: update to IANA 2013c
This should do it for the release.
There was a new data set pushed out a couple of days ago.

Fixes #4553.

R=golang-dev, bradfitz
CC=golang-dev
https://golang.org/cl/8621044
2013-04-22 16:28:42 -07:00
Rob Pike
26e0ddcf2a lib/time: update time zone to IANA version 2013b
Update #4553.

R=golang-dev, bradfitz
CC=golang-dev
https://golang.org/cl/8293043
2013-04-02 16:49:45 -07:00
Robert Griesemer
79682199ce cmd/godoc: don't linkify index entries
Fixes #5186.

R=bradfitz
CC=golang-dev
https://golang.org/cl/8267044
2013-04-02 12:05:14 -07:00
Robert Griesemer
f1b7c140ff cmd/godoc: provide a link from notes to source location
R=golang-dev, r
CC=golang-dev
https://golang.org/cl/8122043
2013-03-28 14:40:59 -07:00
Robert Griesemer
04341b246e cmd/godoc: cleanups
- removed gratuitous empty lines that creeped into command line output
- changed comment color to a dark green so that links don't visually melt into them
- removed some TODOs
- updated doc.go

R=golang-dev, bradfitz
CC=golang-dev
https://golang.org/cl/8108044
2013-03-28 13:05:30 -07:00
Robert Griesemer
12cf2ff00b godoc: pass *PageInfos instead of *token.FileSets in templates
- convert all formatters that require a *token.FileSet to
  consistenly use a *PageInfo as first argument instead
- adjust templates correspondingly
- fix outstanding bug from previous CL 8005044

Going forward, with this change the affected functions have
access to the full page "context" (PageInfo), not just the
respective file set. This will permit better context-dependent
formatting in the future.

R=golang-dev, bradfitz
CC=golang-dev
https://golang.org/cl/7860049
2013-03-26 18:28:16 -07:00
Rob Pike
50231fa19f lib/codereview/codereview.py: fix crash when hg gofmt has no files
The gofmt function was returning a string, which isn't the right type.
Three cheers for dynamic typing.

R=golang-dev, bradfitz
CC=golang-dev
https://golang.org/cl/7917044
2013-03-26 17:32:22 -07:00
Robert Griesemer
5268119f26 go/doc, godoc: improved note reading
- A note doesn't have to be in the first
comment of a comment group anymore, and
several notes may appear in the same comment
group (e.g., it is fairly common to have a
TODO(uid) note immediately following another
comment).

- Define a doc.Note type which also contains
note uid and position info.

- Better formatting in godoc output. The position
information is not yet used, but could be used to
locate the note in the source text if desired.

Fixes #4843.

R=r, cnicolaou
CC=gobot, golang-dev
https://golang.org/cl/7496048
2013-03-19 11:14:35 -07:00
Oling Cat
7023a5d197 lib/godoc: convert indentation to tabs.
R=golang-dev, dsymonds, rsc
CC=golang-dev
https://golang.org/cl/7497048
2013-03-19 09:40:57 -04:00
Russ Cox
037c03b537 codereview: re-enable 15-second status prints
Also print all status changes when using hg -v.

The start_status_thread call was lost during the refactoring in
https://golang.org/cl/5395044/diff/6006/lib/codereview/codereview.py
Oops.

R=golang-dev, r
CC=golang-dev
https://golang.org/cl/7834044
2013-03-15 16:33:04 -04:00
Russ Cox
4e63d6ee4d cmd/godoc: fix BUGS heading in text mode
All the headings are CAPS not Title.

Fixes #4843.

R=golang-dev, bradfitz
CC=golang-dev
https://golang.org/cl/7792043
2013-03-13 15:22:59 -04:00
Robert Griesemer
d74d0b269d cmd/godoc: only show package documentation for commands
Fixed package.txt and adjusted package.html to match
structure (swapped if branches).

Fixes #4861.

R=golang-dev, adg, rsc
CC=golang-dev
https://golang.org/cl/7714043
2013-03-11 13:38:59 -07:00
Russ Cox
be262ce28b lib/time: update link in README; draft now an RFC
R=golang-dev, minux.ma, bradfitz
CC=golang-dev
https://golang.org/cl/7704043
2013-03-11 12:34:55 -04:00
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