mustache-sharp icon indicating copy to clipboard operation
mustache-sharp copied to clipboard

ConditionTagDefinition

Open PaulGrimshaw opened this issue 8 years ago • 2 comments

Could we make this class public? It is a useful one to be able to inherit from and add as a custom tag (have tested successfully)

PaulGrimshaw avatar Dec 14 '16 19:12 PaulGrimshaw

I've done my own #compare (like #if but with operators).

#compare @index 'eq' 0 // Will be true if current index EQuals 0 #compare @index 'ne' 0 // Will be true if current index is Not Equal to 0 #compare @index 'factor' 2 // Will be true if current index is evenly divided by 2 #compare @index 'gt' 0 // Will be true if current index greater than 0 #compare @index 'ge' 1 // Will be true if current index greater than or equal to 1 #compare @index 'lt' 10 // Will be true if current index less than 10 #compare @index 'le' 9 // Will be true if current index less than or equal to 9

Only had to reproduce a minimal amount of code from ConditionTag into it but I agree. If I could have inherited ConditionTagDefinition it'd be cleaner.

oscaruribe avatar Feb 08 '17 12:02 oscaruribe

Can u please give me a complete example , how you create ur own #compare tag. i also need to do this type of work.

ranaadeel0300 avatar Sep 22 '21 15:09 ranaadeel0300