The ugly truth about ddoc

Andrei Alexandrescu via Digitalmars-d digitalmars-d at puremagic.com
Sun Jan 18 19:17:00 PST 2015


On 1/18/15 7:12 PM, Ary Borenszweig wrote:
> On 1/18/15 11:18 PM, Andrei Alexandrescu wrote:
>> TL;DR: I've uploaded new menu colors at http://erdani.com/d/, this time
>> aiming for a more martian red ethos. Please let me know.
>>
>> ==================
>>
>> So I was looking at the css today (original at
>> http://paste.ofcode.org/fHGT24YASrWu3rnMYLdm4C taken from the zip at
>> http://cssmenumaker.com/menu/modern-jquery-accordion-menu) and it was
>> quite unwieldy to experiment with. For example, the same color appears
>> hardcoded in a number of places; whenever changing one I'd need to
>> change all, or miss some important instances (as it happened with my
>> first experiment).
>>
>> I'm sure experts must have tools for allowing things like variables and
>> macros for css creation.
>
> Sass (http://sass-lang.com/) and Less (http://lesscss.org/) comes to my
> mind. Any decent web framework comes with support for them.

Yah. The ones I found were paid. My point is ddoc was there and fit the 
job perfectly well.

> I think you will eventually find that ddoc is turing-complete and will
> implement one of the above transpilers in it.

It's not, but irony gotten :o).

> And css minification isn't just about gzip. It's also about removing
> whitespace and compacting stuff. Can you code a ddoc macro for that?

This is a confusion - css minification is a separate topic altogether; I 
got to it as a drive-by optimization and many people here thought I need 
to spend the next quarter on traffic improvements.

To answer: it is not possible to do that with ddoc macros.


Andrei



More information about the Digitalmars-d mailing list