1
Fork 0
mirror of https://github.com/RGBCube/ThemeNix synced 2025-07-28 00:47:44 +00:00

Add templates & a slug attribute to themes

This commit is contained in:
RGBCube 2023-11-26 19:32:29 +03:00
parent 813ba52ead
commit d8ed419eff
No known key found for this signature in database
256 changed files with 835 additions and 4 deletions

View file

@ -24,6 +24,7 @@ def theme-to-nix [
} else {
$line
| str replace "scheme" "name "
| str replace "slug" "slug "
| str replace '"' ""
| str replace '"' ""
| str replace ":" " ="
@ -60,11 +61,11 @@ def main [] {
ls base16-schemes
| filter { ($in.name | str ends-with ".yml") or ($in.name | str ends-with ".yaml") }
| each { |it|
let new_path = "themes/" + ($it.name | path basename | split row "." | first) + ".nix"
let new_path = "themes/" + ($it.name | path basename | split row "." | first)
echo $"converting ($it.name) to ($new_path)..."
theme-to-nix (open $it.name) | save --force $new_path
theme-to-nix ({ slug: ($new_path | split row "/" | last) } | merge (open $it.name)) | save --force ($new_path + ".nix")
}
generate-valid-themes