You can use the right_pad
builtin.
#define ${name?right_pad(30)} (${value})
See the doc here.
Question
I'm doing some simple C code generation using Freemarker. I am generating a line like the following:
#define MY_CONSTANT (0)
From a template of the form:
#define ${name} (${value})
I am generating a bunch of these and I want them to come out like this
#define MY_CONSTANT (0)
#define MY_NEW_CONSTANT (42)
#define MY_OTHER_CONSTANT (101)
With the values all column aligned. Is there an easy way to do this? Do I need to write a directive for it?
Thanks in advance.
Solution