Documentation
¶
Overview ¶
Package pkgdoc is a library-ified fork of Go's cmd/doc program that only does what we need for misc/genreadme.
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func PackageDoc ¶
PackageDoc generates Markdown documentation for the package in the given directory. importPath is the full Go import path of that package (e.g. "tailscale.com/tsnet"); it's used to render [Symbol] doc links to the right pkg.go.dev URL. If importPath is empty, build.ImportDir's guess is used (typically "." for module-based repos).
Types ¶
type Package ¶
type Package struct {
// contains filtered or unexported fields
}
func (*Package) ToMarkdown ¶
ToMarkdown parses the godoc comment text and writes a Markdown rendering to w suitable for a repository README.md: top-level sections become ## headings without per-heading anchor IDs, and [Symbol] doc links resolve to pkg.go.dev, including for symbols in the current package (which the default printer would otherwise emit as bare #Name fragments with no backing anchor).
type PackageError ¶
type PackageError string // type returned by pkg.Fatalf.
func (PackageError) Error ¶
func (p PackageError) Error() string