diff options
author | sebastian.sellmair <sebastian.sellmair@jetbrains.com> | 2020-08-21 10:19:07 +0200 |
---|---|---|
committer | Sebastian Sellmair <34319766+sellmair@users.noreply.github.com> | 2020-08-31 15:10:04 +0200 |
commit | 333091e5c5f896769c3371dd74c87a52ffa9562a (patch) | |
tree | c41e918ef66419eca9eb5ee4fcb0c5230e0a82b9 /plugins/base/src/main/kotlin/transformers/documentables | |
parent | 43e38725e64b788564203b8d157df795f443f28e (diff) | |
download | dokka-333091e5c5f896769c3371dd74c87a52ffa9562a.tar.gz dokka-333091e5c5f896769c3371dd74c87a52ffa9562a.tar.bz2 dokka-333091e5c5f896769c3371dd74c87a52ffa9562a.zip |
Implement ParseModuleAndPackageDocFragments API
Diffstat (limited to 'plugins/base/src/main/kotlin/transformers/documentables')
-rw-r--r-- | plugins/base/src/main/kotlin/transformers/documentables/ModuleAndPackageDocumentationTransformer.kt | 9 |
1 files changed, 2 insertions, 7 deletions
diff --git a/plugins/base/src/main/kotlin/transformers/documentables/ModuleAndPackageDocumentationTransformer.kt b/plugins/base/src/main/kotlin/transformers/documentables/ModuleAndPackageDocumentationTransformer.kt index 71824922..5f1a540d 100644 --- a/plugins/base/src/main/kotlin/transformers/documentables/ModuleAndPackageDocumentationTransformer.kt +++ b/plugins/base/src/main/kotlin/transformers/documentables/ModuleAndPackageDocumentationTransformer.kt @@ -37,12 +37,7 @@ internal class ModuleAndPackageDocumentationTransformer( .readText() .split(Regex("(\n|^)# (?=(Module|Package))")) // Matches heading with Module/Package to split by .filter { it.isNotEmpty() } - .map { - it.split( - Regex(" "), - 2 - ) - } // Matches space between Module/Package and fully qualified name + .map { it.split(Regex(" "), 2) } // Matches space between Module/Package and fully qualified name }.groupBy({ it[0] }, { it[1].split(Regex("\n"), 2) // Matches new line after fully qualified name .let { it[0].trim() to it[1].trim() } @@ -99,7 +94,7 @@ internal class ModuleAndPackageDocumentationTransformer( } } - private fun mergeDocumentation(origin: Map<DokkaSourceSet, DocumentationNode>, new: Map<DokkaSourceSet, DocumentationNode>) = + private fun mergeDocumentation(origin: Map<DokkaSourceSet, DocumentationNode>, new: Map<DokkaSourceSet, DocumentationNode>): Map<DokkaSourceSet, DocumentationNode> = (origin.asSequence() + new.asSequence()) .distinct() .groupBy({ it.key }, { it.value }) |