diff options
author | Krzysztof Romanowski <romanowski.kr@gmail.com> | 2020-11-26 13:05:20 +0100 |
---|---|---|
committer | GitHub <noreply@github.com> | 2020-11-26 13:05:20 +0100 |
commit | 585178984228a9c2e5bd2af9b675094ac6e3fa46 (patch) | |
tree | eb7f1f56bf429303147a08e3cbb297988fbd80ec /core/src/main/kotlin | |
parent | 3fe3a934092cd844a6e0b691c87c367b9fc4d5b3 (diff) | |
download | dokka-585178984228a9c2e5bd2af9b675094ac6e3fa46.tar.gz dokka-585178984228a9c2e5bd2af9b675094ac6e3fa46.tar.bz2 dokka-585178984228a9c2e5bd2af9b675094ac6e3fa46.zip |
Fixes from scala3doc (#1630)
* Fix problem with ordering in Java api
* HtmlRender allow to render html code directly from String
Diffstat (limited to 'core/src/main/kotlin')
-rw-r--r-- | core/src/main/kotlin/plugability/DokkaJavaPlugin.kt | 22 |
1 files changed, 13 insertions, 9 deletions
diff --git a/core/src/main/kotlin/plugability/DokkaJavaPlugin.kt b/core/src/main/kotlin/plugability/DokkaJavaPlugin.kt index 7c527abc..57ca520c 100644 --- a/core/src/main/kotlin/plugability/DokkaJavaPlugin.kt +++ b/core/src/main/kotlin/plugability/DokkaJavaPlugin.kt @@ -20,7 +20,7 @@ class ProvidedExtension<T: Any> internal constructor(val ext: ExtensionPoint<T>) private fun createBuilder(action: LazyEvaluated<T>) = ExtensionBuilder(defaultName, ext, action, - OrderingKind.None, + emptyList(), emptyList(), OverrideKind.None, emptyList()) } @@ -28,7 +28,8 @@ data class ExtensionBuilder<T: Any> internal constructor( private val name: String, private val ext: ExtensionPoint<T>, private val action: LazyEvaluated<T>, - private val ordering: OrderingKind = OrderingKind.None, + private val before: List<out Extension<*, *, *>>, + private val after: List<out Extension<*, *, *>>, private val override: OverrideKind = OverrideKind.None, private val conditions: List<(DokkaConfiguration) -> Boolean> ){ @@ -37,19 +38,22 @@ data class ExtensionBuilder<T: Any> internal constructor( javaClass.name, name, action, - ordering, + OrderingKind.ByDsl { + before(*before.toTypedArray()) + after(*after.toTypedArray()) + }, override, conditions ) fun overrideExtension(extension: Extension<T, *, *>) = copy(override = OverrideKind.Present(extension)) - fun newOrdering(before: Array<Extension<*, *, *>>, after: Array<Extension<*, *, *>>) { - copy(ordering = OrderingKind.ByDsl { - before(*before) - after(*after) - }) - } + fun newOrdering(before: Array<out Extension<*, *, *>>, after: Array<out Extension<*, *, *>>) = + copy(before = this.before + before, after = this.after + after) + + fun before(vararg exts: Extension<*, *, *>) = copy(before = this.before + exts) + + fun after(vararg exts: Extension<*, *, *>) = copy(after = this.after + exts) fun addCondition(c: (DokkaConfiguration) -> Boolean) = copy(conditions = conditions + c) |