diff options
author | Paweł Marks <pmarks@virtuslab.com> | 2020-02-03 09:06:50 +0100 |
---|---|---|
committer | Paweł Marks <Kordyjan@users.noreply.github.com> | 2020-02-04 14:42:44 +0100 |
commit | f46ddecdd1fa2afc6275e5f4379a5bd855314e36 (patch) | |
tree | 7c0345baf84100a460d5f4cd21bd2d53369dede1 /core/src/main/kotlin/renderers | |
parent | 10f91eb854a45f03b839c623e48f9dcc2add0e5f (diff) | |
download | dokka-f46ddecdd1fa2afc6275e5f4379a5bd855314e36.tar.gz dokka-f46ddecdd1fa2afc6275e5f4379a5bd855314e36.tar.bz2 dokka-f46ddecdd1fa2afc6275e5f4379a5bd855314e36.zip |
Fixes backward, not always navigable, breadcrumbs
Diffstat (limited to 'core/src/main/kotlin/renderers')
-rw-r--r-- | core/src/main/kotlin/renderers/html/HtmlRenderer.kt | 9 |
1 files changed, 6 insertions, 3 deletions
diff --git a/core/src/main/kotlin/renderers/html/HtmlRenderer.kt b/core/src/main/kotlin/renderers/html/HtmlRenderer.kt index d5dfb827..4553011c 100644 --- a/core/src/main/kotlin/renderers/html/HtmlRenderer.kt +++ b/core/src/main/kotlin/renderers/html/HtmlRenderer.kt @@ -8,7 +8,6 @@ import org.jetbrains.dokka.pages.* import org.jetbrains.dokka.plugability.DokkaContext import org.jetbrains.dokka.renderers.DefaultRenderer import org.jetbrains.dokka.renderers.OutputWriter -import org.jetbrains.dokka.transformers.pages.PageNodeTransformer import java.io.File open class HtmlRenderer( @@ -104,9 +103,10 @@ open class HtmlRenderer( } override fun FlowContent.buildNavigation(page: PageNode) = - locationProvider.ancestors(page).forEach { node -> + locationProvider.ancestors(page).asReversed().forEach { node -> text("/") - buildLink(node, page) + if (node.isNavigable) buildLink(node, page) + else text(node.name) } private fun FlowContent.buildLink(to: PageNode, from: PageNode) = @@ -211,3 +211,6 @@ private fun PageNode.pageKind() = when (this) { } else -> "other" } + +private val PageNode.isNavigable: Boolean + get() = this !is RendererSpecificPage || strategy != RenderingStrategy.DoNothing
\ No newline at end of file |