Skip to content

Commit

Permalink
Nav gen: make task naming clearer
Browse files Browse the repository at this point in the history
  • Loading branch information
Ostrzyciel committed May 14, 2024
1 parent 0d40a1c commit 4592fc4
Showing 1 changed file with 10 additions and 4 deletions.
14 changes: 10 additions & 4 deletions src/main/scala/commands/NavGenCommand.scala
Original file line number Diff line number Diff line change
Expand Up @@ -27,8 +27,14 @@ object NavGenCommand extends Command:

val taskDir = rootDir.resolve("tasks")
val tasks = listDir(rootDir, f"tasks", false)
.collect { case m: YamlMap => m }
.sortBy(_.v.keys.head)
.collect { case m: YamlMap => (
m.v.keys.head,
YamlMap(
getNameForFile(taskDir.resolve(m.v.keys.head + "/index.md"), true),
m.v.values.head
)
) }
.sortBy(_._1)

val profileDir = rootDir.resolve("profiles")
val profiles = listDir(rootDir, f"profiles", false)
Expand All @@ -51,7 +57,7 @@ object NavGenCommand extends Command:
})
.sortBy(m => m.v.keys.head) :+
YamlMap("Benchmark tasks", YamlList(
tasks.filter(_.v.keys.head.startsWith(cDir.getName))
tasks.filter(_._1.startsWith(cDir.getName)).map(_._2)
)) :+
YamlMap("Benchmark profiles", YamlList(
profiles.filter(_.v.keys.head.startsWith(cDir.getName))
Expand Down Expand Up @@ -98,7 +104,7 @@ object NavGenCommand extends Command:
"Documentation",
YamlList(listDir(rootDir, "documentation"))
),
YamlMap("Benchmark categories", YamlList(
YamlMap("Benchmarks", YamlList(
categories
)),
YamlMap("Datasets", YamlList(
Expand Down

0 comments on commit 4592fc4

Please sign in to comment.