content/static/html/doc: change tabs to spaces
Tabs in templates are replace with two spaces.
Change-Id: If3bf45e5fcd5d71fde263cd31f36da9651951c8c
Reviewed-on: https://go-review.googlesource.com/c/pkgsite/+/277493
Trust: Julie Qiu <julie@golang.org>
Run-TryBot: Julie Qiu <julie@golang.org>
TryBot-Result: kokoro <noreply+kokoro@google.com>
Reviewed-by: Jonathan Amsterdam <jba@google.com>
diff --git a/content/static/html/doc/body.tmpl b/content/static/html/doc/body.tmpl
index 67484e6..02f3ae6 100644
--- a/content/static/html/doc/body.tmpl
+++ b/content/static/html/doc/body.tmpl
@@ -5,92 +5,91 @@
-->
<div class="Documentation-content js-docContent"> {{/* Documentation content container */}}
{{- if or .Doc (index .Examples.Map "") -}}
- <section class="Documentation-overview">
- <h3 tabindex="-1" id="pkg-overview" class="Documentation-overviewHeader">Overview <a href="#pkg-overview">¶</a></h3>{{"\n\n" -}}
- {{render_doc_extract_links .Doc}}{{"\n" -}}
- {{- template "example" (index .Examples.Map "") -}}
- </section>
+ <section class="Documentation-overview">
+ <h3 tabindex="-1" id="pkg-overview" class="Documentation-overviewHeader">Overview <a href="#pkg-overview">¶</a></h3>{{"\n\n" -}}
+ {{render_doc_extract_links .Doc}}{{"\n" -}}
+ {{- template "example" (index .Examples.Map "") -}}
+ </section>
{{- end -}}
-
{{- if or .Consts .Vars .Funcs .Types -}}
- <section class="Documentation-index">
- <h3 id="pkg-index" class="Documentation-indexHeader">Index <a href="#pkg-index">¶</a></h3>{{"\n\n" -}}
- <ul class="Documentation-indexList">{{"\n" -}}
- {{- if .Consts -}}<li class="Documentation-indexConstants"><a href="#pkg-constants">Constants</a></li>{{"\n"}}{{- end -}}
- {{- if .Vars -}}<li class="Documentation-indexVariables"><a href="#pkg-variables">Variables</a></li>{{"\n"}}{{- end -}}
+ <section class="Documentation-index">
+ <h3 id="pkg-index" class="Documentation-indexHeader">Index <a href="#pkg-index">¶</a></h3>{{"\n\n" -}}
+ <ul class="Documentation-indexList">{{"\n" -}}
+ {{- if .Consts -}}<li class="Documentation-indexConstants"><a href="#pkg-constants">Constants</a></li>{{"\n"}}{{- end -}}
+ {{- if .Vars -}}<li class="Documentation-indexVariables"><a href="#pkg-variables">Variables</a></li>{{"\n"}}{{- end -}}
- {{- range .Funcs -}}
- <li class="Documentation-indexFunction">
- <a href="#{{.Name}}">{{render_synopsis .Decl}}</a>
- </li>{{"\n"}}
- {{- end -}}
+ {{- range .Funcs -}}
+ <li class="Documentation-indexFunction">
+ <a href="#{{.Name}}">{{render_synopsis .Decl}}</a>
+ </li>{{"\n"}}
+ {{- end -}}
- {{- range .Types -}}
- {{- $tname := .Name -}}
- <li class="Documentation-indexType"><a href="#{{$tname}}">type {{$tname}}</a></li>{{"\n"}}
- {{- with .Funcs -}}
- <li><ul class="Documentation-indexTypeFunctions">{{"\n" -}}
- {{range .}}<li><a href="#{{.Name}}">{{render_synopsis .Decl}}</a></li>{{"\n"}}{{end}}
- </ul></li>{{"\n" -}}
- {{- end -}}
- {{- with .Methods -}}
- <li><ul class="Documentation-indexTypeMethods">{{"\n" -}}
- {{range .}}<li><a href="#{{$tname}}.{{.Name}}">{{render_synopsis .Decl}}</a></li>{{"\n"}}{{end}}
- </ul></li>{{"\n" -}}
- {{- end -}}
- {{- end -}}
+ {{- range .Types -}}
+ {{- $tname := .Name -}}
+ <li class="Documentation-indexType"><a href="#{{$tname}}">type {{$tname}}</a></li>{{"\n"}}
+ {{- with .Funcs -}}
+ <li><ul class="Documentation-indexTypeFunctions">{{"\n" -}}
+ {{range .}}<li><a href="#{{.Name}}">{{render_synopsis .Decl}}</a></li>{{"\n"}}{{end}}
+ </ul></li>{{"\n" -}}
+ {{- end -}}
+ {{- with .Methods -}}
+ <li><ul class="Documentation-indexTypeMethods">{{"\n" -}}
+ {{range .}}<li><a href="#{{$tname}}.{{.Name}}">{{render_synopsis .Decl}}</a></li>{{"\n"}}{{end}}
+ </ul></li>{{"\n" -}}
+ {{- end -}}
+ {{- end -}}
- {{- range $marker, $item := .Notes -}}
- <li class="Documentation-indexNote"><a href="#pkg-note-{{$marker}}">{{(index $.NoteHeaders $marker).Label}}s</a></li>
- {{- end -}}
- </ul>{{"\n" -}}
- </section>
+ {{- range $marker, $item := .Notes -}}
+ <li class="Documentation-indexNote"><a href="#pkg-note-{{$marker}}">{{(index $.NoteHeaders $marker).Label}}s</a></li>
+ {{- end -}}
+ </ul>{{"\n" -}}
+ </section>
- {{- if .Examples.List -}}
- <section class="Documentation-examples">
- <h4 tabindex="-1" id="pkg-examples" class="Documentation-examplesHeader">Examples <a class="Documentation-idLink" href="#pkg-examples">¶</a></h4>{{"\n" -}}
- <ul class="Documentation-examplesList">{{"\n" -}}
- {{- range .Examples.List -}}
- <li><a href="#{{.ID}}" class="js-exampleHref">{{or .ParentID "Package"}}{{with .Suffix}} ({{.}}){{end}}</a></li>{{"\n" -}}
- {{- end -}}
- </ul>{{"\n" -}}
- </section>
- {{- end -}}
+ {{- if .Examples.List -}}
+ <section class="Documentation-examples">
+ <h4 tabindex="-1" id="pkg-examples" class="Documentation-examplesHeader">Examples <a class="Documentation-idLink" href="#pkg-examples">¶</a></h4>{{"\n" -}}
+ <ul class="Documentation-examplesList">{{"\n" -}}
+ {{- range .Examples.List -}}
+ <li><a href="#{{.ID}}" class="js-exampleHref">{{or .ParentID "Package"}}{{with .Suffix}} ({{.}}){{end}}</a></li>{{"\n" -}}
+ {{- end -}}
+ </ul>{{"\n" -}}
+ </section>
+ {{- end -}}
- <h3 tabindex="-1" id="pkg-constants" class="Documentation-constantsHeader">Constants <a href="#pkg-constants">¶</a></h3>{{"\n"}}
- <section class="Documentation-constants">
- {{- if .Consts -}}
- {{- range .Consts -}}
- {{- $out := render_decl .Doc .Decl -}}
- {{- $out.Decl -}}
- {{- $out.Doc -}}
- <br/>
- {{"\n"}}
- {{- end -}}
- {{- else -}}
- <div class="Documentation-empty">This section is empty.</div>
- {{- end -}}
- </section>
+ <h3 tabindex="-1" id="pkg-constants" class="Documentation-constantsHeader">Constants <a href="#pkg-constants">¶</a></h3>{{"\n"}}
+ <section class="Documentation-constants">
+ {{- if .Consts -}}
+ {{- range .Consts -}}
+ {{- $out := render_decl .Doc .Decl -}}
+ {{- $out.Decl -}}
+ {{- $out.Doc -}}
+ <br/>
+ {{"\n"}}
+ {{- end -}}
+ {{- else -}}
+ <div class="Documentation-empty">This section is empty.</div>
+ {{- end -}}
+ </section>
- <h3 tabindex="-1" id="pkg-variables" class="Documentation-variablesHeader">Variables <a href="#pkg-variables">¶</a></h3>{{"\n"}}
- <section class="Documentation-variables">
- {{- if .Vars -}}
- {{- range .Vars -}}
- {{- $out := render_decl .Doc .Decl -}}
- {{- $out.Decl -}}
- {{- $out.Doc -}}
- <br/>
- {{"\n"}}
- {{- end -}}
- {{- else -}}
- <div class="Documentation-empty">This section is empty.</div>
- {{- end -}}
- </section>
+ <h3 tabindex="-1" id="pkg-variables" class="Documentation-variablesHeader">Variables <a href="#pkg-variables">¶</a></h3>{{"\n"}}
+ <section class="Documentation-variables">
+ {{- if .Vars -}}
+ {{- range .Vars -}}
+ {{- $out := render_decl .Doc .Decl -}}
+ {{- $out.Decl -}}
+ {{- $out.Doc -}}
+ <br/>
+ {{"\n"}}
+ {{- end -}}
+ {{- else -}}
+ <div class="Documentation-empty">This section is empty.</div>
+ {{- end -}}
+ </section>
- <h3 tabindex="-1" id="pkg-functions" class="Documentation-functionsHeader">Functions <a href="#pkg-functions">¶</a></h3>{{"\n"}}
- <section class="Documentation-functions">
- {{- if .Funcs -}}
+ <h3 tabindex="-1" id="pkg-functions" class="Documentation-functionsHeader">Functions <a href="#pkg-functions">¶</a></h3>{{"\n"}}
+ <section class="Documentation-functions">
+ {{- if .Funcs -}}
{{- range .Funcs -}}
<div class="Documentation-function">
{{- $id := safe_id .Name -}}
@@ -102,88 +101,88 @@
{{- template "example" (index $.Examples.Map .Name) -}}
</div>
{{- end -}}
- {{- else -}}
- <div class="Documentation-empty">This section is empty.</div>
- {{- end -}}
- </section>
+ {{- else -}}
+ <div class="Documentation-empty">This section is empty.</div>
+ {{- end -}}
+ </section>
- <h3 tabindex="-1" id="pkg-types" class="Documentation-typesHeader">Types <a href="#pkg-types">¶</a></h3>{{"\n"}}
- <section class="Documentation-types">
- {{- if .Types -}}
- {{- range .Types -}}
- <div class="Documentation-type">
- {{- $tname := .Name -}}
- {{- $id := safe_id .Name -}}
- <h4 tabindex="-1" id="{{$id}}" data-kind="type" class="Documentation-typeHeader">type {{source_link .Name .Decl}} <a class="Documentation-idLink" href="#{{$id}}">¶</a></h4>{{"\n"}}
- {{- $out := render_decl .Doc .Decl -}}
- {{- $out.Decl -}}
- {{- $out.Doc -}}
- {{"\n"}}
- {{- template "example" (index $.Examples.Map .Name) -}}
+ <h3 tabindex="-1" id="pkg-types" class="Documentation-typesHeader">Types <a href="#pkg-types">¶</a></h3>{{"\n"}}
+ <section class="Documentation-types">
+ {{- if .Types -}}
+ {{- range .Types -}}
+ <div class="Documentation-type">
+ {{- $tname := .Name -}}
+ {{- $id := safe_id .Name -}}
+ <h4 tabindex="-1" id="{{$id}}" data-kind="type" class="Documentation-typeHeader">type {{source_link .Name .Decl}} <a class="Documentation-idLink" href="#{{$id}}">¶</a></h4>{{"\n"}}
+ {{- $out := render_decl .Doc .Decl -}}
+ {{- $out.Decl -}}
+ {{- $out.Doc -}}
+ {{"\n"}}
+ {{- template "example" (index $.Examples.Map .Name) -}}
- {{- range .Consts -}}
- <div class="Documentation-typeConstant">
- {{- $out := render_decl .Doc .Decl -}}
- {{- $out.Decl -}}
- {{- $out.Doc -}}
- {{"\n"}}
- </div>
- {{- end -}}
+ {{- range .Consts -}}
+ <div class="Documentation-typeConstant">
+ {{- $out := render_decl .Doc .Decl -}}
+ {{- $out.Decl -}}
+ {{- $out.Doc -}}
+ {{"\n"}}
+ </div>
+ {{- end -}}
- {{- range .Vars -}}
- <div class="Documentation-typeVariable">
- {{- $out := render_decl .Doc .Decl -}}
- {{- $out.Decl -}}
- {{- $out.Doc -}}
- {{"\n"}}
- </div>
- {{- end -}}
+ {{- range .Vars -}}
+ <div class="Documentation-typeVariable">
+ {{- $out := render_decl .Doc .Decl -}}
+ {{- $out.Decl -}}
+ {{- $out.Doc -}}
+ {{"\n"}}
+ </div>
+ {{- end -}}
- {{- range .Funcs -}}
- <div class="Documentation-typeFunc">
- {{- $id := safe_id .Name -}}
- <h4 tabindex="-1" id="{{$id}}" data-kind="function" class="Documentation-typeFuncHeader">func {{source_link .Name .Decl}} <a class="Documentation-idLink" href="#{{$id}}">¶</a></h4>{{"\n"}}
- {{- $out := render_decl .Doc .Decl -}}
- {{- $out.Decl -}}
- {{- $out.Doc -}}
- {{"\n"}}
- {{- template "example" (index $.Examples.Map .Name) -}}
- </div>
- {{- end -}}
+ {{- range .Funcs -}}
+ <div class="Documentation-typeFunc">
+ {{- $id := safe_id .Name -}}
+ <h4 tabindex="-1" id="{{$id}}" data-kind="function" class="Documentation-typeFuncHeader">func {{source_link .Name .Decl}} <a class="Documentation-idLink" href="#{{$id}}">¶</a></h4>{{"\n"}}
+ {{- $out := render_decl .Doc .Decl -}}
+ {{- $out.Decl -}}
+ {{- $out.Doc -}}
+ {{"\n"}}
+ {{- template "example" (index $.Examples.Map .Name) -}}
+ </div>
+ {{- end -}}
- {{- range .Methods -}}
- <div class="Documentation-typeMethod">
- {{- $name := (printf "%s.%s" $tname .Name) -}}
- {{- $id := (safe_id $name) -}}
- <h4 tabindex="-1" id="{{$id}}" data-kind="method" class="Documentation-typeMethodHeader">func ({{.Recv}}) {{source_link .Name .Decl}} <a class="Documentation-idLink" href="#{{$id}}">¶</a></h4>{{"\n"}}
- {{- $out := render_decl .Doc .Decl -}}
- {{- $out.Decl -}}
- {{- $out.Doc -}}
- {{"\n"}}
- {{- template "example" (index $.Examples.Map $name) -}}
- </div>
- {{- end -}}
- </div>
- {{- end -}}
- {{- else -}}
- <div class="Documentation-empty">This section is empty.</div>
- {{- end -}}
- </section>
+ {{- range .Methods -}}
+ <div class="Documentation-typeMethod">
+ {{- $name := (printf "%s.%s" $tname .Name) -}}
+ {{- $id := (safe_id $name) -}}
+ <h4 tabindex="-1" id="{{$id}}" data-kind="method" class="Documentation-typeMethodHeader">func ({{.Recv}}) {{source_link .Name .Decl}} <a class="Documentation-idLink" href="#{{$id}}">¶</a></h4>{{"\n"}}
+ {{- $out := render_decl .Doc .Decl -}}
+ {{- $out.Decl -}}
+ {{- $out.Doc -}}
+ {{"\n"}}
+ {{- template "example" (index $.Examples.Map $name) -}}
+ </div>
+ {{- end -}}
+ </div>
+ {{- end -}}
+ {{- else -}}
+ <div class="Documentation-empty">This section is empty.</div>
+ {{- end -}}
+ </section>
{{- end -}}
{{- if .Notes -}}
- <h3 tabindex="-1" id="pkg-notes" class="Documentation-notesHeader">Notes <a href="#pkg-notes">¶</a></h3>{{"\n"}}
- <section class="Documentation-notes">
- {{- range $marker, $content := .Notes -}}
- <div class="Documentation-note">
- <h3 tabindex="-1" id="{{(index $.NoteHeaders $marker).SafeIdentifier}}" class="Documentation-noteHeader">{{(index $.NoteHeaders $marker).Label}}s <a href="#pkg-note-{{$marker}}">¶</a></h3>
- <ul class="Documentation-noteList" style="padding-left: 20px; list-style: initial;">{{"\n" -}}
- {{- range $v := $content -}}
- <li style="margin: 6px 0 6px 0;">{{render_doc $v.Body}}</li>
- {{- end -}}
- </ul>{{"\n" -}}
- </div>
- {{- end -}}
- </section>
+ <h3 tabindex="-1" id="pkg-notes" class="Documentation-notesHeader">Notes <a href="#pkg-notes">¶</a></h3>{{"\n"}}
+ <section class="Documentation-notes">
+ {{- range $marker, $content := .Notes -}}
+ <div class="Documentation-note">
+ <h3 tabindex="-1" id="{{(index $.NoteHeaders $marker).SafeIdentifier}}" class="Documentation-noteHeader">{{(index $.NoteHeaders $marker).Label}}s <a href="#pkg-note-{{$marker}}">¶</a></h3>
+ <ul class="Documentation-noteList" style="padding-left: 20px; list-style: initial;">{{"\n" -}}
+ {{- range $v := $content -}}
+ <li style="margin: 6px 0 6px 0;">{{render_doc $v.Body}}</li>
+ {{- end -}}
+ </ul>{{"\n" -}}
+ </div>
+ {{- end -}}
+ </section>
{{- end -}}
</div> {{/* End documentation content container */}}
diff --git a/content/static/html/doc/example.tmpl b/content/static/html/doc/example.tmpl
index 47fa665..2ea12de 100644
--- a/content/static/html/doc/example.tmpl
+++ b/content/static/html/doc/example.tmpl
@@ -5,28 +5,27 @@
-->
{{- define "example" -}}
- {{- range . -}}
- <details tabindex="-1" id="{{.ID}}" class="Documentation-exampleDetails js-exampleContainer">{{"\n" -}}
- <summary class="Documentation-exampleDetailsHeader">Example{{with .Suffix}} ({{.}}){{end}} <a href="#{{.ID}}">¶</a></summary>{{"\n" -}}
- <div class="Documentation-exampleDetailsBody">{{"\n" -}}
- {{- if .Doc -}}{{render_doc .Doc}}{{"\n" -}}{{- end -}}
- {{- with play_url .Example -}}
- <p><a class="Documentation-examplesPlay" href="{{.}}">Open in Go playground »</a></p>{{"\n" -}}
- {{- end -}}
- <p>Code:</p>{{"\n" -}}
- {{render_code .Example}}{{"\n" -}}
- {{- if (or .Output .EmptyOutput) -}}
- <pre class="Documentation-exampleOutput">{{"\n"}}{{.Output}}</pre>{{"\n" -}}
- {{- end -}}
- </div>{{"\n" -}}
- {{- if .Play -}}
- <div class="Documentation-exampleButtonsContainer">
- <p class="Documentation-exampleError" role="alert" aria-atomic="true"></p>
- <button class="Documentation-examplePlayButton" aria-label="Play Code">Play</button>
- </div>
- {{- end -}}
- </details>{{"\n" -}}
- {{"\n"}}
- {{- end -}}
+ {{- range . -}}
+ <details tabindex="-1" id="{{.ID}}" class="Documentation-exampleDetails js-exampleContainer">{{"\n" -}}
+ <summary class="Documentation-exampleDetailsHeader">Example{{with .Suffix}} ({{.}}){{end}} <a href="#{{.ID}}">¶</a></summary>{{"\n" -}}
+ <div class="Documentation-exampleDetailsBody">{{"\n" -}}
+ {{- if .Doc -}}{{render_doc .Doc}}{{"\n" -}}{{- end -}}
+ {{- with play_url .Example -}}
+ <p><a class="Documentation-examplesPlay" href="{{.}}">Open in Go playground »</a></p>{{"\n" -}}
+ {{- end -}}
+ <p>Code:</p>{{"\n" -}}
+ {{render_code .Example}}{{"\n" -}}
+ {{- if (or .Output .EmptyOutput) -}}
+ <pre class="Documentation-exampleOutput">{{"\n"}}{{.Output}}</pre>{{"\n" -}}
+ {{- end -}}
+ </div>{{"\n" -}}
+ {{- if .Play -}}
+ <div class="Documentation-exampleButtonsContainer">
+ <p class="Documentation-exampleError" role="alert" aria-atomic="true"></p>
+ <button class="Documentation-examplePlayButton" aria-label="Play Code">Play</button>
+ </div>
+ {{- end -}}
+ </details>{{"\n" -}}
+ {{"\n"}}
+ {{- end -}}
{{- end -}}
-
diff --git a/content/static/html/doc/sidenav-mobile.tmpl b/content/static/html/doc/sidenav-mobile.tmpl
index fab9d08..ac92e9d 100644
--- a/content/static/html/doc/sidenav-mobile.tmpl
+++ b/content/static/html/doc/sidenav-mobile.tmpl
@@ -4,61 +4,61 @@
license that can be found in the LICENSE file.
-->
<nav class="DocNavMobile js-mobileNav">
- <label for="DocNavMobile-select" class="DocNavMobile-label">
- <svg class="DocNavMobile-selectIcon" xmlns="http://www.w3.org/2000/svg" viewBox="0 0 24 24" fill="black" width="18px" height="18px">
- <path d="M0 0h24v24H0z" fill="none"/><path d="M3 9h14V7H3v2zm0 4h14v-2H3v2zm0 4h14v-2H3v2zm16 0h2v-2h-2v2zm0-10v2h2V7h-2zm0 6h2v-2h-2v2z"/>
- </svg>
- <span class="DocNavMobile-selectText js-mobileNavSelectText">Outline</span>
- </label>
- <select id="DocNavMobile-select" class="DocNavMobile-select">
- <option value="">Outline</option>
- <option class="js-readmeOption" value="section-readme">README</option>
- <optgroup label="Documentation">
- {{if or .Doc (index .Examples.Map "")}}
- <option value="pkg-overview">Overview</option>
- {{end}}
- {{if or .Consts .Vars .Funcs .Types}}
- <option value="pkg-index">Index</option>
- {{end}}
- {{if .Examples.List}}
- <option value="pkg-examples">Examples</option>
- {{end}}
- {{if .Consts}}
- <option value="pkg-constants">Constants</option>
- {{end}}
- {{if .Vars}}
- <option value="pkg-variables">Variables</option>
- {{end}}
- </optgroup>
- {{if .Funcs}}
- <optgroup label="Functions">
- {{range .Funcs}}
- <option value="{{.Name}}">{{render_short_synopsis .Decl}}</option>
- {{end}}
- </optgroup>
- {{end}}
- {{if .Types}}
- <optgroup label="Types">
- {{range .Types}}
- {{$tname := .Name}}
- <option value="{{$tname}}">type {{$tname}}</option>
- {{range .Funcs}}
- <option value="{{.Name}}">{{render_short_synopsis .Decl}}</option>
- {{end}}
- {{range .Methods}}
- <option value="{{$tname}}.{{.Name}}">{{render_short_synopsis .Decl}}</option>
- {{end}}
- {{end}} {{/* range .Types */}}
- </optgroup>
- {{end}}
- {{if .Notes}}
- <optgroup label="Notes">
- {{range $marker, $item := .Notes}}
- <option value="pkg-note-{{$marker}}">{{(index $.NoteHeaders $marker).Label}}s</option>
- {{end}}
- </optgroup>
- {{end}}
- <option class="js-sourcefilesOption" value="section-sourcefiles">Source Files</option>
- <option class="js-directoriesOption" value="section-directories">Directories</option>
- </select>
+ <label for="DocNavMobile-select" class="DocNavMobile-label">
+ <svg class="DocNavMobile-selectIcon" xmlns="http://www.w3.org/2000/svg" viewBox="0 0 24 24" fill="black" width="18px" height="18px">
+ <path d="M0 0h24v24H0z" fill="none"/><path d="M3 9h14V7H3v2zm0 4h14v-2H3v2zm0 4h14v-2H3v2zm16 0h2v-2h-2v2zm0-10v2h2V7h-2zm0 6h2v-2h-2v2z"/>
+ </svg>
+ <span class="DocNavMobile-selectText js-mobileNavSelectText">Outline</span>
+ </label>
+ <select id="DocNavMobile-select" class="DocNavMobile-select">
+ <option value="">Outline</option>
+ <option class="js-readmeOption" value="section-readme">README</option>
+ <optgroup label="Documentation">
+ {{if or .Doc (index .Examples.Map "")}}
+ <option value="pkg-overview">Overview</option>
+ {{end}}
+ {{if or .Consts .Vars .Funcs .Types}}
+ <option value="pkg-index">Index</option>
+ {{end}}
+ {{if .Examples.List}}
+ <option value="pkg-examples">Examples</option>
+ {{end}}
+ {{if .Consts}}
+ <option value="pkg-constants">Constants</option>
+ {{end}}
+ {{if .Vars}}
+ <option value="pkg-variables">Variables</option>
+ {{end}}
+ </optgroup>
+ {{if .Funcs}}
+ <optgroup label="Functions">
+ {{range .Funcs}}
+ <option value="{{.Name}}">{{render_short_synopsis .Decl}}</option>
+ {{end}}
+ </optgroup>
+ {{end}}
+ {{if .Types}}
+ <optgroup label="Types">
+ {{range .Types}}
+ {{$tname := .Name}}
+ <option value="{{$tname}}">type {{$tname}}</option>
+ {{range .Funcs}}
+ <option value="{{.Name}}">{{render_short_synopsis .Decl}}</option>
+ {{end}}
+ {{range .Methods}}
+ <option value="{{$tname}}.{{.Name}}">{{render_short_synopsis .Decl}}</option>
+ {{end}}
+ {{end}} {{/* range .Types */}}
+ </optgroup>
+ {{end}}
+ {{if .Notes}}
+ <optgroup label="Notes">
+ {{range $marker, $item := .Notes}}
+ <option value="pkg-note-{{$marker}}">{{(index $.NoteHeaders $marker).Label}}s</option>
+ {{end}}
+ </optgroup>
+ {{end}}
+ <option class="js-sourcefilesOption" value="section-sourcefiles">Source Files</option>
+ <option class="js-directoriesOption" value="section-directories">Directories</option>
+ </select>
</nav>
diff --git a/content/static/html/doc/sidenav.tmpl b/content/static/html/doc/sidenav.tmpl
index 73771a5..8cb5a00 100644
--- a/content/static/html/doc/sidenav.tmpl
+++ b/content/static/html/doc/sidenav.tmpl
@@ -4,90 +4,90 @@
license that can be found in the LICENSE file.
-->
<nav class="DocNav js-sideNav">
- <ul role="tree" aria-label="Outline">
- {{if or .Doc (index .Examples.Map "")}}
- <li class="DocNav-overview" role="none">
- <a href="#pkg-overview" class="js-docNav" role="treeitem" aria-level="1" tabindex="0">Overview</a>
- </li>
- {{end}}
- {{- if or .Consts .Vars .Funcs .Types -}}
- <li class="DocNav-index" role="none">
- <a href="#pkg-index" class="DocNav-groupLabel{{if not .Examples.List}} DocNav-groupLabel--empty{{end}} js-docNav"
- role="treeitem" aria-expanded="false" aria-level="1" aria-owns="nav-group-index" tabindex="-1">
- Index
- </a>
- {{if .Examples.List}}
- <ul role="group" id="nav-group-index">
- <li role="none">
- <a href="#pkg-examples" role="treeitem" aria-level="2" tabindex="-1">Examples</a>
- </li>
- </ul>
- {{end}}
- </li>
- <li class="DocNav-constants" role="none">
- <a href="#pkg-constants" class="js-docNav" role="treeitem" aria-level="1" tabindex="-1">Constants</a>
- </li>
- <li class="DocNav-variables" role="none">
- <a href="#pkg-variables" class="js-docNav" role="treeitem" aria-level="1" tabindex="-1">Variables</a>
- </li>
- <li class="DocNav-functions" role="none">
- <a href="#pkg-functions" class="DocNav-groupLabel{{if eq (len .Funcs) 0}} DocNav-groupLabel--empty{{end}} js-docNav"
- role="treeitem" aria-expanded="false" aria-level="1" aria-owns="nav-group-functions" tabindex="-1">
- Functions
- </a>
- <ul role="group" id="nav-group-functions">
- {{range .Funcs}}
- <li role="none">
- <a href="#{{.Name}}" title="{{render_short_synopsis .Decl}}" role="treeitem" aria-level="2" tabindex="-1">{{render_short_synopsis .Decl}}</a>
- </li>
- {{end}}
- </ul>
- </li>
- <li class="DocNav-types" role="none">
- <a href="#pkg-types" class="DocNav-groupLabel{{if eq (len .Types) 0}} DocNav-groupLabel--empty{{end}} js-docNav"
- role="treeitem" aria-expanded="false" aria-level="1" aria-owns="nav-group-types" tabindex="-1">
- Types
- </a>
- <ul role="group" id="nav-group-types">
- {{range .Types}}
- {{$tname := .Name}}
- <li role="none">
- {{if or .Funcs .Methods}}
- {{$navgroupname := (printf "nav.group.%s" $tname)}}
- {{$navgroupid := (safe_id $navgroupname)}}
- <a class="DocNav-groupLabel js-docNavType" href="#{{$tname}}" role="treeitem" aria-expanded="false" aria-level="2" data-aria-owns="{{$navgroupid}}" tabindex="-1">type {{$tname}}</a>
- <ul role="group" id="{{$navgroupid}}">
- {{range .Funcs}}
- <li role="none">
- <a href="#{{.Name}}" title="{{render_short_synopsis .Decl}}" role="treeitem" aria-level="3" tabindex="-1">{{render_short_synopsis .Decl}}</a>
- </li>
- {{end}}
- {{range .Methods}}
- <li role="none">
- <a href="#{{$tname}}.{{.Name}}" title="{{render_short_synopsis .Decl}}" role="treeitem" aria-level="3" tabindex="-1">{{render_short_synopsis .Decl}}</a>
- </li>
- {{end}}
- </ul>
- {{else}}
- <a href="#{{$tname}}" role="treeitem" aria-level="2" tabindex="-1">type {{$tname}}</a>
- {{end}} {{/* if or .Funcs .Methods */}}
- </li>
- {{end}} {{/* range .Types */}}
- </ul>
- </li>
- {{end}}
- {{if .Notes}}
- <li class="DocNav-notes" role="none">
- <a href="#pkg-notes" class="DocNav-groupLabel{{if eq (len .Notes) 0}} DocNav-groupLabel--empty{{end}} js-docNav"
- role="treeitem" aria-expanded="false" aria-level="1" aria-owns="nav-group-notes" tabindex="-1">Notes</a>
- <ul role="group" id="nav-group-notes">
- {{range $marker, $item := .Notes}}
- <li role="none">
- <a href="#pkg-note-{{$marker}}" role="treeitem" aria-level="2" tabindex="-1">{{(index $.NoteHeaders $marker).Label}}s</a>
- </li>
- {{end}}
- </ul>
- </li>
- {{end}}
- </ul>
+ <ul role="tree" aria-label="Outline">
+ {{if or .Doc (index .Examples.Map "")}}
+ <li class="DocNav-overview" role="none">
+ <a href="#pkg-overview" class="js-docNav" role="treeitem" aria-level="1" tabindex="0">Overview</a>
+ </li>
+ {{end}}
+ {{- if or .Consts .Vars .Funcs .Types -}}
+ <li class="DocNav-index" role="none">
+ <a href="#pkg-index" class="DocNav-groupLabel{{if not .Examples.List}} DocNav-groupLabel--empty{{end}} js-docNav"
+ role="treeitem" aria-expanded="false" aria-level="1" aria-owns="nav-group-index" tabindex="-1">
+ Index
+ </a>
+ {{if .Examples.List}}
+ <ul role="group" id="nav-group-index">
+ <li role="none">
+ <a href="#pkg-examples" role="treeitem" aria-level="2" tabindex="-1">Examples</a>
+ </li>
+ </ul>
+ {{end}}
+ </li>
+ <li class="DocNav-constants" role="none">
+ <a href="#pkg-constants" class="js-docNav" role="treeitem" aria-level="1" tabindex="-1">Constants</a>
+ </li>
+ <li class="DocNav-variables" role="none">
+ <a href="#pkg-variables" class="js-docNav" role="treeitem" aria-level="1" tabindex="-1">Variables</a>
+ </li>
+ <li class="DocNav-functions" role="none">
+ <a href="#pkg-functions" class="DocNav-groupLabel{{if eq (len .Funcs) 0}} DocNav-groupLabel--empty{{end}} js-docNav"
+ role="treeitem" aria-expanded="false" aria-level="1" aria-owns="nav-group-functions" tabindex="-1">
+ Functions
+ </a>
+ <ul role="group" id="nav-group-functions">
+ {{range .Funcs}}
+ <li role="none">
+ <a href="#{{.Name}}" title="{{render_short_synopsis .Decl}}" role="treeitem" aria-level="2" tabindex="-1">{{render_short_synopsis .Decl}}</a>
+ </li>
+ {{end}}
+ </ul>
+ </li>
+ <li class="DocNav-types" role="none">
+ <a href="#pkg-types" class="DocNav-groupLabel{{if eq (len .Types) 0}} DocNav-groupLabel--empty{{end}} js-docNav"
+ role="treeitem" aria-expanded="false" aria-level="1" aria-owns="nav-group-types" tabindex="-1">
+ Types
+ </a>
+ <ul role="group" id="nav-group-types">
+ {{range .Types}}
+ {{$tname := .Name}}
+ <li role="none">
+ {{if or .Funcs .Methods}}
+ {{$navgroupname := (printf "nav.group.%s" $tname)}}
+ {{$navgroupid := (safe_id $navgroupname)}}
+ <a class="DocNav-groupLabel js-docNavType" href="#{{$tname}}" role="treeitem" aria-expanded="false" aria-level="2" data-aria-owns="{{$navgroupid}}" tabindex="-1">type {{$tname}}</a>
+ <ul role="group" id="{{$navgroupid}}">
+ {{range .Funcs}}
+ <li role="none">
+ <a href="#{{.Name}}" title="{{render_short_synopsis .Decl}}" role="treeitem" aria-level="3" tabindex="-1">{{render_short_synopsis .Decl}}</a>
+ </li>
+ {{end}}
+ {{range .Methods}}
+ <li role="none">
+ <a href="#{{$tname}}.{{.Name}}" title="{{render_short_synopsis .Decl}}" role="treeitem" aria-level="3" tabindex="-1">{{render_short_synopsis .Decl}}</a>
+ </li>
+ {{end}}
+ </ul>
+ {{else}}
+ <a href="#{{$tname}}" role="treeitem" aria-level="2" tabindex="-1">type {{$tname}}</a>
+ {{end}} {{/* if or .Funcs .Methods */}}
+ </li>
+ {{end}} {{/* range .Types */}}
+ </ul>
+ </li>
+ {{end}}
+ {{if .Notes}}
+ <li class="DocNav-notes" role="none">
+ <a href="#pkg-notes" class="DocNav-groupLabel{{if eq (len .Notes) 0}} DocNav-groupLabel--empty{{end}} js-docNav"
+ role="treeitem" aria-expanded="false" aria-level="1" aria-owns="nav-group-notes" tabindex="-1">Notes</a>
+ <ul role="group" id="nav-group-notes">
+ {{range $marker, $item := .Notes}}
+ <li role="none">
+ <a href="#pkg-note-{{$marker}}" role="treeitem" aria-level="2" tabindex="-1">{{(index $.NoteHeaders $marker).Label}}s</a>
+ </li>
+ {{end}}
+ </ul>
+ </li>
+ {{end}}
+ </ul>
</nav>
diff --git a/content/static/html/doc/unit.tmpl b/content/static/html/doc/unit.tmpl
index 7fd1e33..fcbbc6b 100644
--- a/content/static/html/doc/unit.tmpl
+++ b/content/static/html/doc/unit.tmpl
@@ -5,7 +5,7 @@
-->
{{if or .Doc .Consts .Vars .Funcs .Types}}
- {{template "sidenav.tmpl" .}}
- {{template "sidenav-mobile.tmpl" .}}
+ {{template "sidenav.tmpl" .}}
+ {{template "sidenav-mobile.tmpl" .}}
{{end}}
{{template "body.tmpl" .}}
diff --git a/internal/godoc/dochtml/dochtml_test.go b/internal/godoc/dochtml/dochtml_test.go
index 9690dce..34aaadf 100644
--- a/internal/godoc/dochtml/dochtml_test.go
+++ b/internal/godoc/dochtml/dochtml_test.go
@@ -249,9 +249,9 @@
</pre>
</div>
<div class="Documentation-exampleButtonsContainer">
- <p class="Documentation-exampleError" role="alert" aria-atomic="true"></p>
- <button class="Documentation-examplePlayButton" aria-label="Play Code">Play</button>
- </div></details>`,
+ <p class="Documentation-exampleError" role="alert" aria-atomic="true"></p>
+ <button class="Documentation-examplePlayButton" aria-label="Play Code">Play</button>
+ </div></details>`,
},
} {
t.Run(test.name, func(t *testing.T) {