-
Notifications
You must be signed in to change notification settings - Fork 0
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Choose a dotnet HTML templating library (other than DotLiquid?) #1
Comments
fluid's author comments about DotLiquid here,
|
JSON input is technically possible with DotLiquid, but it takes a lot of code: dotliquid/dotliquid#223 (comment) and dotliquid/dotliquid#299 (comment) - but it doesn't work reliably dotliquid/dotliquid#417 |
I should try sebastienros/fluid#292 on Monday. |
FTR fluid requires the following to enable Json support, but it doesn't work in new master, and might need fixing: let enableJson(opts: TemplateOptions) =
opts.MemberAccessStrategy.Register<JObject, JToken>(
System.Func<JObject, string, JToken>(fun src name -> src.GetValue(name))
)
opts.ValueConverters.Add(fun x ->
match x with
| :? JObject as o ->
x
| _ -> null)
opts.ValueConverters.Add(fun x ->
match x with
| :? JValue as v ->
v.Value
| _ -> null) The JSON criteria has become much less important right now (because type-safety is a good thing in template variables) though, so I'll go ahead without working JSON support. The switch to fluid is good anyway due to performance benefits and active development. |
DotLiquid (current choice) doesn't work well with arbitrary JSON input, and seems to require fiddling with advanced non-F# language features like ExpandoObject.
dotliquid/dotliquid#299 (comment)
decision matrix
legend:
The text was updated successfully, but these errors were encountered: