Execute C# code in pugzor template
Opened this issue · 4 comments
drewlsvern commented
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>
dpaquette commented
Not C# but you can execute Javascript in the view.
mavanmanen commented
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
stimms commented
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.
mavanmanen commented
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?