Closed Emailsbi closed 1 year ago
i met the same question
Your question is more of a SwiftGen question (in your specific case).
Your extra lines are getting removed, because SwiftGen has a workaround for issues with whitespace control in Stencil, see here for the workaround: https://github.com/SwiftGen/StencilSwiftKit/blob/stable/Sources/StencilSwiftKit/StencilSwiftTemplate.swift
Luckily, we've finally merged the equivalent of Jinja whitespace control into Stencil, and'll release it soon, so it'll be available in SwiftGen as well afterwards 🎉
Hi,
I'm trying to make output properly formatted and the only thing that is missing now is newlines. I've tried just inserting newlines in stencil file by pressing enter, tried specifying \n or "\n", tried passing newline symbol via params. Nothing works, Stencil just erases them.
Here is the example of a modified macro I'm using from SwiftGen (inside of two "if not forloop.first") Thanks