diff options
author | Marcin Aman <maman@virtuslab.com> | 2020-08-13 16:23:26 +0200 |
---|---|---|
committer | Kamil Doległo <9080183+kamildoleglo@users.noreply.github.com> | 2020-10-08 19:05:41 +0200 |
commit | aae7623bb459d2bcd1e1b492aadf5c3858a3e657 (patch) | |
tree | f404b8bb3caed3e394f7b54d7296836851cfb2ab /plugins/base/src/main/kotlin/resolvers | |
parent | be3fea152ae5dcec5ba9a29d86a69010d6b2e428 (diff) | |
download | dokka-aae7623bb459d2bcd1e1b492aadf5c3858a3e657.tar.gz dokka-aae7623bb459d2bcd1e1b492aadf5c3858a3e657.tar.bz2 dokka-aae7623bb459d2bcd1e1b492aadf5c3858a3e657.zip |
Anchors hint
Diffstat (limited to 'plugins/base/src/main/kotlin/resolvers')
-rw-r--r-- | plugins/base/src/main/kotlin/resolvers/anchors/AnchorsHint.kt | 10 |
1 files changed, 7 insertions, 3 deletions
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<ContentNode>, ExtraProperty.Key<ContentNode, SymbolAnchorHint> { - override val key = this +data class SymbolAnchorHint(val anchorName: String): ExtraProperty<ContentNode> { + object SymbolAnchorHintKey : ExtraProperty.Key<ContentNode, SymbolAnchorHint> + override val key: ExtraProperty.Key<ContentNode, SymbolAnchorHint> = SymbolAnchorHintKey + companion object: ExtraProperty.Key<ContentNode, SymbolAnchorHint> { + fun from(d: Documentable): SymbolAnchorHint? = d.name?.let { SymbolAnchorHint(it) } + } }
\ No newline at end of file |