From 7e87c8ac4b7b3987df1722d7b9a6d3b2c5b169a4 Mon Sep 17 00:00:00 2001 From: Kamil Doległo Date: Tue, 26 Nov 2019 18:12:23 +0100 Subject: Fix XMLPlugin after changes in DRIs --- plugins/xml/src/main/kotlin/XmlPlugin.kt | 11 ++++------- 1 file changed, 4 insertions(+), 7 deletions(-) (limited to 'plugins/xml') diff --git a/plugins/xml/src/main/kotlin/XmlPlugin.kt b/plugins/xml/src/main/kotlin/XmlPlugin.kt index 5be0eca4..9de706b2 100644 --- a/plugins/xml/src/main/kotlin/XmlPlugin.kt +++ b/plugins/xml/src/main/kotlin/XmlPlugin.kt @@ -1,16 +1,14 @@ package org.jetbrains.dokka.xml import org.jetbrains.dokka.CoreExtensions -import org.jetbrains.dokka.DefaultExtra import org.jetbrains.dokka.DokkaConsoleLogger import org.jetbrains.dokka.Model.DocumentationNode import org.jetbrains.dokka.Model.dfs -import org.jetbrains.dokka.links.DRI +import org.jetbrains.dokka.XMLMega import org.jetbrains.dokka.pages.* import org.jetbrains.dokka.plugability.DokkaContext import org.jetbrains.dokka.plugability.DokkaPlugin import org.jetbrains.dokka.transformers.PageNodeTransformer -import javax.xml.bind.annotation.XmlList class XmlPlugin : DokkaPlugin() { val transformer by extending { @@ -28,13 +26,12 @@ object XmlTransformer : PageNodeTransformer { if (node !is ClassPageNode) node else { val refs = - node.documentationNode?.extra?.filterIsInstance()?.filter { it.key == "@attr ref" } + node.documentationNode?.extra?.filterIsInstance()?.filter { it.key == "@attr ref" } .orEmpty() val elementsToAdd = mutableListOf() refs.forEach { ref -> - val toFind = DRI.from(ref.value) - input.documentationNode?.dfs { it.dri == toFind }?.let { elementsToAdd.add(it) } + input.documentationNode?.dfs { it.dri == ref.dri }?.let { elementsToAdd.add(it) } } val platformData = node.platforms().toSet() val refTable = DefaultPageContentBuilder.group( @@ -57,7 +54,7 @@ object XmlTransformer : PageNodeTransformer { val children = (node.content as ContentGroup).children node.modified(content = content.copy(children = children + refTable)) } - } + } private fun PageNode.platforms() = this.content.platforms.toList() } \ No newline at end of file -- cgit