diff options
author | Marcin Aman <marcin.aman@gmail.com> | 2020-10-12 11:31:36 +0200 |
---|---|---|
committer | Kamil Doległo <9080183+kamildoleglo@users.noreply.github.com> | 2020-10-14 11:49:58 +0200 |
commit | 16fb8510dba9943dd062d42c12ea44525cc5ea9f (patch) | |
tree | f7a485edf09f9a8f5bbc715587da2aa85fcc73b2 /plugins/base/src/main/kotlin | |
parent | 6bb04a1ca37ebd972efbb1108d16a7d134619d27 (diff) | |
download | dokka-16fb8510dba9943dd062d42c12ea44525cc5ea9f.tar.gz dokka-16fb8510dba9943dd062d42c12ea44525cc5ea9f.tar.bz2 dokka-16fb8510dba9943dd062d42c12ea44525cc5ea9f.zip |
Shorten anchors
Diffstat (limited to 'plugins/base/src/main/kotlin')
-rw-r--r-- | plugins/base/src/main/kotlin/renderers/html/HtmlRenderer.kt | 7 |
1 files changed, 6 insertions, 1 deletions
diff --git a/plugins/base/src/main/kotlin/renderers/html/HtmlRenderer.kt b/plugins/base/src/main/kotlin/renderers/html/HtmlRenderer.kt index 8f6129a6..31a96110 100644 --- a/plugins/base/src/main/kotlin/renderers/html/HtmlRenderer.kt +++ b/plugins/base/src/main/kotlin/renderers/html/HtmlRenderer.kt @@ -849,8 +849,13 @@ val ContentNode.isAnchorable: Boolean val ContentNode.anchorLabel: String? get() = extra[SymbolAnchorHint]?.anchorName +/** + * Anchors should be unique and should contain sourcesets, dri and contentKind. + * The idea is to make them as short as possible and just use a hashCode from sourcesets in order to match the + * 2040 characters limit + */ val ContentNode.anchor: String? - get() = extra[SymbolAnchorHint]?.contentKind?.let { contentKind -> (dci.dri.first().toString() + "/" + contentKind + "/" + sourceSets.joinToString { it.sourceSetIDs.all.joinToString() }).urlEncoded() } + get() = extra[SymbolAnchorHint]?.contentKind?.let { contentKind -> (dci.dri.first().toString() + "/" + contentKind + "/" + sourceSets.hashCode()).urlEncoded() } val ContentNode.sourceSetsFilters: String get() = sourceSets.sourceSetIDs.joinToString(" ") { it.toString() } |