Knotx / knotx

Knot.x is a highly-efficient and scalable integration framework designed to build backend APIs
https://knotx.io
Apache License 2.0
126 stars 26 forks source link

Extend Knot.x Templating Engine by custom tags processing #77

Closed malaskowski closed 8 years ago

malaskowski commented 8 years ago

Custom tags will be placed inside snippet and should be interpreted by Knot.x Templating Engine after Handlebars processing. Inside custom tags developer will put JSON object that describes tag configuration. Custom <knotx> tags should never be rendered in the final page.

Example of custom tags:

  <script data-api-type="templating" 
      data-uri="/service/mock/second.json"
      type="text/x-handlebars-template">
    <knotx:customTag>
      {
        some options...
      }
    </knotx:customTag>
    <h2>Snippet2 - {{message}}</h2>
    <p>Snippet2 - {{body.a}}</p>
    {{#string_equals status "success"}}<p>Success!</p>{{/string_equals}}
  </script>
tomaszmichalak commented 8 years ago

One script tag can contain many different knotx custom tags. One script tag can contain at most one particular knotx custom tag.

What do you think about that implementation simplification?

marcinczeczko commented 8 years ago

Closing as we will go towards different approach