Add support for markdown files as sources

This commit is contained in:
Nathan McCarty 2025-01-12 13:18:57 -05:00
parent 3b8d8a4ecc
commit 18ad8bcc99

View file

@ -122,8 +122,12 @@ sub scan-ipkg(IO::Path:D $ipkg --> PackageInfo:D) {
'"' $<value>=[<-["]>*] '"' /)<value>
// "src";
my sub is-source(Str:D $file --> Bool) {
return $file.ends-with(".idr") || $file.ends-with(".md");
}
my IO::Path:D @sources =
paths($ipkg.parent.add($src-dir), :file(*.ends-with(".idr"))).map(*.IO);
paths($ipkg.parent.add($src-dir), :file(&is-source)).map(*.IO);
PackageInfo.new(ipkg => $ipkg, root => $ipkg.parent, sources => @sources)
}