nu-modules/img.nu

11 lines
327 B
Plaintext

def comp-to-png [] {
glob *.pdf | each { |x| $x | path relative-to $"(pwd)" }
}
# convert (a pdf) to png
export def "to png" [pattern:string@comp-to-png] {
glob $pattern | each {|pdf|
let dest = ($pdf | path parse | update extension png | path join)
^convert -density 300 $pdf $dest
$dest
}
}