From 5ec91747d9f09be5b9088308b58945a585c68391 Mon Sep 17 00:00:00 2001 From: Andrew Bonventre Date: Tue, 24 Oct 2017 20:45:43 +0000 Subject: [PATCH] Revert "godoc: accessible permalinks" This reverts commit f57adc18217d779aa42266ea71a545827755a77b. Reason for revert: See https://github.com/golang/go/issues/22171#issuecomment-339125376 for reasoning. Change-Id: Ifd81ad716cf2acdf7a1d73602ac781186aca5596 Reviewed-on: https://go-review.googlesource.com/73150 Reviewed-by: Andrew Bonventre --- godoc/static/godocs.js | 4 ++-- godoc/static/package.html | 8 ++++---- godoc/static/static.go | 19 +++++++++++++------ godoc/static/style.css | 7 +++++++ 4 files changed, 26 insertions(+), 12 deletions(-) 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;