diff options
author | ilya-g <ilya.gorbunov@jetbrains.com> | 2023-02-17 16:42:28 +0100 |
---|---|---|
committer | GitHub <noreply@github.com> | 2023-02-17 16:42:28 +0100 |
commit | 1fd045904e94d68878b3a5f748bf20f7c61a1cf7 (patch) | |
tree | 6e5e63033f654abc4e5c61278a4eeb39330977be /plugins/base/src/main/kotlin/utils | |
parent | daed35f92b3b482688856d139da6849c8e6b4ab1 (diff) | |
download | dokka-1fd045904e94d68878b3a5f748bf20f7c61a1cf7.tar.gz dokka-1fd045904e94d68878b3a5f748bf20f7c61a1cf7.tar.bz2 dokka-1fd045904e94d68878b3a5f748bf20f7c61a1cf7.zip |
Consistent alphabetical order of element groups in index and navigation (#2861)
* Sort groups of divergent elements by their key first ignoring case, then preserving it
* Add tests for sorting groups and navigation
Diffstat (limited to 'plugins/base/src/main/kotlin/utils')
-rw-r--r-- | plugins/base/src/main/kotlin/utils/alphabeticalOrder.kt | 7 |
1 files changed, 7 insertions, 0 deletions
diff --git a/plugins/base/src/main/kotlin/utils/alphabeticalOrder.kt b/plugins/base/src/main/kotlin/utils/alphabeticalOrder.kt new file mode 100644 index 00000000..68b9cde8 --- /dev/null +++ b/plugins/base/src/main/kotlin/utils/alphabeticalOrder.kt @@ -0,0 +1,7 @@ +package org.jetbrains.dokka.base.utils + + +/** + * Canonical alphabetical order to sort named elements + */ +internal val canonicalAlphabeticalOrder: Comparator<in String> = String.CASE_INSENSITIVE_ORDER.thenBy { it }
\ No newline at end of file |