GettEngineering / Prism

Gett's Design System code generator. Use Zeplin Styleguides as your R&D's Single Source of Truth.

Home Page:https://prism.tools

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

Template Loops and last/first line emit

gdelmas opened this issue · comments

Really love the simplicity of the templating language. I was trying to emit some JSON with it, which unfortunately does not allow trailing commas.

For example, this template

{
  {{% FOR color %}}
  "{{% color.identity.camelcase %}}": "{{% color.rgb %}}",
  {{% END color %}}
}

emits

{
  "black": "#000000",
  "white": "#ffffff",
}

So the trailing comma in the penultimate line is a problem. Do you have any idea how this could be solved?

Hey @gdelmas - check out PR #30. It also adds some JSON examples which might be useful for your use case :)