summaryrefslogtreecommitdiff
path: root/src/cmd/godoc/appinit.go
diff options
context:
space:
mode:
authorMichael Stapelberg <stapelberg@debian.org>2013-03-04 21:27:36 +0100
committerMichael Stapelberg <michael@stapelberg.de>2013-03-04 21:27:36 +0100
commit04b08da9af0c450d645ab7389d1467308cfc2db8 (patch)
treedb247935fa4f2f94408edc3acd5d0d4f997aa0d8 /src/cmd/godoc/appinit.go
parent917c5fb8ec48e22459d77e3849e6d388f93d3260 (diff)
downloadgolang-04b08da9af0c450d645ab7389d1467308cfc2db8.tar.gz
Imported Upstream version 1.1~hg20130304upstream/1.1_hg20130304
Diffstat (limited to 'src/cmd/godoc/appinit.go')
-rw-r--r--src/cmd/godoc/appinit.go9
1 files changed, 7 insertions, 2 deletions
diff --git a/src/cmd/godoc/appinit.go b/src/cmd/godoc/appinit.go
index 70da00110..996b2b850 100644
--- a/src/cmd/godoc/appinit.go
+++ b/src/cmd/godoc/appinit.go
@@ -17,9 +17,12 @@ import (
)
func serveError(w http.ResponseWriter, r *http.Request, relpath string, err error) {
- contents := applyTemplate(errorHTML, "errorHTML", err) // err may contain an absolute path!
w.WriteHeader(http.StatusNotFound)
- servePage(w, relpath, "File "+relpath, "", "", contents)
+ servePage(w, Page{
+ Title: "File " + relpath,
+ Subtitle: relpath,
+ Body: applyTemplate(errorHTML, "errorHTML", err), // err may contain an absolute path!
+ })
}
func init() {
@@ -34,6 +37,7 @@ func init() {
*indexFiles = indexFilenames
*maxResults = 100 // reduce latency by limiting the number of fulltext search results
*indexThrottle = 0.3 // in case *indexFiles is empty (and thus the indexer is run)
+ *showPlayground = true
// read .zip file and set up file systems
const zipfile = zipFilename
@@ -48,6 +52,7 @@ func init() {
readTemplates()
initHandlers()
registerPublicHandlers(http.DefaultServeMux)
+ registerPlaygroundHandlers(http.DefaultServeMux)
// initialize default directory tree with corresponding timestamp.
initFSTree()