diff --git a/content/static/css/stylesheet.css b/content/static/css/stylesheet.css index 526942de8..6d1e00b69 100644 --- a/content/static/css/stylesheet.css +++ b/content/static/css/stylesheet.css @@ -565,7 +565,6 @@ pre, color: var(--gray-3); } -/* common dialog styles */ .Dialog { padding: 0; position: fixed; diff --git a/content/static/css/unit_doc.css b/content/static/css/unit_doc.css index c0207c2ae..818ed8606 100644 --- a/content/static/css/unit_doc.css +++ b/content/static/css/unit_doc.css @@ -42,7 +42,6 @@ .UnitDoc .Documentation h4 { font-size: 1.375rem; } - .Documentation { color: var(--gray-1); display: block; @@ -301,8 +300,7 @@ font-style: italic; margin-left: 0.5rem; } - -.Documentation-bodyDeprecated { +.Documentation-deprecatedBody { color: var(--gray-3); font-size: 1rem; font-style: italic; @@ -310,8 +308,20 @@ margin-left: 0.5rem; margin-right: 0.5rem; } - -.Documentation-deprecatedShowLink { - font-size: 1rem; - font-weight: 400; +.Documentation-deprecatedDetails .Documentation-deprecatedBody::after { + color: var(--turq-dark); + content: 'Show'; + margin-left: 1rem; +} +.Documentation-deprecatedDetails[open] .Documentation-deprecatedBody::after { + color: var(--turq-dark); + content: 'Hide'; + margin-left: 1rem; +} +.Documentation-deprecatedDetails > summary { + list-style: none; + opacity: 1; +} +.Documentation-deprecatedDetails .Documentation-source { + opacity: 1; } diff --git a/content/static/html/doc/body.tmpl b/content/static/html/doc/body.tmpl index fa2c03b84..b2ce25f8b 100644 --- a/content/static/html/doc/body.tmpl +++ b/content/static/html/doc/body.tmpl @@ -167,10 +167,26 @@ {{define "item"}} {{$id := safe_id .FullName}} -

- {{.HeaderStart}} {{source_link .Name .Decl}} - {{- template "since_version" .FullName -}} -

{{"\n"}} - {{- template "declaration" . -}} - {{- template "example" .Examples -}} + {{if .IsDeprecated}} +
+ +

+ + {{.HeaderStart}} {{source_link .Name .Decl}} + deprecated + + {{- template "since_version" .FullName -}} +

{{"\n"}} +
+ {{- template "declaration" . -}} + {{- template "example" .Examples -}} +
+ {{else}} +

+ {{.HeaderStart}} {{source_link .Name .Decl}} + {{- template "since_version" .FullName -}} +

{{"\n"}} + {{- template "declaration" . -}} + {{- template "example" .Examples -}} + {{end}} {{end}} diff --git a/internal/godoc/dochtml/testdata/deprecated-on.golden b/internal/godoc/dochtml/testdata/deprecated-on.golden index c9f8f91c0..f0c5c3993 100644 --- a/internal/godoc/dochtml/testdata/deprecated-on.golden +++ b/internal/godoc/dochtml/testdata/deprecated-on.golden @@ -57,11 +57,17 @@ Deprecated: use GoodC.

Functions

+
+

-func BadF + +func BadF +deprecated +

+
func BadF()
@@ -70,6 +76,7 @@ Deprecated: use GoodC.

BadF is bad. Deprecated: use GoodF.

+

func GoodF @@ -82,11 +89,17 @@ Deprecated: use GoodF.

Types

+
+

-type BadT + +type BadT +deprecated +

+
type BadT int
@@ -96,6 +109,7 @@ Deprecated: use GoodF. Deprecated: use GoodT. Don't use this.

+

type GoodT @@ -106,11 +120,17 @@ Don't use this.
type GoodT int

+
+

-func NewGoodTBad + +func NewGoodTBad +deprecated +

+
func NewGoodTBad() GoodT
@@ -119,6 +139,7 @@ Don't use this.

NewGoodTBad is bad. Deprecated: use NewGoodTGood.

+

func NewGoodTGood @@ -129,11 +150,17 @@ Deprecated: use NewGoodTGood.
func NewGoodTGood() GoodT

+
+

-func (GoodT) BadM + +func (GoodT) BadM +deprecated +

+
func (GoodT) BadM()
@@ -142,6 +169,7 @@ Deprecated: use NewGoodTGood.

BadM is bad. Deprecated: use GoodM.

+

func (GoodT) GoodM