diff --git a/godoc/static/godocs.js b/godoc/static/godocs.js index 19bc9353ed..09bf0e8022 100644 --- a/godoc/static/godocs.js +++ b/godoc/static/godocs.js @@ -180,7 +180,7 @@ function setupInlinePlayground() { code.on('keyup', resize); code.keyup(); // resize now. }; - + // If example already visible, set up playground now. if ($(el).is(':visible')) { setup(); @@ -314,7 +314,7 @@ function addPermalinks() { // Already attached. return; } - parent.append(" ").append($("").attr("href", "#" + id)); + parent.append(" ").append($("").attr("href", "#" + id)); } $("#page .container").find("h2[id], h3[id]").each(function() { diff --git a/godoc/static/package.html b/godoc/static/package.html index 85c9ca3536..6dc88e6942 100644 --- a/godoc/static/package.html +++ b/godoc/static/package.html @@ -166,7 +166,7 @@ {{/* Name is a string - no need for FSet */}} {{$name_html := html .Name}}

func {{$name_html}} - +

{{node_html $ .Decl true}}
{{comment_html .Doc}} @@ -178,7 +178,7 @@ {{$tname := .Name}} {{$tname_html := html .Name}}

type {{$tname_html}} - +

{{comment_html .Doc}}
{{node_html $ .Decl true}}
@@ -200,7 +200,7 @@ {{range .Funcs}} {{$name_html := html .Name}}

func {{$name_html}} - +

{{node_html $ .Decl true}}
{{comment_html .Doc}} @@ -211,7 +211,7 @@ {{range .Methods}} {{$name_html := html .Name}}

func ({{html .Recv}}) {{$name_html}} - +

{{node_html $ .Decl true}}
{{comment_html .Doc}} diff --git a/godoc/static/static.go b/godoc/static/static.go index e3c8d7fcb6..c16cc4fd4d 100644 --- a/godoc/static/static.go +++ b/godoc/static/static.go @@ -766,7 +766,7 @@ function setupInlinePlayground() { code.on('keyup', resize); code.keyup(); // resize now. }; - + // If example already visible, set up playground now. if ($(el).is(':visible')) { setup(); @@ -900,7 +900,7 @@ function addPermalinks() { // Already attached. return; } - parent.append(" ").append($("").attr("href", "#" + id)); + parent.append(" ").append($("").attr("href", "#" + id)); } $("#page .container").find("h2[id], h3[id]").each(function() { @@ -1789,7 +1789,7 @@ function cgAddChild(tree, ul, cgn) { {{/* Name is a string - no need for FSet */}} {{$name_html := html .Name}}

func {{$name_html}} - +

{{node_html $ .Decl true}}
{{comment_html .Doc}} @@ -1801,7 +1801,7 @@ function cgAddChild(tree, ul, cgn) { {{$tname := .Name}} {{$tname_html := html .Name}}

type {{$tname_html}} - +

{{comment_html .Doc}}
{{node_html $ .Decl true}}
@@ -1823,7 +1823,7 @@ function cgAddChild(tree, ul, cgn) { {{range .Funcs}} {{$name_html := html .Name}}

func {{$name_html}} - +

{{node_html $ .Decl true}}
{{comment_html .Doc}} @@ -1834,7 +1834,7 @@ function cgAddChild(tree, ul, cgn) { {{range .Methods}} {{$name_html := html .Name}}

func ({{html .Recv}}) {{$name_html}} - +

{{node_html $ .Decl true}}
{{comment_html .Doc}} @@ -2937,6 +2937,13 @@ a:hover, text-decoration: none; } +.permalink { + display: none; +} +:hover > .permalink { + display: inline; +} + p, li { max-width: 800px; word-wrap: break-word; diff --git a/godoc/static/style.css b/godoc/static/style.css index 752d03bb54..6367b61e1c 100644 --- a/godoc/static/style.css +++ b/godoc/static/style.css @@ -60,6 +60,13 @@ a:hover, text-decoration: none; } +.permalink { + display: none; +} +:hover > .permalink { + display: inline; +} + p, li { max-width: 800px; word-wrap: break-word;