From 18ad8bcc99640ad105e647138bdacd8b598a9eaf Mon Sep 17 00:00:00 2001 From: Nathan McCarty Date: Sun, 12 Jan 2025 13:18:57 -0500 Subject: [PATCH] Add support for markdown files as sources --- lib/IUtils.rakumod | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/lib/IUtils.rakumod b/lib/IUtils.rakumod index 007c255..3ec2b99 100644 --- a/lib/IUtils.rakumod +++ b/lib/IUtils.rakumod @@ -122,8 +122,12 @@ sub scan-ipkg(IO::Path:D $ipkg --> PackageInfo:D) { '"' $=[<-["]>*] '"' /) // "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) }