Open kevinferrare opened 5 months ago
I'm not sure how it would be achieved unless there is a hook I can use for resolving.
Maybe that's not what you meant but it looks like you need to hook an TemplateLoader that provides the include text https://github.com/scriban/scriban/blob/38df14946721238d2f4badc7c0b6e8a1c594e23c/doc/runtime.md#include-and-itemplateloader
I can see from my limited understanding of your code that you create a TemplateContext here https://github.com/mrpmorris/Morris.Moxy/blob/c75846112f83b2d8b5335fb25d9163d9153984ba/Source/Lib/Morris.Moxy/SourceGenerators/ClassSourceGenerator.cs#L125
Maybe a custom loader that would try to find the include file from the current directory of the compiledTemplate object would work for most cases?
I saw that moxy is based on scriban (https://github.com/scriban/scriban)
I tried to use the include function to be able to factorize stuff between my templates. Unfortunately this isnt working: