Documentation
¶
Overview ¶
Package kotlin resolves selfdoc's directives against Kotlin source.
Nothing from the Kotlin toolchain is required: the file is read with patterns. The four directives it serves are ref, prose-desc, table-schema and table-config.
Public by default ¶
Kotlin's default visibility is public, so a declaration carrying no visibility keyword belongs on a reference page. What the scanner looks for is therefore the three keywords that take a declaration off it -- private, protected and internal -- with one exception: an internal declaration marked @PublishedApi is part of the published API by definition, and is rendered.
KDoc ¶
A KDoc block documents the declaration directly beneath it and nothing else: a blank line between them breaks the association, which is Kotlin's own rule and the one the scanner enforces. Every tag the language documents is rendered -- the @param and @property tags accumulate into their own sections, the rest render a bold label -- and the square-bracket links become code spans.
Index ¶
- func New() extractors.Extractor
- type Extractor
- func (e *Extractor) Detect(dir string) bool
- func (e *Extractor) FileExtensions() []string
- func (e *Extractor) ModuleDocstring(path string) (string, error)
- func (e *Extractor) PublicSymbols(file string) ([]string, error)
- func (e *Extractor) ResolvePath(pathArg string, sourcePaths []string, baseDir string) string
- func (e *Extractor) SymbolDetails(file, symbol string) (*extractors.SymbolDetails, error)
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
Types ¶
type Extractor ¶
type Extractor struct {
extractors.Base
}
Extractor reads Kotlin source.
func (*Extractor) Detect ¶
Detect reports whether dir is a Kotlin project, by either Gradle build script.
func (*Extractor) FileExtensions ¶
FileExtensions is the one extension Kotlin source carries.
func (*Extractor) ModuleDocstring ¶
ModuleDocstring is the module-level KDoc comment at the top of a Kotlin file.
func (*Extractor) PublicSymbols ¶
PublicSymbols lists the symbols a Kotlin file exports.
func (*Extractor) ResolvePath ¶
ResolvePath resolves a directive's path argument to a Kotlin file or directory.
func (*Extractor) SymbolDetails ¶
func (e *Extractor) SymbolDetails(file, symbol string) (*extractors.SymbolDetails, error)
SymbolDetails reports what a Kotlin file says about one symbol's parameters and return value. A data class answers with its primary constructor, and a dotted name selects a member of a class, an object or an interface ("UserService.findUser").