diff options
author | Marcin Aman <maman@virtuslab.com> | 2020-07-28 16:57:07 +0200 |
---|---|---|
committer | Paweł Marks <Kordyjan@users.noreply.github.com> | 2020-08-03 13:47:51 +0200 |
commit | d0f707af0199a99085dc40693628acbf7e543abe (patch) | |
tree | 8819f1b78fb7a5ff88e824f23cce1632b6dfd8d3 /plugins/base/src/main/kotlin/renderers | |
parent | 460cdf8bc9c54efd736b10ca58a865f034bf2e84 (diff) | |
download | dokka-d0f707af0199a99085dc40693628acbf7e543abe.tar.gz dokka-d0f707af0199a99085dc40693628acbf7e543abe.tar.bz2 dokka-d0f707af0199a99085dc40693628acbf7e543abe.zip |
Highlight searched phrase
Diffstat (limited to 'plugins/base/src/main/kotlin/renderers')
-rw-r--r-- | plugins/base/src/main/kotlin/renderers/html/HtmlRenderer.kt | 16 |
1 files changed, 3 insertions, 13 deletions
diff --git a/plugins/base/src/main/kotlin/renderers/html/HtmlRenderer.kt b/plugins/base/src/main/kotlin/renderers/html/HtmlRenderer.kt index d25bedb7..548da21c 100644 --- a/plugins/base/src/main/kotlin/renderers/html/HtmlRenderer.kt +++ b/plugins/base/src/main/kotlin/renderers/html/HtmlRenderer.kt @@ -633,21 +633,11 @@ open class HtmlRenderer( .filter { !it.key.isNullOrEmpty() } .groupBy { it.key.substringAfterLast(".") } .entries - .mapIndexed { topLevelIndex, entry -> - if (entry.value.size > 1) { - listOf( - "{\'name\': \'${entry.key}\', \'index\': \'$topLevelIndex\', \'disabled\': true, \'searchKey\':\'${entry.key}\' }" - ) + entry.value.mapIndexed { index, subentry -> - "{\'name\': \'${subentry.value.first}\', \'level\': 1, \'index\': \'$topLevelIndex.$index\', \'description\':\'${subentry.key}\', \'location\':\'${subentry.value.second}\', 'searchKey':'${entry.key}'}" - } - } else { - val subentry = entry.value.single() - listOf( - "{\'name\': \'${subentry.value.first}\', \'index\': \'$topLevelIndex\', \'description\':\'${subentry.key}\', \'location\':\'${subentry.value.second}\', 'searchKey':'${entry.key}'}" - ) + .flatMapIndexed { topLevelIndex, entry -> + entry.value.mapIndexed { index, subentry -> + "{\'name\': \'${subentry.value.first}\', \'description\':\'${subentry.key}\', \'location\':\'${subentry.value.second}\', 'searchKey':'${entry.key}'}" } } - .flatten() .joinToString(prefix = "[", separator = ",\n", postfix = "]") override fun render(root: RootPageNode) { |