From aae7623bb459d2bcd1e1b492aadf5c3858a3e657 Mon Sep 17 00:00:00 2001 From: Marcin Aman Date: Thu, 13 Aug 2020 16:23:26 +0200 Subject: Anchors hint --- plugins/base/src/main/kotlin/resolvers/anchors/AnchorsHint.kt | 10 +++++++--- 1 file changed, 7 insertions(+), 3 deletions(-) (limited to 'plugins/base/src/main/kotlin/resolvers/anchors') diff --git a/plugins/base/src/main/kotlin/resolvers/anchors/AnchorsHint.kt b/plugins/base/src/main/kotlin/resolvers/anchors/AnchorsHint.kt index 1b741484..0b68db10 100644 --- a/plugins/base/src/main/kotlin/resolvers/anchors/AnchorsHint.kt +++ b/plugins/base/src/main/kotlin/resolvers/anchors/AnchorsHint.kt @@ -1,9 +1,13 @@ package org.jetbrains.dokka.base.resolvers.anchors +import org.jetbrains.dokka.model.Documentable import org.jetbrains.dokka.model.properties.ExtraProperty import org.jetbrains.dokka.pages.ContentNode -// TODO IMPORTANT: https://github.com/Kotlin/dokka/issues/1054 -object SymbolAnchorHint: ExtraProperty, ExtraProperty.Key { - override val key = this +data class SymbolAnchorHint(val anchorName: String): ExtraProperty { + object SymbolAnchorHintKey : ExtraProperty.Key + override val key: ExtraProperty.Key = SymbolAnchorHintKey + companion object: ExtraProperty.Key { + fun from(d: Documentable): SymbolAnchorHint? = d.name?.let { SymbolAnchorHint(it) } + } } \ No newline at end of file -- cgit