Skip to content

Conversation

Drup
Copy link
Member

@Drup Drup commented Apr 18, 2016

This is WIP.

open Tyxml

let%template f ={|
Hello {{name}}, You are {{{desc}}}
{{#list}}
  <b>{{foo}}</b> {{name}}
{{/list}}
{{^list}}
  No foos :(
{{/list}}
|}

val f :
  name:bytes ->
  list:< foo : bytes; .. > list ->
  desc:([> `B | `PCDATA ] as 'a) Tyxml_html.elt list ->
  'a Tyxml_html.elt list

Current issues:

  • Locations are completely lost (because of the mustache implementation)
  • Nesting is untested
  • Can't specify a name relative to the current context. Names are always resolved from the top context.

@aantron
Copy link
Contributor

aantron commented Apr 19, 2016

I think this is (potentially) a great idea, but I don't think TyXML should offer two PPXs as in the attached commits. Ideally, there would be "one great TyXML PPX" that offers this and whatever other features. Otherwise, we are likely to confuse new users and make them anxious about going down the wrong path with their code.

@Drup
Copy link
Member Author

Drup commented Apr 16, 2018

If people want this to happen, please voice your opinion on the choice of the templating language in https://discuss.ocaml.org/t/choice-of-template-language-for-tyxml/1863 .

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants