Exemple #1
0
        static async Task Main(string[] args)
        {
            /*
             * Runs template compilation and saves compiled html page to output directory
             */

            var templatePath    = Path.Combine(Directory.GetCurrentDirectory(), "levis-template.hbs");
            var outputPath      = Path.Combine(Directory.GetCurrentDirectory(), "levis-invoice.html");
            var templateContent = await File.ReadAllTextAsync(templatePath);

            LevisCompiler.RegisteHelpers();
            var compiledHtml = LevisCompiler.Compile(templateContent);
            await File.WriteAllTextAsync(outputPath, compiledHtml);

            // to run benchmarks uncomment
            // var summary = BenchmarkRunner.Run(typeof(Program).Assembly);
        }
Exemple #2
0
 public string Compile() => LevisCompiler.Compile(_templateContent);
Exemple #3
0
 public void Setup()
 {
     _templateContent = File.ReadAllText(TemplatePath);
     LevisCompiler.RegisteHelpers();
 }