From 04b08da9af0c450d645ab7389d1467308cfc2db8 Mon Sep 17 00:00:00 2001 From: Michael Stapelberg Date: Mon, 4 Mar 2013 21:27:36 +0100 Subject: Imported Upstream version 1.1~hg20130304 --- lib/godoc/codewalk.html | 2 - lib/godoc/example.html | 23 +++++++-- lib/godoc/godoc.html | 42 +++++++++++++--- lib/godoc/package.html | 125 ++++++++++++++++++++++++++++++++++-------------- lib/godoc/package.txt | 31 ++++++------ 5 files changed, 155 insertions(+), 68 deletions(-) (limited to 'lib/godoc') diff --git a/lib/godoc/codewalk.html b/lib/godoc/codewalk.html index 2835c6e82..313f1f663 100644 --- a/lib/godoc/codewalk.html +++ b/lib/godoc/codewalk.html @@ -4,8 +4,6 @@ license that can be found in the LICENSE file. --> - - diff --git a/lib/godoc/example.html b/lib/godoc/example.html index ede31d61f..cda2a8491 100644 --- a/lib/godoc/example.html +++ b/lib/godoc/example.html @@ -5,11 +5,24 @@

Example{{example_suffix .Name}}

{{with .Doc}}

{{html .}}

{{end}} -

Code:

-
{{.Code}}
- {{with .Output}} -

Output:

-
{{html .}}
+ {{$output := .Output}} + {{with .Play}} +
+
+
{{html $output}}
+
+ Run + Format + +
+
+ {{else}} +

Code:

+
{{.Code}}
+ {{with .Output}} +

Output:

+
{{html .}}
+ {{end}} {{end}}
diff --git a/lib/godoc/godoc.html b/lib/godoc/godoc.html index fd6032927..b7a772cb2 100644 --- a/lib/godoc/godoc.html +++ b/lib/godoc/godoc.html @@ -8,6 +8,11 @@ The Go Programming Language {{end}} + + +{{if .Playground}} + +{{end}} {{if .SearchBox}} @@ -15,7 +20,7 @@ -
+
+{{if .Playground}} +
+
+
+
+ Run + Format + +
+
+{{end}} +
+
{{with .Title}}
@@ -45,10 +72,8 @@ Do not delete this
. */}} -{{/* Content is HTML-escaped elsewhere */}} -{{printf "%s" .Content}} - -
+{{/* Body is HTML-escaped elsewhere */}} +{{printf "%s" .Body}} +
+
+ +{{end}} diff --git a/lib/godoc/package.txt b/lib/godoc/package.txt index 3f3c396f0..94239ca1a 100644 --- a/lib/godoc/package.txt +++ b/lib/godoc/package.txt @@ -2,14 +2,15 @@ --------------------------------------- -*/}}{{with .PDoc}}{{if $.IsPkg}}PACKAGE +*/}}{{with .PDoc}}{{if not $.IsMain}}PACKAGE package {{.Name}} import "{{.ImportPath}}" {{else}}COMMAND DOCUMENTATION -{{end}}{{comment_text .Doc " " "\t"}}{{/* +{{end}}{{comment_text .Doc " " "\t"}} +{{example_text "" $.Examples $.FSet " "}}{{/* --------------------------------------- @@ -36,6 +37,7 @@ FUNCTIONS {{range .}}{{node .Decl $.FSet}} {{comment_text .Doc " " "\t"}} +{{example_text .Name $.Examples $.FSet " "}} {{end}}{{end}}{{/* --------------------------------------- @@ -43,34 +45,29 @@ FUNCTIONS */}}{{with .Types}} TYPES -{{range .}}{{node .Decl $.FSet}} +{{range .}}{{$tname := .Name}}{{node .Decl $.FSet}} {{comment_text .Doc " " "\t"}} {{range .Consts}}{{node .Decl $.FSet}} {{comment_text .Doc " " "\t"}} {{end}}{{range .Vars}}{{node .Decl $.FSet}} {{comment_text .Doc " " "\t"}} -{{end}}{{range .Funcs}}{{node .Decl $.FSet}} +{{end}}{{example_text .Name $.Examples $.FSet " "}} +{{range .Funcs}}{{node .Decl $.FSet}} {{comment_text .Doc " " "\t"}} +{{example_text .Name $.Examples $.FSet " "}} {{end}}{{range .Methods}}{{node .Decl $.FSet}} {{comment_text .Doc " " "\t"}} +{{$name := printf "%s_%s" $tname .Name}}{{example_text $name $.Examples $.FSet " "}} {{end}}{{end}}{{end}}{{/* --------------------------------------- -*/}}{{with .Bugs}} -BUGS - -{{range .}}{{comment_text . " " "\t"}} -{{end}}{{end}}{{end}}{{/* +*/}}{{with $.Notes}} +{{range $marker, $content := .}} +{{noteTitle $marker}}s ---------------------------------------- - -*/}}{{with .PList}} -OTHER PACKAGES - -{{range .}} -{{.}}{{end}} -{{end}}{{/* +{{range $content}}{{comment_text . " " "\t"}} +{{end}}{{end}}{{end}}{{end}}{{/* --------------------------------------- -- cgit v1.2.3