Documentation ¶
Overview ¶
Package doc implements support for documentation of Gno packages and realms, in a similar fashion to `go doc`. As a reference, the official implementation for `go doc` is used.
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type Documentable ¶
type Documentable interface {
WriteDocumentation(w io.Writer, opts *WriteDocumentationOptions) error
}
Documentable is a package, symbol, or accessible which can be documented.
func ResolveDocumentable ¶
func ResolveDocumentable(dirs, modDirs, args []string, unexported bool) (Documentable, error)
ResolveDocumentable returns a Documentable from the given arguments. Refer to the documentation of gno doc for the formats accepted (in general the same as the go doc command). An error may be returned even if documentation was resolved in case some packages in dirs could not be parsed correctly.
dirs specifies the gno system directories to scan which specify full import paths in their directories, such as @/examples and @/gnovm/stdlibs; modDirs specifies directories which contain a gno.mod file.
type WriteDocumentationOptions ¶
type WriteDocumentationOptions struct { // ShowAll shows all symbols when displaying documentation about a package. ShowAll bool // Source shows the source code when documenting a symbol. Source bool // Unexported shows unexported symbols as well as exported. Unexported bool // Short shows a one-line representation for each symbol. Short bool // contains filtered or unexported fields }
WriteDocumentationOptions represents the possible options when requesting documentation through Documentable.