diff --git a/cmd/golangorg/codewalk.go b/cmd/golangorg/codewalk.go index 0f3c13e9..a7fdafab 100644 --- a/cmd/golangorg/codewalk.go +++ b/cmd/golangorg/codewalk.go @@ -32,8 +32,8 @@ import ( "text/template" "unicode/utf8" - "golang.org/x/tools/godoc" - "golang.org/x/tools/godoc/vfs" + "golang.org/x/website/internal/godoc" + "golang.org/x/website/internal/godoc/vfs" ) var codewalkHTML, codewalkdirHTML *template.Template diff --git a/cmd/golangorg/godoc.go b/cmd/golangorg/godoc.go index 54b71a37..39049cfa 100644 --- a/cmd/golangorg/godoc.go +++ b/cmd/golangorg/godoc.go @@ -13,8 +13,8 @@ import ( "net/http" "strings" - "golang.org/x/tools/godoc" "golang.org/x/website/internal/env" + "golang.org/x/website/internal/godoc" ) // This file holds common code from the x/tools/godoc serving engine. diff --git a/cmd/golangorg/handlers.go b/cmd/golangorg/handlers.go index 5412c2f2..faccde73 100644 --- a/cmd/golangorg/handlers.go +++ b/cmd/golangorg/handlers.go @@ -15,9 +15,9 @@ import ( "strings" "text/template" - "golang.org/x/tools/godoc" - "golang.org/x/tools/godoc/vfs" "golang.org/x/website/internal/env" + "golang.org/x/website/internal/godoc" + "golang.org/x/website/internal/godoc/vfs" "golang.org/x/website/internal/history" "golang.org/x/website/internal/redirect" ) diff --git a/cmd/golangorg/main.go b/cmd/golangorg/main.go index abd6f0a8..63844729 100644 --- a/cmd/golangorg/main.go +++ b/cmd/golangorg/main.go @@ -29,10 +29,10 @@ import ( "regexp" "runtime" - "golang.org/x/tools/godoc" - "golang.org/x/tools/godoc/vfs" - "golang.org/x/tools/godoc/vfs/gatefs" "golang.org/x/website" + "golang.org/x/website/internal/godoc" + "golang.org/x/website/internal/godoc/vfs" + "golang.org/x/website/internal/godoc/vfs/gatefs" ) var ( diff --git a/cmd/golangorg/project.go b/cmd/golangorg/project.go index f8a05bfa..06f605ef 100644 --- a/cmd/golangorg/project.go +++ b/cmd/golangorg/project.go @@ -15,8 +15,8 @@ import ( "net/http" "sort" - "golang.org/x/tools/godoc" - "golang.org/x/tools/godoc/vfs" + "golang.org/x/website/internal/godoc" + "golang.org/x/website/internal/godoc/vfs" "golang.org/x/website/internal/history" ) diff --git a/cmd/golangorg/release.go b/cmd/golangorg/release.go index 0c5d9d19..198b7865 100644 --- a/cmd/golangorg/release.go +++ b/cmd/golangorg/release.go @@ -17,8 +17,8 @@ import ( "sort" "strings" - "golang.org/x/tools/godoc" - "golang.org/x/tools/godoc/vfs" + "golang.org/x/website/internal/godoc" + "golang.org/x/website/internal/godoc/vfs" "golang.org/x/website/internal/history" ) diff --git a/cmd/golangorg/release_test.go b/cmd/golangorg/release_test.go index 1014f7f2..80e543de 100644 --- a/cmd/golangorg/release_test.go +++ b/cmd/golangorg/release_test.go @@ -13,9 +13,9 @@ import ( "strings" "testing" - "golang.org/x/tools/godoc" - "golang.org/x/tools/godoc/vfs" "golang.org/x/website" + "golang.org/x/website/internal/godoc" + "golang.org/x/website/internal/godoc/vfs" ) // Test that the release history page includes expected entries. diff --git a/internal/env/env.go b/internal/env/env.go index 8fcf5a91..c0786265 100644 --- a/internal/env/env.go +++ b/internal/env/env.go @@ -11,7 +11,7 @@ import ( "os" "strconv" - "golang.org/x/tools/godoc/golangorgenv" + "golang.org/x/website/internal/godoc/golangorgenv" ) var ( diff --git a/internal/godoc/README.md b/internal/godoc/README.md deleted file mode 100644 index 52bc8a4e..00000000 --- a/internal/godoc/README.md +++ /dev/null @@ -1,31 +0,0 @@ -# godoc - -This directory contains most of the code for running a godoc server. The -executable lives at golang.org/x/tools/cmd/godoc. - -## Development mode - -In production, CSS/JS/template assets need to be compiled into the godoc -binary. It can be tedious to recompile assets every time, but you can pass a -flag to load CSS/JS/templates from disk every time a page loads: - -``` -godoc -templates=$GOPATH/src/golang.org/x/tools/godoc/static -http=:6060 -``` - -## Recompiling static assets - -The files that live at `static/style.css`, `static/jquery.js` and so on are not -present in the final binary. They are placed into `static/static.go` by running -`go generate`. So to compile a change and test it in your browser: - -1) Make changes to e.g. `static/style.css`. - -2) Run `go generate golang.org/x/tools/godoc/static` so `static/static.go` picks -up the change. - -3) Run `go install golang.org/x/tools/cmd/godoc` so the compiled `godoc` binary -picks up the change. - -4) Run `godoc -http=:6060` and view your changes in the browser. You may need -to disable your browser's cache to avoid reloading a stale file. diff --git a/internal/godoc/vfs/httpfs/httpfs.go b/internal/godoc/vfs/httpfs/httpfs.go index bb62bc55..292366a4 100644 --- a/internal/godoc/vfs/httpfs/httpfs.go +++ b/internal/godoc/vfs/httpfs/httpfs.go @@ -3,7 +3,7 @@ // license that can be found in the LICENSE file. // Package httpfs implements http.FileSystem using a godoc vfs.FileSystem. -package httpfs // import "golang.org/x/tools/godoc/vfs/httpfs" +package httpfs // import "golang.org/x/website/internal/godoc/vfs/httpfs" import ( "fmt" diff --git a/internal/godoc/vfs/mapfs/mapfs.go b/internal/godoc/vfs/mapfs/mapfs.go index e2b637d7..aba9787f 100644 --- a/internal/godoc/vfs/mapfs/mapfs.go +++ b/internal/godoc/vfs/mapfs/mapfs.go @@ -4,7 +4,7 @@ // Package mapfs file provides an implementation of the FileSystem // interface based on the contents of a map[string]string. -package mapfs // import "golang.org/x/tools/godoc/vfs/mapfs" +package mapfs // import "golang.org/x/website/internal/godoc/vfs/mapfs" import ( "fmt"