$?FILE.IO.sibling(‘Templates’) ?

> On 16 Oct 2018, at 10:33, Richard Hainsworth <rnhainswo...@gmail.com> wrote:
> 
> Hi.
> 
> Haven't been able to work this one out from the documentation. There must be 
> a simple answer.
> 
> I am developing a module that renders stuff into HTML.
> 
> The module uses mustache templates for most of the HTML boilerplate. I have 
> default templates, but I want to allow the user to be able to over-ride the 
> templates and supply his/her own.
> 
> Suppose the repo directory structure is
> 
> lib/Module/myModule.pm6
> 
> lib/Module/Templates/main.mustache
> 
> 
> and the main exported function is defined as
> 
> sub render($stuff-to-be-rendered, Str :$template-dir = '?????' ) {
> 
> die 'no templates' unless "$template-dir/main.mustache".IO ~~ :f;
> 
> ...
> 
> }
> 
> What do I put in place of ???? in order for the default to refer to 
> Module/Templates?
> 
> Thanks in advance.
> 
> Richard

Reply via email to