AspNetMonsters/pugzor

Execute C# code in pugzor template

Opened this issue · 4 comments

Is there currently anyway to execute c# code in the template similar to how you do it in Razor?

Razor Example
<div>@Datetime.Now</div>

Not C# but you can execute Javascript in the view.

https://pugjs.org/language/code.html

Very doable, "@" has no special meaning in Pug, thus piping the output from the Pug compiler into the Razor viewengine should allow for the csharp code to be executed

My feeling on this is that as soon as we start allowing C# to be run in the templates we're creating a dialect of pug which cannot be used outside of our system. That seems antithetical to the goals of interoperability.

True, that would make it a hybrid Pug/Razor view and not a pure Pug view. But, should that be completely disallowed or the choice given to the user?