From aae7623bb459d2bcd1e1b492aadf5c3858a3e657 Mon Sep 17 00:00:00 2001 From: Marcin Aman Date: Thu, 13 Aug 2020 16:23:26 +0200 Subject: Anchors hint --- .../src/main/kotlin/renderers/html/HtmlRenderer.kt | 111 +++++++++++---------- .../main/kotlin/resolvers/anchors/AnchorsHint.kt | 10 +- .../pages/sourcelinks/SourceLinksTransformer.kt | 3 +- .../documentables/DefaultPageCreator.kt | 41 ++++---- .../documentables/PageContentBuilder.kt | 11 +- 5 files changed, 100 insertions(+), 76 deletions(-) (limited to 'plugins/base') diff --git a/plugins/base/src/main/kotlin/renderers/html/HtmlRenderer.kt b/plugins/base/src/main/kotlin/renderers/html/HtmlRenderer.kt index abb4e85b..ef5d78b6 100644 --- a/plugins/base/src/main/kotlin/renderers/html/HtmlRenderer.kt +++ b/plugins/base/src/main/kotlin/renderers/html/HtmlRenderer.kt @@ -9,6 +9,8 @@ import org.jetbrains.dokka.DokkaSourceSetID import org.jetbrains.dokka.base.DokkaBase import org.jetbrains.dokka.base.renderers.DefaultRenderer import org.jetbrains.dokka.base.renderers.TabSortingStrategy +import org.jetbrains.dokka.base.resolvers.anchors.SymbolAnchorHint +import org.jetbrains.dokka.base.transformers.pages.sourcelinks.hasTabbedContent import org.jetbrains.dokka.base.renderers.isImage import org.jetbrains.dokka.links.DRI import org.jetbrains.dokka.model.DisplaySourceSet @@ -103,6 +105,7 @@ open class HtmlRenderer( } node.hasStyle(TextStyle.Paragraph) -> p(additionalClasses) { childrenCallback() } node.hasStyle(TextStyle.Block) -> div(additionalClasses) { childrenCallback() } + node.isAnchorable -> buildAnchor(node.anchor, node.anchorLabel!!) { childrenCallback() } else -> childrenCallback() } } @@ -376,14 +379,12 @@ open class HtmlRenderer( sourceSetRestriction: Set?, style: Set