From e5a8e842ef264e29166258869fda7623feef964b Mon Sep 17 00:00:00 2001 From: Madeline Hashcube Date: Thu, 6 Aug 2026 13:30:15 -0500 Subject: [PATCH] add a build script --- .gitignore | 1 + build | 23 +++++++++++++++++++++++ flake.nix | 1 + main.typ | 4 ++-- 4 files changed, 27 insertions(+), 2 deletions(-) create mode 100755 build diff --git a/.gitignore b/.gitignore index 92b2793..12135fb 100644 --- a/.gitignore +++ b/.gitignore @@ -1 +1,2 @@ .direnv +out diff --git a/build b/build new file mode 100755 index 0000000..c5afb55 --- /dev/null +++ b/build @@ -0,0 +1,23 @@ +#!/usr/bin/env nu + +def main [ + manifest: string = "@all" + flavor: string = "mocha" +] { + mkdir out + if $manifest == "@all" { + print "Manifest name is set to @all, compiling all manifests" + let manifests = ls manifests/*.yaml | get name | each {|x| $x | parse 'manifests/{name}.yaml' | get name | $in.0 } + for manifest in $manifests { + print $"Compiling ($manifest)..." + typst c main.typ $"out/($manifest){p}.png" --input flavor=$"($flavor)" --input manifest=$"($manifest)" + mv $"out/($manifest)1.png" $"out/($manifest)-vertical.png" + mv $"out/($manifest)2.png" $"out/($manifest)-horizontal.png" + } + } else { + print $"Compiling ($manifest)..." + typst c main.typ $"out/($manifest){p}.png" --input flavor=$"($flavor)" --input manifest=$"($manifest)" + mv $"out/($manifest)1.png" $"out/($manifest)-vertical.png" + mv $"out/($manifest)2.png" $"out/($manifest)-horizontal.png" + } +} diff --git a/flake.nix b/flake.nix index 232553f..8d50be8 100644 --- a/flake.nix +++ b/flake.nix @@ -21,6 +21,7 @@ in { default = pkgs.mkShellNoCC { packages = with pkgs; [ + nushell typst typstPackages.catppuccin ]; }; diff --git a/main.typ b/main.typ index dfd3d1f..f0c80fe 100644 --- a/main.typ +++ b/main.typ @@ -103,8 +103,8 @@ ] ) } -#let data = yaml("asciimplicity.yaml") -#let palette = flavors.mocha.colors +#let data = yaml("manifests/" + sys.inputs.manifest + ".yaml") +#let palette = flavors.at(sys.inputs.flavor).colors #set text(font: "IosevkaHashcube Nerd Font Mono") #vertical(data, palette) #horizontal(data, palette) -- knotmirror 0.0.1