Documentation ¶
Overview ¶
Package pkgsite is not for external use. May change at any time without warning.
Copied from https://github.com/golang/pkgsite/blob/ff1e697b104e751da362159cf6c7743898eea3fe/internal/fetch/dochtml/internal/render/ and https://github.com/golang/pkgsite/tree/88f8a28ab2102416529d05d11e8135a43e146d46/internal/fetch/dochtml.
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func PrintType ¶
func PrintType(fset *token.FileSet, decl ast.Decl, toURL func(string, string) string, topLevelDecls map[interface{}]bool) string
PrintType returns a string representation of the decl.
PrintType works by:
- Generate a map from every identifier to a URL for the identifier (or no URL if the identifier shouldn't link).
- ast.Inspect the decl to get an ordered slice of every identifier to the link for it, using the map from step 1.
- Print out the plain doc for the decl.
- Use scanner.Scanner to find every identifier (in the same order as step 2). If there is a link for the identifier, insert it. Otherwise, print the plain doc.
func TopLevelDecls ¶ added in v0.77.0
TopLevelDecls returns the top level declarations in the package.
Types ¶
This section is empty.
Click to show internal directories.
Click to hide internal directories.