kotlin

package
v0.48.1 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Oct 10, 2026 License: MIT Imports: 8 Imported by: 0

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

Constants

This section is empty.

Variables

This section is empty.

Functions

func New

func New() extractors.Extractor

New builds the Kotlin extractor.

Types

type Extractor

type Extractor struct {
	extractors.Base
}

Extractor reads Kotlin source.

func (*Extractor) Detect

func (e *Extractor) Detect(dir string) bool

Detect reports whether dir is a Kotlin project, by either Gradle build script.

func (*Extractor) FileExtensions

func (e *Extractor) FileExtensions() []string

FileExtensions is the one extension Kotlin source carries.

func (*Extractor) ModuleDocstring

func (e *Extractor) ModuleDocstring(path string) (string, error)

ModuleDocstring is the module-level KDoc comment at the top of a Kotlin file.

func (*Extractor) PublicSymbols

func (e *Extractor) PublicSymbols(file string) ([]string, error)

PublicSymbols lists the symbols a Kotlin file exports.

func (*Extractor) ResolvePath

func (e *Extractor) ResolvePath(pathArg string, sourcePaths []string, baseDir string) string

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").

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL