1
0
mirror of https://github.com/golang/go synced 2024-09-30 20:28:32 -06:00
Commit Graph

81 Commits

Author SHA1 Message Date
Andrew Gerrand
af97332187 cmd/godoc: send go-source meta tag for golang.org/x repos
This allows godoc.org to link to the source code. I chose to link to
github.com instead of googlesource.com because their file browser is
better.

Details here:
864b1c0aba

Change-Id: I962b3fadc822e753245f52240937be5c7e158dc7
Reviewed-on: https://go-review.googlesource.com/2719
Reviewed-by: Brad Fitzpatrick <bradfitz@golang.org>
2015-01-14 02:42:10 +00:00
Péter Surányi
bd69d2dd34 cmd/godoc: mention examples feature in godoc
Godoc documentation did not mention the feature for showing example code
runnable by the testing package. Add a link to the testing package.

Update golang/go#9471

Change-Id: Ic15794c59732e9b0b42c5b16c60be0a47c41afa5
Reviewed-on: https://go-review.googlesource.com/2490
Reviewed-by: Andrew Gerrand <adg@golang.org>
2015-01-08 02:02:02 +00:00
Andrew Gerrand
c836fe615a cmd/godoc: add golang.org/x/playground custom import path
Change-Id: Ic399dbf8a77e7c61ba8be263515b13a6b488b4e9
Reviewed-on: https://go-review.googlesource.com/2309
Reviewed-by: Rob Pike <r@golang.org>
2015-01-06 02:12:10 +00:00
Shenghou Ma
f72c7f7642 cmd/godoc: show the BUG section
This will match the default behavior when running locally.

In fact, our http://blog.golang.org/godoc-documenting-go-code explicitly
documents this feature (see also golang.org/cl/1953).

Change-Id: I581b17b60229ce70900cb51d548d1e2a34df41ba
Signed-off-by: Shenghou Ma <minux@golang.org>
Reviewed-on: https://go-review.googlesource.com/2116
Reviewed-by: Andrew Gerrand <adg@golang.org>
2014-12-28 23:27:51 +00:00
Emil Hessman
864e280a1d cmd/godoc: add missing space to flag description
Change-Id: I8f4dada13353065475baf33c71e6e1a28f889e71
Reviewed-on: https://go-review.googlesource.com/1892
Reviewed-by: Ian Lance Taylor <iant@golang.org>
2014-12-19 19:42:26 +00:00
Oling Cat
65b875be27 cmd/godoc: update GAE setup script
Change-Id: Ief2c49a03cbd3251d62d854be4f51dcb27a42458
Reviewed-on: https://go-review.googlesource.com/1522
Reviewed-by: Andrew Gerrand <adg@golang.org>
2014-12-19 02:48:01 +00:00
Brad Fitzpatrick
88d370fb93 cmd/godoc: add debug subrepo meta to x handler
Change-Id: I0ba56b32dd9b53d06817f9f7e2dafff04e6a86d2
Reviewed-on: https://go-review.googlesource.com/1565
Reviewed-by: David Symonds <dsymonds@golang.org>
2014-12-15 04:44:49 +00:00
David Symonds
24257c8cd2 tools: add import comments.
Change-Id: Idda6e64580432cb9a731e4ebf4005ee4ceb4202d
Reviewed-on: https://go-review.googlesource.com/1244
Reviewed-by: Andrew Gerrand <adg@golang.org>
2014-12-09 22:42:16 +00:00
Andrew Gerrand
9e66c59fb1 x/tools/cmd/godoc: update golang.org/x/ redirects to point to git repos
LGTM=dsymonds
R=dsymonds
CC=golang-codereviews
https://golang.org/cl/182620043
2014-12-08 10:30:52 +11:00
Andrew Gerrand
354b6ccbcc x/tools/cmd/godoc: add golang.org/x/oauth2 import path
LGTM=r
R=jbd, r
CC=golang-codereviews
https://golang.org/cl/175700043
2014-11-26 15:31:30 +11:00
Andrew Gerrand
4f9827a99d x/tools/cmd/godoc: fix bad repository path
Not caught by inattentive reviewer. Pick up your game, people.

LGTM=r
R=r
CC=golang-codereviews
https://golang.org/cl/180880043
2014-11-19 15:51:44 +11:00
Andrew Gerrand
1536a92c03 x/tools/cmd/godoc: add golang.org/x/review custom import path
LGTM=r
R=r
CC=golang-codereviews
https://golang.org/cl/174410043
2014-11-19 14:03:19 +11:00
Andrew Gerrand
5ebbcd132f go.tools: use golang.org/x/... import paths
Rewrite performed with this command:
  sed -i '' 's_code.google.com/p/go\._golang.org/x/_g' \
    $(grep -lr 'code.google.com/p/go.' *)

LGTM=rsc
R=rsc
CC=golang-codereviews
https://golang.org/cl/170920043
2014-11-10 08:50:40 +11:00
Andrew Gerrand
5d1cfb1968 go.tools/cmd/godoc: add handlers for new sub-repo paths
Fixes golang/go#9009.

LGTM=rsc
R=rsc
CC=golang-codereviews
https://golang.org/cl/162470043
2014-10-31 09:01:52 +11:00
Alex Brainman
4bb917e48d go.tools/cmd/godoc: wait for godoc to exit before removing tmp directory
otherwise tmp directories do not get deleted on windows

LGTM=adg
R=golang-codereviews, adg
CC=golang-codereviews
https://golang.org/cl/166750043
2014-10-28 16:59:58 +11:00
Alex Brainman
d8b266df1c go.tools/cmd/godoc: wait for analysis to complete in TestTypeAnalysis
LGTM=adg
R=golang-codereviews, adg
CC=golang-codereviews
https://golang.org/cl/157590043
2014-10-28 12:25:46 +11:00
Hana Kim
13837d25ef godoc: exclude internal packages and cmd from packages page.
Internal packages are now only included with ?m=all

Fixes golang/go#8879

LGTM=bradfitz
R=golang-codereviews, bradfitz
CC=golang-codereviews
https://golang.org/cl/155910044
2014-10-13 18:47:02 +02:00
Alan Donovan
6c93dbff3e go.tools/godoc: deal with fallout from $GOROOT/src/pkg -> $GOROOT/src renaming.
To avoid breaking URLs, we redirect /src/pkg/* to /src/*.

The URL /pkg is now the "directory" /src, which triggers the
"Packages" index.

All other references to "src/pkg" are now gone,
except a number in the namespace documentation which are
probably still illustrative.

Tested: go test cmd/godoc godoc
        Manual inspection of src and src/pkg pages.
        with GOROOT and GOPATH packages
        -analysis
        /AUTHORS file URL still works

LGTM=bradfitz, adg
R=bradfitz, adg
CC=golang-codereviews
https://golang.org/cl/141770044
2014-09-10 09:02:54 -04:00
Andrew Gerrand
4aa650cf80 go.tools/cmd/godoc: register redirect handler for /dl/
LGTM=minux
R=golang-codereviews, gobot, bradfitz, minux
CC=golang-codereviews
https://golang.org/cl/107050044
2014-06-18 15:44:09 +10:00
Andrew Gerrand
5a5dc64a96 go.tools/godoc: fix index reading and writing
In command godoc, set IndexEnabled when the -write_index flag is set.
Previously you would need to (unintuitively) set the -http flag to
achieve this.

In package godoc, set up the FS tree before loading the index, and
then return before starting the index refresh loop. Previously the
index would be loaded and then immediately refreshed, negating the
benefits of the on-disk index.

TBR=bradfitz
R=golang-codereviews
CC=golang-codereviews
https://golang.org/cl/103370046
2014-06-13 16:49:32 +10:00
Andrew Gerrand
93b08999a7 go.tools/cmd/godoc: set corpus.MaxResults in appinit.go
LGTM=bradfitz
R=bradfitz
CC=golang-codereviews
https://golang.org/cl/101220045
2014-06-13 15:20:15 +10:00
Rob Pike
6f17d00f0d go.tools: fix various minor issues found by go vet
LGTM=adonovan
R=adonovan
CC=golang-codereviews
https://golang.org/cl/96360048
2014-05-19 08:47:28 -07:00
Alex Brainman
d52b449ed7 go.tools/cmd/godoc: prevent duplicate GOROOT/GOPATH in environment in TestTypeAnalysis
LGTM=bradfitz
R=golang-codereviews, bradfitz
CC=golang-codereviews
https://golang.org/cl/94430044
2014-05-14 12:39:20 +10:00
Alan Donovan
4a9f74ad65 cmd/godoc: wait up to 500ms for results of -analysis=type.
(The test thread is racing with the analysis thread, which
takes around 4ms on this input.)

LGTM=gri
R=gri, bradfitz
CC=golang-codereviews
https://golang.org/cl/89780044
2014-04-21 17:56:06 -04:00
Alan Donovan
4843aaee02 godoc: add very basic integration test of godoc -analysis=type.
Also: fix careless regression introduced yesterday.

LGTM=bgarcia
R=bgarcia
CC=golang-codereviews
https://golang.org/cl/88880043
2014-04-17 15:51:27 -04:00
Alan Donovan
503140c72e godoc: documentation of -analysis features.
The text and images are "baked in" to the godoc executable's
rodata section (~300KB) and are accessible from the godoc
server itself at /lib/godoc/analysis/help.html.

In due course, the page will become visible at
http://golang.org/lib/godoc/analysis/help.html, which will be
the canonical location for this doc (in announcements, etc).

The page is temporarily visible here, for those on the Google corp network:
http://172.26.104.127:7777/lib/godoc/analysis/help.html

Also:
- add link to new doc from source view pages.
- document -analysis flag in cmd/godoc/doc.go
- fix indentation of -analysis flag's help string

LGTM=gri
R=gri, bgarcia, r
CC=golang-codereviews
https://golang.org/cl/87110045
2014-04-16 16:35:08 -04:00
Alex Brainman
2961704231 go.tools/cmd/godoc: correct TestCLI match string on windows
Fixes golang/go#7707

LGTM=bradfitz
R=golang-codereviews, bradfitz
CC=golang-codereviews
https://golang.org/cl/84280045
2014-04-06 12:41:24 +10:00
Alan Donovan
7877131709 cmd/godoc: fix careless crash introduced by recent analysis CL
+ basic integration test

LGTM=bgarcia
R=bgarcia, bradfitz
CC=golang-codereviews
https://golang.org/cl/76410045
2014-03-16 16:17:13 -04:00
Alan Donovan
80c4f06c0f go.tools/godoc: server mode: add support for type and pointer analysis.
See analysis.go for overview of new features.
See README for known bugs and issues.

Much UI polish, testing and optimization work remains, but
this is a starting point.

Flag: we add a new flag -analysis=type,pointer, default "",
for adventurous users only at this stage.
Type analysis takes ~10s for stdlib + go.tools;
Pointer analysis (currently) takes several minutes.

Dependencies: we now include jquery.treeview.js and its GIF
images among the resources.  (bake.go now handles binary.)

LGTM=crawshaw, bgarcia
R=crawshaw, bgarcia
CC=bradfitz, golang-codereviews
https://golang.org/cl/60540044
2014-03-14 18:58:22 -04:00
Brad Garcia
a81074af88 godoc: Output "No match found" only if there is no ast or docs included in info.
Fixes golang/go#7499.

R=minux.ma
CC=golang-codereviews
https://golang.org/cl/75400043
2014-03-14 10:00:10 -04:00
David du Colombier
ec0de5a8bc go.tools/cmd/godoc: fix test on Plan 9
LGTM=bradfitz
R=minux.ma, bradfitz
CC=golang-codereviews
https://golang.org/cl/70610044
2014-03-02 19:34:05 +01:00
Brad Garcia
aaca3a4f95 godoc: Remove bogus messages referring to "/target".
Fix package text display spacing.
Fixes golang/go#7395.

R=bradfitz, sameer
CC=golang-codereviews
https://golang.org/cl/68210043
2014-02-26 13:21:44 -05:00
Brad Garcia
d682175c6e godoc: test fixes for recent cmdline changes.
Tests broken by:
https://code.google.com/p/go/source/detail?r=1666da2583f4&repo=tools

R=gri, adonovan
CC=golang-codereviews
https://golang.org/cl/58780043
2014-01-30 15:32:23 -05:00
Brad Garcia
f97ec06d2c godoc: forward /pkg/C links to /cmd/cgo.
Fixes golang/go#5651.

R=bradfitz
CC=golang-codereviews
https://golang.org/cl/58660043
2014-01-30 07:07:12 -05:00
Brad Garcia
a28efa5d8c godoc: add ability to change or disable the display of search results.
The display of search results can now be changed. A slice of functions for displaying the results can now be provided.  By default, three functions are provided to display documentation, source code, and textual results.
This makes it possible to replace them with equivalents that, say,
obtain search results from alternative source code search engines.

R=bradfitz, adg
CC=golang-codereviews
https://golang.org/cl/43470043
2014-01-06 09:51:01 -05:00
Brad Fitzpatrick
59db975409 godoc: limit concurrency to local disk filesystem
Not for Go 1.2.  Still needs a flag.

Linux at least (and likely other OSes) don't like you doing
a few hundred readdirs at once and spawing as many threads.

R=golang-dev, adg, jeremyjackins
CC=golang-dev
https://golang.org/cl/30620043
2013-12-16 11:25:50 -08:00
Brad Garcia
f3faf8b6e0 godoc: add search results that point to documentation instead of source.
Add explicit options to Corpus to control search indexing of documentation, Go source code, and full-text.

R=bradfitz, r
CC=golang-dev
https://golang.org/cl/24190043
2013-11-21 11:55:42 -05:00
Brad Garcia
b844907f9f godoc: refactor command-line mode handling.
R=bradfitz
CC=golang-dev
https://golang.org/cl/29230044
2013-11-20 09:56:10 -05:00
Brad Fitzpatrick
626e9341d5 godoc: add forgotten file from last CL to fix build
R=adg, franciscossouza, dave
CC=golang-dev
https://golang.org/cl/25650043
2013-11-12 15:46:25 -08:00
Andrew Gerrand
36c288d6d7 go.tools/cmd/godoc: search go.tools/cmd before $GOROOT/cmd
Fixes golang/go#6527.

R=rsc
CC=golang-dev
https://golang.org/cl/14725043
2013-10-18 10:42:41 +09:00
Andrew Gerrand
7b481db506 go.tools/cmd/godoc: search go.tools/cmd for command docs
Update golang/go#6527

R=r, dsymonds
CC=golang-dev
https://golang.org/cl/14526053
2013-10-11 10:36:50 +09:00
Andrew Gerrand
dcad628c68 go.tools/cmd/blog: handle "/blog/" redirect properly
The redirect.PrefixHandler redirects "/foo/" to "/foo", which is what
we want in most cases ("/cl/", "/change/", etc) but not here.
So wrap it with a handler that handles "/blog/" explictly.

R=dsymonds
CC=golang-dev
https://golang.org/cl/14326043
2013-10-03 18:10:57 +10:00
Andrew Gerrand
3a3a765782 go.tools/cmd/godoc: fix app engine version; update build script and readme
R=golang-dev, dsymonds, bradfitz
CC=golang-dev
https://golang.org/cl/12897045
2013-10-03 14:29:16 +10:00
Russ Cox
1d95d02fef go.tools/cmd/godoc: point at doc.ToHTML documentation for formatting rules
Fixes golang/go#5429.

R=golang-dev, r
CC=golang-dev
https://golang.org/cl/14292043
2013-10-02 22:08:24 -04:00
Andrew Gerrand
401293d22c go.tools/godoc: provide an explicit mux to register redirects
R=golang-dev, dsymonds
CC=golang-dev
https://golang.org/cl/14199043
2013-10-02 13:13:34 +10:00
Andrew Gerrand
d20f86cc8e go.tools/godoc: move redirect helpers to new package
Update golang/go#6512

R=golang-dev, dsymonds
CC=golang-dev
https://golang.org/cl/14193043
2013-10-01 16:32:13 +10:00
Andrew Gerrand
f54bd1aebf go.tools/cmd/godoc: update import paths
R=golang-dev, r
CC=golang-dev
https://golang.org/cl/13770043
2013-09-19 10:59:21 +10:00
Andrew Gerrand
072133c61b go.tools/cmd/godoc: include the blog server
Defer parsing of blog content until accessed for faster startup.
Fall back on redirect if blog content unavailable locally.

R=golang-dev, dsymonds
CC=golang-dev
https://golang.org/cl/13335052
2013-09-18 15:20:41 +10:00
Andrew Gerrand
dceff279d0 go.tools/cmd/godoc: add redirects for godoc, vet, and gotest
R=golang-dev, r
CC=golang-dev
https://golang.org/cl/13709046
2013-09-18 11:15:12 +10:00
Andrew Gerrand
b9b578154e go.tools/godoc: some content re-organization
Remove References section heading.
Add redirects from old paths to new content.
Add a link to the SubRepositories wiki page from package list.
Add styles for "pop-out" link.

R=r
CC=golang-dev
https://golang.org/cl/13356047
2013-09-16 15:46:38 +10:00