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 <soapboxcicero@gmail.com>
Reviewed-by: Andrew Bonventre <andybons@golang.org>
This commit is contained in:
Ben Haines 2017-10-08 20:15:37 -04:00 committed by Andrew Bonventre
parent 0b88a3aa07
commit a567bbf739
3 changed files with 10 additions and 4 deletions

View File

@ -89,7 +89,7 @@
{{if $.Examples}} {{if $.Examples}}
<div id="pkg-examples"> <div id="pkg-examples">
<h4>Examples</h4> <h3>Examples</h3>
<dl> <dl>
{{range $.Examples}} {{range $.Examples}}
<dd><a class="exampleLink" href="#example_{{.Name}}">{{example_name .Name}}</a></dd> <dd><a class="exampleLink" href="#example_{{.Name}}">{{example_name .Name}}</a></dd>
@ -99,7 +99,7 @@
{{end}} {{end}}
{{with .Filenames}} {{with .Filenames}}
<h4>Package files</h4> <h3>Package files</h3>
<p> <p>
<span style="font-size:90%"> <span style="font-size:90%">
{{range .}} {{range .}}

View File

@ -1742,7 +1742,7 @@ function cgAddChild(tree, ul, cgn) {
{{if $.Examples}} {{if $.Examples}}
<div id="pkg-examples"> <div id="pkg-examples">
<h4>Examples</h4> <h3>Examples</h3>
<dl> <dl>
{{range $.Examples}} {{range $.Examples}}
<dd><a class="exampleLink" href="#example_{{.Name}}">{{example_name .Name}}</a></dd> <dd><a class="exampleLink" href="#example_{{.Name}}">{{example_name .Name}}</a></dd>
@ -1752,7 +1752,7 @@ function cgAddChild(tree, ul, cgn) {
{{end}} {{end}}
{{with .Filenames}} {{with .Filenames}}
<h4>Package files</h4> <h3>Package files</h3>
<p> <p>
<span style="font-size:90%"> <span style="font-size:90%">
{{range .}} {{range .}}
@ -3051,6 +3051,9 @@ div#nav table td {
} }
#pkg-index h3 {
font-size: 16px;
}
.pkg-dir { .pkg-dir {
padding: 0 10px; padding: 0 10px;
} }

View File

@ -144,6 +144,9 @@ div#nav table td {
} }
#pkg-index h3 {
font-size: 16px;
}
.pkg-dir { .pkg-dir {
padding: 0 10px; padding: 0 10px;
} }