Coma icon indicating copy to clipboard operation
Coma copied to clipboard

Add include paths

Open samdeane opened this issue 12 years ago • 1 comments

Add a way to specify other folder locations to use when looking for templates.

Currently included sub-templates are having to use relative paths, which is fine but gets a bit messy. It would be much better if we could specify one or more search paths to use.

Need to check how easy it is to support this in GRMustache, since it is currently doing the finding of the included files for us.

samdeane avatar Jun 19 '13 11:06 samdeane

The GRMustacheTemplateRepositoryDataSource protocol is your friend here: you can implement your custom template loading strategy.

// Configure template repository
GRMustacheTemplateRepository *repo = [[GRMustacheTemplateRepository alloc] init];
MyTemplateDataSource *dataSource = [[MyTemplateDataSource alloc] initWith...];
repo.dataSource = dataSource;

// Extract templates
GRMustacheTemplate *template = [repo templateNamed:... error:...];

groue avatar Apr 25 '14 05:04 groue