From 333091e5c5f896769c3371dd74c87a52ffa9562a Mon Sep 17 00:00:00 2001 From: "sebastian.sellmair" Date: Fri, 21 Aug 2020 10:19:07 +0200 Subject: Implement ParseModuleAndPackageDocFragments API --- .../documentables/ModuleAndPackageDocumentationTransformer.kt | 9 ++------- 1 file changed, 2 insertions(+), 7 deletions(-) (limited to 'plugins/base/src/main/kotlin/transformers/documentables') 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, new: Map) = + private fun mergeDocumentation(origin: Map, new: Map): Map = (origin.asSequence() + new.asSequence()) .distinct() .groupBy({ it.key }, { it.value }) -- cgit