develooper Front page | perl.perl6.users | Postings from October 2018

Default directory for files

Thread Next
From:
Richard Hainsworth
Date:
October 16, 2018 08:33
Subject:
Default directory for files
Message ID:
d93bd08b-e8eb-74d1-c36f-d919482c035a@gmail.com
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

Thread Next


nntp.perl.org: Perl Programming lists via nntp and http.
Comments to Ask Bjørn Hansen at ask@perl.org | Group listing | About