Cutout

Cutout


Nuget Coverage Quality Gate Status CD Build Check Markdown

Zero cost 💪 source generated templating for .NET


Why?

When building source generators there is a requirement to generate source code as a string that has indentation managed correctly. The code also needs to be as fast as possible to not impact users in large repositories.

The recommended approach is to use the IndentedTextWriter . This class is simple to use, but is low level.

A standard template engine is a better approach from a code maintenance perspective, but the performance is not as good.

This aims to provide the best of both worlds.

It's a source generator, so can be used in other source generators without incurring a dependency on a template engine, and it lets you use a simplified version of liquid and any type that implements the basic StringBuilder API.