cmd/golangorg: change imports to use internal/godoc
Change-Id: I48498e0c045d4c4d97ac54d3204165adc71133a6 Reviewed-on: https://go-review.googlesource.com/c/website/+/293421 Trust: Russ Cox <rsc@golang.org> Reviewed-by: Dmitri Shuralyov <dmitshur@golang.org>
This commit is contained in:
Родитель
6cf1d5f27d
Коммит
31042d3351
|
@ -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
|
||||
|
|
|
@ -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.
|
||||
|
|
|
@ -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"
|
||||
)
|
||||
|
|
|
@ -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 (
|
||||
|
|
|
@ -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"
|
||||
)
|
||||
|
||||
|
|
|
@ -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"
|
||||
)
|
||||
|
||||
|
|
|
@ -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.
|
||||
|
|
|
@ -11,7 +11,7 @@ import (
|
|||
"os"
|
||||
"strconv"
|
||||
|
||||
"golang.org/x/tools/godoc/golangorgenv"
|
||||
"golang.org/x/website/internal/godoc/golangorgenv"
|
||||
)
|
||||
|
||||
var (
|
||||
|
|
|
@ -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.
|
|
@ -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"
|
||||
|
|
|
@ -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"
|
||||
|
|
Загрузка…
Ссылка в новой задаче