diff options
author | Marcin Aman <marcin.aman@gmail.com> | 2020-10-07 14:40:09 +0200 |
---|---|---|
committer | Kamil Doległo <9080183+kamildoleglo@users.noreply.github.com> | 2020-10-08 19:05:41 +0200 |
commit | 0d2ee179b6563020874db9f60906fb16b6ae1556 (patch) | |
tree | d55f43d48eea5966d312a8fe169cf1b493ce927d /plugins/base/src/main/kotlin/translators | |
parent | 4331d1b816c30731842ab36827bbc1a4a9b292b3 (diff) | |
download | dokka-0d2ee179b6563020874db9f60906fb16b6ae1556.tar.gz dokka-0d2ee179b6563020874db9f60906fb16b6ae1556.tar.bz2 dokka-0d2ee179b6563020874db9f60906fb16b6ae1556.zip |
Add information about content kind and sourceset to anchor
Diffstat (limited to 'plugins/base/src/main/kotlin/translators')
-rw-r--r-- | plugins/base/src/main/kotlin/translators/documentables/DefaultPageCreator.kt | 6 | ||||
-rw-r--r-- | plugins/base/src/main/kotlin/translators/documentables/PageContentBuilder.kt | 4 |
2 files changed, 5 insertions, 5 deletions
diff --git a/plugins/base/src/main/kotlin/translators/documentables/DefaultPageCreator.kt b/plugins/base/src/main/kotlin/translators/documentables/DefaultPageCreator.kt index caeb6bcb..6c1b5ea4 100644 --- a/plugins/base/src/main/kotlin/translators/documentables/DefaultPageCreator.kt +++ b/plugins/base/src/main/kotlin/translators/documentables/DefaultPageCreator.kt @@ -186,7 +186,7 @@ open class DefaultPageCreator( .groupBy({ it.second }, { it.first }).map { (classlike, platforms) -> val label = classlike.classNames?.substringBeforeLast(".") ?: classlike.toString() .also { logger.warn("No class name found for DRI $classlike") } - buildGroup(setOf(dri), platforms.toSet(), ContentKind.Inheritors, extra = mainExtra + SymbolAnchorHint(label)) { + buildGroup(setOf(classlike), platforms.toSet(), ContentKind.Inheritors, extra = mainExtra + SymbolAnchorHint(label, ContentKind.Inheritors)) { link(label, classlike) } }, @@ -530,7 +530,7 @@ open class DefaultPageCreator( sourceSets = elements.flatMap { it.sourceSets }.toSet(), kind = kind, styles = emptySet(), - extra = elementName?.let { name -> extra + SymbolAnchorHint(name) } ?: extra + extra = elementName?.let { name -> extra + SymbolAnchorHint(name, kind) } ?: extra ) { link(elementName.orEmpty(), elements.first().dri, kind = kind) divergentGroup( @@ -540,7 +540,7 @@ open class DefaultPageCreator( extra = extra ) { elements.map { - instance(setOf(it.dri), it.sourceSets.toSet(), extra = PropertyContainer.withAll(SymbolAnchorHint(it.name ?: ""))) { + instance(setOf(it.dri), it.sourceSets.toSet(), extra = PropertyContainer.withAll(SymbolAnchorHint(it.name ?: "", kind))) { divergent { group { +buildSignature(it) diff --git a/plugins/base/src/main/kotlin/translators/documentables/PageContentBuilder.kt b/plugins/base/src/main/kotlin/translators/documentables/PageContentBuilder.kt index c67fe4b0..1865f276 100644 --- a/plugins/base/src/main/kotlin/translators/documentables/PageContentBuilder.kt +++ b/plugins/base/src/main/kotlin/translators/documentables/PageContentBuilder.kt @@ -115,7 +115,7 @@ open class PageContentBuilder( sourceSets, kind, styles, - extra + SymbolAnchorHint(text.replace("\\s".toRegex(), "").toLowerCase()) + extra + SymbolAnchorHint(text.replace("\\s".toRegex(), "").toLowerCase(), kind) ) { text(text, kind = kind) block() @@ -185,7 +185,7 @@ open class PageContentBuilder( else it } .map { - val newExtra = if (needsAnchors) extra + SymbolAnchorHint.from(it) else extra + val newExtra = if (needsAnchors) extra + SymbolAnchorHint.from(it, kind) else extra buildGroup(setOf(it.dri), it.sourceSets.toSet(), kind, styles, newExtra) { operation(it) } |