From a567bbf739617291e377ca944a35ffb092c8c6b2 Mon Sep 17 00:00:00 2001 From: Ben Haines Date: Sun, 8 Oct 2017 20:15:37 -0400 Subject: [PATCH] godoc: avoid skipping heading level in package docs The heading of the #pkg-index section of package documentation pages uses an h2 heading but its 'Examples' and 'Package files' subsections use h4 headings, skipping the h3 level. This change switches the h4s to h3s and adds styling to preserve the current font-size with the new heading level. For golang/go#22171 Change-Id: Ifd2cacab22c1e82fd6f061b9322523fa5859a80f Reviewed-on: https://go-review.googlesource.com/69171 Reviewed-by: jimmy frasche Reviewed-by: Andrew Bonventre --- godoc/static/package.html | 4 ++-- godoc/static/static.go | 7 +++++-- godoc/static/style.css | 3 +++ 3 files changed, 10 insertions(+), 4 deletions(-) diff --git a/godoc/static/package.html b/godoc/static/package.html index 4244a107..6dc88e69 100644 --- a/godoc/static/package.html +++ b/godoc/static/package.html @@ -89,7 +89,7 @@ {{if $.Examples}}
-

Examples

+

Examples

{{range $.Examples}}
{{example_name .Name}}
@@ -99,7 +99,7 @@ {{end}} {{with .Filenames}} -

Package files

+

Package files

{{range .}} diff --git a/godoc/static/static.go b/godoc/static/static.go index c3488f89..b0543560 100644 --- a/godoc/static/static.go +++ b/godoc/static/static.go @@ -1742,7 +1742,7 @@ function cgAddChild(tree, ul, cgn) { {{if $.Examples}}

-

Examples

+

Examples

{{range $.Examples}}
{{example_name .Name}}
@@ -1752,7 +1752,7 @@ function cgAddChild(tree, ul, cgn) { {{end}} {{with .Filenames}} -

Package files

+

Package files

{{range .}} @@ -3051,6 +3051,9 @@ div#nav table td { } +#pkg-index h3 { + font-size: 16px; +} .pkg-dir { padding: 0 10px; } diff --git a/godoc/static/style.css b/godoc/static/style.css index 25933a3d..41e3908e 100644 --- a/godoc/static/style.css +++ b/godoc/static/style.css @@ -144,6 +144,9 @@ div#nav table td { } +#pkg-index h3 { + font-size: 16px; +} .pkg-dir { padding: 0 10px; }