aboutsummaryrefslogtreecommitdiff
path: root/core/src/main/kotlin/renderers
diff options
context:
space:
mode:
authorPaweł Marks <pmarks@virtuslab.com>2020-02-03 09:06:50 +0100
committerPaweł Marks <Kordyjan@users.noreply.github.com>2020-02-04 14:42:44 +0100
commitf46ddecdd1fa2afc6275e5f4379a5bd855314e36 (patch)
tree7c0345baf84100a460d5f4cd21bd2d53369dede1 /core/src/main/kotlin/renderers
parent10f91eb854a45f03b839c623e48f9dcc2add0e5f (diff)
downloaddokka-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.kt9
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