In addition to the other examples, I found a simple one in the Spark source itself. The Xpark project is a command-line application for transforming XML using Spark. Louis DeJardin, the creator of Spark, described how Xpark works on his blog.
The relevant code snippets are:
// Create an engine using the templates path as the root location
// as well as the shared location
var engine = new SparkViewEngine
{
DefaultPageBaseType = typeof(SparkView).FullName,
ViewFolder = viewFolder.Append(new SubViewFolder(viewFolder, "Shared"))
};
SparkView view;
// compile and instantiate the template
view = (SparkView)engine.CreateInstance(
new SparkViewDescriptor()
.AddTemplate(templateName));
// render the view to stdout
using (var writer = new StreamWriter(Console.OpenStandardOutput(), Encoding.UTF8))
{
view.RenderView(writer);
}
This was enough to get me pointed in the right direction. But I'll definitely dive into the other examples as well.