mirror of
https://github.com/apple/pkl.git
synced 2026-07-09 22:52:44 +02:00
[pkl-doc] Sort stdlib first on the main page (#165)
This commit is contained in:
@@ -67,6 +67,14 @@ internal class MainPageGenerator(
|
|||||||
private fun HtmlBlockTag.renderPackages() {
|
private fun HtmlBlockTag.renderPackages() {
|
||||||
if (packagesData.isEmpty()) return
|
if (packagesData.isEmpty()) return
|
||||||
|
|
||||||
|
val sortedPackages =
|
||||||
|
packagesData.sortedWith { pkg1, pkg2 ->
|
||||||
|
when {
|
||||||
|
pkg1.ref.pkg == "pkl" -> -1 // always sort the stdlib first
|
||||||
|
else -> pkg1.ref.pkg.compareTo(pkg2.ref.pkg)
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
div {
|
div {
|
||||||
classes = setOf("member-group")
|
classes = setOf("member-group")
|
||||||
|
|
||||||
@@ -79,7 +87,7 @@ internal class MainPageGenerator(
|
|||||||
}
|
}
|
||||||
|
|
||||||
ul {
|
ul {
|
||||||
for (pkg in packagesData) {
|
for (pkg in sortedPackages) {
|
||||||
val packageScope =
|
val packageScope =
|
||||||
pageScope.packageScopes[pkg.ref.pkg]
|
pageScope.packageScopes[pkg.ref.pkg]
|
||||||
// create scope for previously generated package
|
// create scope for previously generated package
|
||||||
|
|||||||
Reference in New Issue
Block a user