Skip to content
This repository has been archived by the owner on Jan 30, 2024. It is now read-only.

Template Loops and last/first line emit #27

Closed
gdelmas opened this issue May 24, 2020 · 1 comment · Fixed by #30
Closed

Template Loops and last/first line emit #27

gdelmas opened this issue May 24, 2020 · 1 comment · Fixed by #30

Comments

@gdelmas
Copy link

gdelmas commented May 24, 2020

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?

@freak4pc
Copy link
Contributor

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

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

Successfully merging a pull request may close this issue.

2 participants