From 585178984228a9c2e5bd2af9b675094ac6e3fa46 Mon Sep 17 00:00:00 2001 From: Krzysztof Romanowski Date: Thu, 26 Nov 2020 13:05:20 +0100 Subject: Fixes from scala3doc (#1630) * Fix problem with ordering in Java api * HtmlRender allow to render html code directly from String --- .../src/main/kotlin/plugability/DokkaJavaPlugin.kt | 22 +++++++++++++--------- 1 file changed, 13 insertions(+), 9 deletions(-) (limited to 'core/src/main/kotlin') 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 internal constructor(val ext: ExtensionPoint) private fun createBuilder(action: LazyEvaluated) = ExtensionBuilder(defaultName, ext, action, - OrderingKind.None, + emptyList(), emptyList(), OverrideKind.None, emptyList()) } @@ -28,7 +28,8 @@ data class ExtensionBuilder internal constructor( private val name: String, private val ext: ExtensionPoint, private val action: LazyEvaluated, - private val ordering: OrderingKind = OrderingKind.None, + private val before: List>, + private val after: List>, private val override: OverrideKind = OverrideKind.None, private val conditions: List<(DokkaConfiguration) -> Boolean> ){ @@ -37,19 +38,22 @@ data class ExtensionBuilder internal constructor( javaClass.name, name, action, - ordering, + OrderingKind.ByDsl { + before(*before.toTypedArray()) + after(*after.toTypedArray()) + }, override, conditions ) fun overrideExtension(extension: Extension) = copy(override = OverrideKind.Present(extension)) - fun newOrdering(before: Array>, after: Array>) { - copy(ordering = OrderingKind.ByDsl { - before(*before) - after(*after) - }) - } + fun newOrdering(before: Array>, after: Array>) = + 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) -- cgit