diff options
author | Filip Zybała <fzybala@virtuslab.com> | 2020-03-10 17:07:53 +0100 |
---|---|---|
committer | Paweł Marks <Kordyjan@users.noreply.github.com> | 2020-03-11 11:40:38 +0100 |
commit | 39759708d2329f81008e66ff57c11898cd739246 (patch) | |
tree | a6ddf1b91586d2089637ceb85b7b9b644ddd8344 /plugins/base | |
parent | c3d8894722c20411d56194e7529b52644307731e (diff) | |
download | dokka-39759708d2329f81008e66ff57c11898cd739246.tar.gz dokka-39759708d2329f81008e66ff57c11898cd739246.tar.bz2 dokka-39759708d2329f81008e66ff57c11898cd739246.zip |
Add DRIs to navigation elements, tag each ContentPage with DRI, add JS for collapsing navigation
Diffstat (limited to 'plugins/base')
-rw-r--r-- | plugins/base/src/main/kotlin/renderers/html/HtmlRenderer.kt | 5 | ||||
-rw-r--r-- | plugins/base/src/main/kotlin/renderers/html/NavigationPage.kt | 1 |
2 files changed, 5 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 74bc6fea..aaa9c0a4 100644 --- a/plugins/base/src/main/kotlin/renderers/html/HtmlRenderer.kt +++ b/plugins/base/src/main/kotlin/renderers/html/HtmlRenderer.kt @@ -202,7 +202,10 @@ open class HtmlRenderer( private fun PageNode.root(path: String) = locationProvider.resolveRoot(this) + path override fun buildPage(page: ContentPage, content: (FlowContent, ContentPage) -> Unit): String = - buildHtml(page, page.embeddedResources) { content(this, page) } + buildHtml(page, page.embeddedResources) { + attributes["pageIds"] = page.dri.toList()[0].toString() + content(this, page) + } open fun buildHtml(page: PageNode, resources: List<String>, content: FlowContent.() -> Unit) = createHTML().html { diff --git a/plugins/base/src/main/kotlin/renderers/html/NavigationPage.kt b/plugins/base/src/main/kotlin/renderers/html/NavigationPage.kt index ad574769..4b90cc8a 100644 --- a/plugins/base/src/main/kotlin/renderers/html/NavigationPage.kt +++ b/plugins/base/src/main/kotlin/renderers/html/NavigationPage.kt @@ -23,6 +23,7 @@ class NavigationPage(val root: NavigationNode) : RendererSpecificPage { with(renderer) { div("sideMenuPart") { id = navId + attributes["pageId"] = node.dri.toString() div("overview") { buildLink(node.dri, node.platforms) { +node.name } if (node.children.isNotEmpty()) { |