Skip to content

Commit

Permalink
Nav gen: update schema doc structure
Browse files Browse the repository at this point in the history
  • Loading branch information
Ostrzyciel committed May 15, 2024
1 parent 4592fc4 commit a605a4d
Showing 1 changed file with 6 additions and 15 deletions.
21 changes: 6 additions & 15 deletions src/main/scala/commands/NavGenCommand.scala
Original file line number Diff line number Diff line change
Expand Up @@ -74,24 +74,15 @@ object NavGenCommand extends Command:
.toSeq

val schemaNames = Map(
"documentation" -> "Documentation ontology",
"metadata" -> "Metadata ontology",
"theme" -> "Topic scheme (deprecated)",
"documentation.md" -> "Documentation ontology",
"metadata.md" -> "Metadata ontology",
)
val schemaDir = rootDir.resolve("schema")
val schemas = schemaDir.toFile.listFiles()
.filter(_.isDirectory)
.map(pDir => YamlMap(
schemaNames.getOrElse(pDir.getName, pDir.getName),
YamlList(
YamlMap("Development version", f"schema/${pDir.getName}/dev.md") +:
listDir(rootDir, f"schema/${pDir.getName}", false)
.filter(v => v.isInstanceOf[YamlMap])
.map(_.asInstanceOf[YamlMap])
.filter(_.v.keys.head != "dev")
.sortBy(m => Version.parse(m.v.keys.head))
.reverse
)
.filter(f => f.isFile && f.getName != "index.md" && f.getName.endsWith(".md"))
.map(pFile => YamlMap(
schemaNames.getOrElse(pFile.getName, pFile.getName),
f"schema/${pFile.getName}"
))
.sortBy(_.v.keys.head)
.toSeq
Expand Down

0 comments on commit a605a4d

Please sign in to comment.