diff options
Diffstat (limited to 'docs')
-rw-r--r-- | docs/CNAME | 1 | ||||
-rw-r--r-- | docs/cmd/starlark/index.html | 9 | ||||
-rw-r--r-- | docs/index.html | 11 | ||||
-rw-r--r-- | docs/internal/chunkedfile/index.html | 9 | ||||
-rw-r--r-- | docs/internal/compile/index.html | 9 | ||||
-rw-r--r-- | docs/repl/index.html | 9 | ||||
-rw-r--r-- | docs/resolve/index.html | 9 | ||||
-rw-r--r-- | docs/starlark/index.html | 9 | ||||
-rw-r--r-- | docs/starlarkstruct/index.html | 9 | ||||
-rw-r--r-- | docs/starlarktest/index.html | 9 | ||||
-rw-r--r-- | docs/syntax/index.html | 9 | ||||
-rw-r--r-- | docs/update.go | 71 |
12 files changed, 164 insertions, 0 deletions
diff --git a/docs/CNAME b/docs/CNAME new file mode 100644 index 0000000..63f0a06 --- /dev/null +++ b/docs/CNAME @@ -0,0 +1 @@ +go.starlark.net
\ No newline at end of file diff --git a/docs/cmd/starlark/index.html b/docs/cmd/starlark/index.html new file mode 100644 index 0000000..29d9c83 --- /dev/null +++ b/docs/cmd/starlark/index.html @@ -0,0 +1,9 @@ +<html> +<head> + <meta name="go-import" content="go.starlark.net git https://github.com/google/starlark-go"></meta> + <meta http-equiv="refresh" content="0;URL='http://godoc.org/go.starlark.net/cmd/starlark'" /></meta> +</head> +<body> + Redirecting to godoc.org page for go.starlark.net/cmd/starlark... +</body> +</html> diff --git a/docs/index.html b/docs/index.html new file mode 100644 index 0000000..ec44a6e --- /dev/null +++ b/docs/index.html @@ -0,0 +1,11 @@ +<html> + <!-- This file will be served at go.starlark.net by GitHub pages. --> + <head> + <!-- This tag causes "go get go.starklark.net" to redirect to GitHub. --> + <meta name="go-import" content="go.starlark.net git https://github.com/google/starlark-go"></meta> + <meta http-equiv="refresh" content="0;URL='http://github.com/google/starlark-go'" /> + </head> + <body> + Redirecting to GitHub project github.com/google/starlark-go... + </body> +</html> diff --git a/docs/internal/chunkedfile/index.html b/docs/internal/chunkedfile/index.html new file mode 100644 index 0000000..7710919 --- /dev/null +++ b/docs/internal/chunkedfile/index.html @@ -0,0 +1,9 @@ +<html> +<head> + <meta name="go-import" content="go.starlark.net git https://github.com/google/starlark-go"></meta> + <meta http-equiv="refresh" content="0;URL='http://godoc.org/go.starlark.net/internal/chunkedfile'" /></meta> +</head> +<body> + Redirecting to godoc.org page for go.starlark.net/internal/chunkedfile... +</body> +</html> diff --git a/docs/internal/compile/index.html b/docs/internal/compile/index.html new file mode 100644 index 0000000..12eb87f --- /dev/null +++ b/docs/internal/compile/index.html @@ -0,0 +1,9 @@ +<html> +<head> + <meta name="go-import" content="go.starlark.net git https://github.com/google/starlark-go"></meta> + <meta http-equiv="refresh" content="0;URL='http://godoc.org/go.starlark.net/internal/compile'" /></meta> +</head> +<body> + Redirecting to godoc.org page for go.starlark.net/internal/compile... +</body> +</html> diff --git a/docs/repl/index.html b/docs/repl/index.html new file mode 100644 index 0000000..bbcc4b2 --- /dev/null +++ b/docs/repl/index.html @@ -0,0 +1,9 @@ +<html> +<head> + <meta name="go-import" content="go.starlark.net git https://github.com/google/starlark-go"></meta> + <meta http-equiv="refresh" content="0;URL='http://godoc.org/go.starlark.net/repl'" /></meta> +</head> +<body> + Redirecting to godoc.org page for go.starlark.net/repl... +</body> +</html> diff --git a/docs/resolve/index.html b/docs/resolve/index.html new file mode 100644 index 0000000..6d63ca6 --- /dev/null +++ b/docs/resolve/index.html @@ -0,0 +1,9 @@ +<html> +<head> + <meta name="go-import" content="go.starlark.net git https://github.com/google/starlark-go"></meta> + <meta http-equiv="refresh" content="0;URL='http://godoc.org/go.starlark.net/resolve'" /></meta> +</head> +<body> + Redirecting to godoc.org page for go.starlark.net/resolve... +</body> +</html> diff --git a/docs/starlark/index.html b/docs/starlark/index.html new file mode 100644 index 0000000..58e38f0 --- /dev/null +++ b/docs/starlark/index.html @@ -0,0 +1,9 @@ +<html> +<head> + <meta name="go-import" content="go.starlark.net git https://github.com/google/starlark-go"></meta> + <meta http-equiv="refresh" content="0;URL='http://godoc.org/go.starlark.net/starlark'" /></meta> +</head> +<body> + Redirecting to godoc.org page for go.starlark.net/starlark... +</body> +</html> diff --git a/docs/starlarkstruct/index.html b/docs/starlarkstruct/index.html new file mode 100644 index 0000000..e187004 --- /dev/null +++ b/docs/starlarkstruct/index.html @@ -0,0 +1,9 @@ +<html> +<head> + <meta name="go-import" content="go.starlark.net git https://github.com/google/starlark-go"></meta> + <meta http-equiv="refresh" content="0;URL='http://godoc.org/go.starlark.net/starlarkstruct'" /></meta> +</head> +<body> + Redirecting to godoc.org page for go.starlark.net/starlarkstruct... +</body> +</html> diff --git a/docs/starlarktest/index.html b/docs/starlarktest/index.html new file mode 100644 index 0000000..d808e12 --- /dev/null +++ b/docs/starlarktest/index.html @@ -0,0 +1,9 @@ +<html> +<head> + <meta name="go-import" content="go.starlark.net git https://github.com/google/starlark-go"></meta> + <meta http-equiv="refresh" content="0;URL='http://godoc.org/go.starlark.net/starlarktest'" /></meta> +</head> +<body> + Redirecting to godoc.org page for go.starlark.net/starlarktest... +</body> +</html> diff --git a/docs/syntax/index.html b/docs/syntax/index.html new file mode 100644 index 0000000..a629e81 --- /dev/null +++ b/docs/syntax/index.html @@ -0,0 +1,9 @@ +<html> +<head> + <meta name="go-import" content="go.starlark.net git https://github.com/google/starlark-go"></meta> + <meta http-equiv="refresh" content="0;URL='http://godoc.org/go.starlark.net/syntax'" /></meta> +</head> +<body> + Redirecting to godoc.org page for go.starlark.net/syntax... +</body> +</html> diff --git a/docs/update.go b/docs/update.go new file mode 100644 index 0000000..be40427 --- /dev/null +++ b/docs/update.go @@ -0,0 +1,71 @@ +//+build ignore + +// The update command creates/updates the <html><head> elements of +// each subpackage beneath docs so that "go get" requests redirect +// to GitHub and other HTTP requests redirect to godoc.corp. +// +// Usage: +// +// $ cd $GOPATH/src/go.starlark.net +// $ go run docs/update.go +// +package main + +import ( + "bytes" + "fmt" + "io/ioutil" + "log" + "os" + "os/exec" + "path/filepath" + "strings" +) + +func main() { + log.SetFlags(0) + log.SetPrefix("update: ") + + cwd, err := os.Getwd() + if err != nil { + log.Fatal(err) + } + if filepath.Base(cwd) != "go.starlark.net" { + log.Fatalf("must run from the go.starlark.net directory") + } + + cmd := exec.Command("go", "list", "./...") + cmd.Stdout = new(bytes.Buffer) + cmd.Stderr = os.Stderr + if err := cmd.Run(); err != nil { + log.Fatal(err) + } + for _, pkg := range strings.Split(strings.TrimSpace(fmt.Sprint(cmd.Stdout)), "\n") { + rel := strings.TrimPrefix(pkg, "go.starlark.net/") // e.g. "cmd/starlark" + subdir := filepath.Join("docs", rel) + if err := os.MkdirAll(subdir, 0777); err != nil { + log.Fatal(err) + } + + // Create missing docs/$rel/index.html files. + html := filepath.Join(subdir, "index.html") + if _, err := os.Stat(html); os.IsNotExist(err) { + data := strings.Replace(defaultHTML, "$PKG", pkg, -1) + if err := ioutil.WriteFile(html, []byte(data), 0666); err != nil { + log.Fatal(err) + } + log.Printf("created %s", html) + } + } +} + +const defaultHTML = `<html> +<head> + <meta name="go-import" content="go.starlark.net git https://github.com/google/starlark-go"></meta> + <meta http-equiv="refresh" content="0;URL='http://godoc.org/$PKG'" /></meta> +</head> +<body> + Redirecting to godoc.org page for $PKG... +</body> +</html> +` |