DokkaSourceLinkSpec

abstract class DokkaSourceLinkSpec @DokkatooInternalApi @Inject constructor(layout: ProjectLayout) : Serializable(source)

Configuration builder that allows adding a source link to each signature which leads to remoteUrl with a specific line number (configurable by setting remoteLineSuffix), letting documentation readers find source code for each declaration.

Example in Gradle Kotlin DSL:

sourceLink {
localDirectory.set(projectDir.resolve("src"))
remoteUrl.set(URI("https://github.com/kotlin/dokka/tree/master/src"))
remoteLineSuffix.set("#L")
}

Constructors

Link copied to clipboard
constructor(layout: ProjectLayout)

Properties

Link copied to clipboard

Path to the local source directory. The path must be relative to the root of current project.

Link copied to clipboard

Suffix used to append source code line number to the URL. This will help readers navigate not only to the file, but to the specific line number of the declaration.

Link copied to clipboard
@get:Input
abstract val remoteUrl: Property<URI>

URL of source code hosting service that can be accessed by documentation readers, like GitHub, GitLab, Bitbucket, etc. This URL will be used to generate source code links of declarations.

Functions

Link copied to clipboard
fun remoteUrl(value: String)

Set the value of remoteUrl.