forked from google/starlark-go
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
add docs/PKG/index.html redirects and import comments
- Loading branch information
Showing
19 changed files
with
163 additions
and
11 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -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> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -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> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -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> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -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> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -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> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -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> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -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> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -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> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -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> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -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> | ||
` |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters