Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Add KotlinWebSite plugin to transform samples (#2349)
- Loading branch information
Showing
7 changed files
with
56 additions
and
15 deletions.
There are no files selected for viewing
19 changes: 19 additions & 0 deletions
19
integration-tests/gradle/projects/stdlib/dokka-samples-transformer-plugin/build.gradle
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,19 @@ | ||
plugins { | ||
id 'org.jetbrains.kotlin.jvm' | ||
} | ||
description "Dokka Plugin to transform the samples from stdlib" | ||
|
||
repositories { | ||
mavenLocal() | ||
mavenCentral() | ||
} | ||
|
||
dependencies { | ||
implementation "org.jetbrains.dokka:dokka-base:${dokka_it_kotlin_version}" | ||
compileOnly "org.jetbrains.dokka:dokka-core:${dokka_it_kotlin_version}" | ||
} | ||
|
||
tasks.withType(org.jetbrains.kotlin.gradle.tasks.KotlinCompile) { | ||
kotlinOptions.jvmTarget = "1.8" | ||
} | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
15 changes: 15 additions & 0 deletions
15
...sformer-plugin/src/main/kotlin/org/jetbrains/dokka/kotlinlang/SamplesTransformerPlugin.kt
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,15 @@ | ||
package org.jetbrains.dokka.kotlinlang | ||
|
||
import org.jetbrains.dokka.CoreExtensions | ||
import org.jetbrains.dokka.base.DokkaBase | ||
import org.jetbrains.dokka.plugability.DokkaPlugin | ||
|
||
class SamplesTransformerPlugin : DokkaPlugin() { | ||
private val dokkaBase by lazy { plugin<DokkaBase>() } | ||
|
||
val kotlinWebsiteSamplesTransformer by extending { | ||
CoreExtensions.pageTransformer providing ::KotlinWebsiteSamplesTransformer override dokkaBase.defaultSamplesTransformer order { | ||
before(dokkaBase.pageMerger) | ||
} | ||
} | ||
} |
1 change: 1 addition & 0 deletions
1
...r-plugin/src/main/resources/META-INF/services/org.jetbrains.dokka.plugability.DokkaPlugin
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1 @@ | ||
org.jetbrains.dokka.kotlinlang.SamplesTransformerPlugin |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters