Skip to content

Commit

Permalink
godoc: avoid skipping heading level in package docs
Browse files Browse the repository at this point in the history
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>
  • Loading branch information
bhainesva authored and andybons committed Oct 9, 2017
1 parent 0b88a3a commit a567bbf
Show file tree
Hide file tree
Showing 3 changed files with 10 additions and 4 deletions.
4 changes: 2 additions & 2 deletions godoc/static/package.html
Original file line number Diff line number Diff line change
Expand Up @@ -89,7 +89,7 @@ <h2 class="toggleButton" title="Click to hide Index section">Index ▾</h2>

{{if $.Examples}}
<div id="pkg-examples">
<h4>Examples</h4>
<h3>Examples</h3>
<dl>
{{range $.Examples}}
<dd><a class="exampleLink" href="#example_{{.Name}}">{{example_name .Name}}</a></dd>
Expand All @@ -99,7 +99,7 @@ <h4>Examples</h4>
{{end}}

{{with .Filenames}}
<h4>Package files</h4>
<h3>Package files</h3>
<p>
<span style="font-size:90%">
{{range .}}
Expand Down
7 changes: 5 additions & 2 deletions godoc/static/static.go

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

3 changes: 3 additions & 0 deletions godoc/static/style.css
Original file line number Diff line number Diff line change
Expand Up @@ -144,6 +144,9 @@ div#nav table td {
}


#pkg-index h3 {
font-size: 16px;
}
.pkg-dir {
padding: 0 10px;
}
Expand Down

0 comments on commit a567bbf

Please sign in to comment.