abap_mustache icon indicating copy to clipboard operation
abap_mustache copied to clipboard

Various New Features

Open DerGuteWolf opened this issue 4 years ago • 1 comments

  • Support inverted section for list (as per https://mustache.github.io/mustache.5.html "That is, they will be rendered if the key doesn't exist, is false, or is an empty list.") to make this possible: {{#sizes}}{{size}},{{/sizes}}{{^sizes}}all sold out{{/sizes}}
  • Support @first and @last like eg https://github.com/samskivert/jmustache to make this possible: {{#sizes}}{{^@first}}, {{/@first}}{{size}}{{#@last}}.{{/@last}}{{/sizes}}
  • Render a date, time or timestamp (short or long) variable as either raw, ISO, user or environment formatted (cf. cl_abap_format=>d*, cl_abap_format=>t*, cl_abap_format=>ts*), be able to supply a timezone for timestamp formatting
  • Offer formatting options currency,zero,sign and decimals for numeric fields and use raw, user or environment format (cf. cl_abap_format=>n*)
  • Offer formatting options width,align, alpha and pad for non-numeric fields
  • Formatting options are added with # and = to the variable name, eg number#decimals=1#sign=RIGHTPLUS or string#align=CENTER#WIDTH=5#PAD=x

DerGuteWolf avatar Mar 13 '21 16:03 DerGuteWolf

As a followup after #9, could I kindly ask you to add some docs for the content of #9 when you have some time ? The features are cool but not obvious, docs could help

sbcgua avatar Jun 01 '21 07:06 sbcgua