mirror of
https://github.com/golang/go
synced 2024-11-22 03:54:39 -07:00
cmd/godoc: only show package documentation for commands
Fixed package.txt and adjusted package.html to match structure (swapped if branches). Fixes #4861. R=golang-dev, adg, rsc CC=golang-dev https://golang.org/cl/7714043
This commit is contained in:
parent
5183bfda75
commit
d74d0b269d
@ -10,7 +10,11 @@
|
|||||||
correspond to Go identifiers).
|
correspond to Go identifiers).
|
||||||
-->
|
-->
|
||||||
{{with .PDoc}}
|
{{with .PDoc}}
|
||||||
{{if not $.IsMain}}
|
{{if $.IsMain}}
|
||||||
|
{{/* command documentation */}}
|
||||||
|
{{comment_html .Doc}}
|
||||||
|
{{else}}
|
||||||
|
{{/* package documentation */}}
|
||||||
<div id="short-nav">
|
<div id="short-nav">
|
||||||
<dl>
|
<dl>
|
||||||
<dd><code>import "{{html .ImportPath}}"</code></dd>
|
<dd><code>import "{{html .ImportPath}}"</code></dd>
|
||||||
@ -160,8 +164,6 @@
|
|||||||
{{example_html $name $.Examples $.FSet}}
|
{{example_html $name $.Examples $.FSet}}
|
||||||
{{end}}
|
{{end}}
|
||||||
{{end}}
|
{{end}}
|
||||||
{{else}} {{/* not a package; is a command */}}
|
|
||||||
{{comment_html .Doc}}
|
|
||||||
{{end}}
|
{{end}}
|
||||||
|
|
||||||
{{with $.Notes}}
|
{{with $.Notes}}
|
||||||
|
@ -2,14 +2,15 @@
|
|||||||
|
|
||||||
---------------------------------------
|
---------------------------------------
|
||||||
|
|
||||||
*/}}{{with .PDoc}}{{if not $.IsMain}}PACKAGE
|
*/}}{{with .PDoc}}{{if $.IsMain}}COMMAND DOCUMENTATION
|
||||||
|
|
||||||
|
{{comment_text .Doc " " "\t"}}
|
||||||
|
{{else}}PACKAGE DOCUMENTATION
|
||||||
|
|
||||||
package {{.Name}}
|
package {{.Name}}
|
||||||
import "{{.ImportPath}}"
|
import "{{.ImportPath}}"
|
||||||
|
|
||||||
{{else}}COMMAND DOCUMENTATION
|
{{comment_text .Doc " " "\t"}}
|
||||||
|
|
||||||
{{end}}{{comment_text .Doc " " "\t"}}
|
|
||||||
{{example_text "" $.Examples $.FSet " "}}{{/*
|
{{example_text "" $.Examples $.FSet " "}}{{/*
|
||||||
|
|
||||||
---------------------------------------
|
---------------------------------------
|
||||||
@ -58,7 +59,7 @@ TYPES
|
|||||||
{{end}}{{range .Methods}}{{node .Decl $.FSet}}
|
{{end}}{{range .Methods}}{{node .Decl $.FSet}}
|
||||||
{{comment_text .Doc " " "\t"}}
|
{{comment_text .Doc " " "\t"}}
|
||||||
{{$name := printf "%s_%s" $tname .Name}}{{example_text $name $.Examples $.FSet " "}}
|
{{$name := printf "%s_%s" $tname .Name}}{{example_text $name $.Examples $.FSet " "}}
|
||||||
{{end}}{{end}}{{end}}{{/*
|
{{end}}{{end}}{{end}}{{end}}{{/*
|
||||||
|
|
||||||
---------------------------------------
|
---------------------------------------
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user