Skip to content

Commit

Permalink
Update docs for buildscript with dokka plugins (#2134)
Browse files Browse the repository at this point in the history
  • Loading branch information
MarcinAman committed Sep 13, 2021
1 parent e511125 commit 3dae816
Showing 1 changed file with 16 additions and 1 deletion.
17 changes: 16 additions & 1 deletion docs/src/doc/docs/user_guide/gradle/usage.md
Original file line number Diff line number Diff line change
Expand Up @@ -67,7 +67,9 @@ Most of the configuration options are set per one source set.
The available configuration options for are shown below:

```kotlin
dokkaHtml {
import org.jetbrains.dokka.gradle.DokkaTask

val dokkaHtml by getting(DokkaTask::class) {
outputDirectory.set(buildDir.resolve("dokka"))

// Set module name displayed in the final output
Expand Down Expand Up @@ -261,13 +263,26 @@ To generate the documentation, use the appropriate `dokka${format}` Gradle task:
Some plugins can be configured separately using a plugin class and configuration class. For example:

```kotlin
import org.jetbrains.dokka.base.DokkaBase
import org.jetbrains.dokka.base.DokkaBaseConfiguration

pluginConfiguration<DokkaBase, DokkaBaseConfiguration> {
customAssets = listOf(file("<path to asset>"))
customStyleSheets = listOf(file("<path to custom stylesheet>"))
}
```

Keep in mind, that this only works when using a buildscript (with the configured plugin on classpath) since it is not possible to import plugin's class without it.
For example, you can add `DokkaBase` to gain access to aforementioned configuration:

```kotlin
buildscript {
dependencies {
// classpath("<plugin coordinates>:<plugin version>")
classpath("org.jetbrains.dokka:dokka-base:1.5.0")
}
}
```

If you don't want to use a buildscript or use Kotlin version lower than 1.3.50 you can achieve the same behaviour manually:
```kotlin
Expand Down

0 comments on commit 3dae816

Please sign in to comment.