Posted Fri, 24 Apr 2015 19:23:31 +0200 in reply to
Lemonfiend
Reply
Am 23.04.2015 um 18:42 schrieb Lemonfiend:
Is there some way to do this:
- if(foo)
.class.true
- else
.class.false
//- close D code indent but keep diet indent
- bar();
- baz();
Instead of this:
- if(foo)
.class.true
- bar();
- baz();
- else
.class.false
- bar();
- baz();
Not directly, but you could avoid redundancies like this:
- string cls = foo ? "true" : "false";
.class(class=cls)
- bar();
- baz();
Or move the nested contents to a separate function (can contain HTML
markup, too):
- function content()
- bar();
- baz();
- if (foo)
.class.true
- content();
- else
.class.false
- content();