Skip to content

Instantly share code, notes, and snippets.

@elfalem
elfalem / StacheTemplateCompiler.cs
Last active January 29, 2021 14:58
Alternative view engine for ASP.NET Core Part IV
using System;
using System.Collections.Generic;
using System.IO;
using System.Linq;
using System.Reflection;
using System.Text;
using Microsoft.CodeAnalysis;
using Microsoft.CodeAnalysis.CSharp;
namespace foo.Stache
@elfalem
elfalem / StacheTemplateCompiler.cs
Created May 1, 2020 15:53
Alternative view engine for ASP.NET Core Part III
using System;
using System.Collections.Generic;
using System.IO;
using System.Linq;
using System.Reflection;
using System.Text;
using Microsoft.CodeAnalysis;
using Microsoft.CodeAnalysis.CSharp;
namespace foo.Stache
@elfalem
elfalem / StacheParser.cs
Created September 23, 2019 20:36
Alternative view engine for ASP.NET Core: Parsing template syntax
using System.Collections.Generic;
using System.Linq;
using Superpower;
using Superpower.Parsers;
using Superpower.Tokenizers;
namespace foo.Stache
{
public enum Tokens
{
@elfalem
elfalem / StacheView.cs
Created August 8, 2019 21:47
Stache View Engine
using System.IO;
using System.Threading.Tasks;
using Microsoft.AspNetCore.Mvc.Rendering;
using Microsoft.AspNetCore.Mvc.ViewEngines;
namespace foo.Stache{
public class StacheView : IView
{
public StacheView(string path){
Path = path;