Style and tricks
Horizontal ellipsis (…
and …
)
Three dots (…
) are automatically transformed into …
. You can also put …
directly in your mixins.
Capitalization is not automatic after …
because it is not systematic:
The first word after an ellipsis is capitalized if it begins a new grammatical sentence.
When assembling, knowing which elements are empty
When you list elements, it is sometimes (but very rarely) useful to be able to know which elements are empty and which are not.
The list of the non empty elements:
-
is sent to separators, when they are mixins and take an object parameter (see exemple)
-
is made available in
listInfo.nonEmpty
in theitemz > item
structure
will output either first, second and also third or first and second depending on WITH_3
flag.
-
When in a a
eachz
structure, elements are objects, while when in anitemz > item
structure, elements are integers. -
When you read
listInfo.nonEmpty
orparams.nonEmpty
, it can beundefined
: this happens when RosaeNLG is actually testing if the elements are empty or not. RosaeNLG will make a second call withxxx.nonEmpty
properly populated. Thus just test and ignore ifundefined
.