From 642caacfa32457d3ac874e0923b4d4c20bb9c63b Mon Sep 17 00:00:00 2001 From: Robert Griesemer Date: Sat, 7 Nov 2009 21:24:48 -0800 Subject: [PATCH] - added link to sources - renamed listing.html -> dirList.html (there is a dirs.html already, it should probably have a better name, too) R=rsc http://go/go-review/1025020 --- lib/godoc/{listing.html => dirList.html} | 0 lib/godoc/godoc.html | 1 + src/cmd/godoc/godoc.go | 10 +++++----- 3 files changed, 6 insertions(+), 5 deletions(-) rename lib/godoc/{listing.html => dirList.html} (100%) diff --git a/lib/godoc/listing.html b/lib/godoc/dirList.html similarity index 100% rename from lib/godoc/listing.html rename to lib/godoc/dirList.html diff --git a/lib/godoc/godoc.html b/lib/godoc/godoc.html index 35f71edee82..7686e5bf8b4 100644 --- a/lib/godoc/godoc.html +++ b/lib/godoc/godoc.html @@ -97,6 +97,7 @@
  • Command documentation
  • Package documentation
  • +
  • Sources
  •  
  • diff --git a/src/cmd/godoc/godoc.go b/src/cmd/godoc/godoc.go index 56fc5d5a11a..48abcd53c0a 100644 --- a/src/cmd/godoc/godoc.go +++ b/src/cmd/godoc/godoc.go @@ -552,9 +552,9 @@ func readTemplate(name string) *template.Template { var ( - dirsHtml, + dirListHtml, + dirsHtml, godocHtml, - listingHtml, packageHtml, packageText, parseerrorHtml, @@ -565,9 +565,9 @@ var ( func readTemplates() { // have to delay until after flags processing, // so that main has chdir'ed to goroot. + dirListHtml = readTemplate("dirList.html"); dirsHtml = readTemplate("dirs.html"); godocHtml = readTemplate("godoc.html"); - listingHtml = readTemplate("listing.html"); packageHtml = readTemplate("package.html"); packageText = readTemplate("package.txt"); parseerrorHtml = readTemplate("parseerror.html"); @@ -697,8 +697,8 @@ func serveDirectory(c *http.Conn, r *http.Request) { } var buf bytes.Buffer; - if err := listingHtml.Execute(list, &buf); err != nil { - log.Stderrf("listingHtml.Execute: %s", err); + if err := dirListHtml.Execute(list, &buf); err != nil { + log.Stderrf("dirListHtml.Execute: %s", err); } servePage(c, "Directory " + path, "", buf.Bytes());