Jump to page: 1 2 3
Thread overview
The ugly truth about ddoc
Jan 19, 2015
Adam D. Ruppe
Jan 19, 2015
Meta
Jan 19, 2015
Meta
Jan 20, 2015
Meta
Jan 19, 2015
Mike
Jan 19, 2015
Mike
Jan 19, 2015
Walter Bright
Jan 19, 2015
MattCoder
Jan 19, 2015
MattCoder
Jan 20, 2015
Vladimir Panteleev
Jan 20, 2015
Phil
Jan 19, 2015
Jonas Drewsen
Jan 19, 2015
Ary Borenszweig
Jan 19, 2015
Jacob Carlborg
Jan 19, 2015
tcak
Jan 19, 2015
Ali Çehreli
Jan 19, 2015
Jacob Carlborg
January 19, 2015
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. Indeed there are a number of CSS editors that features things like variables, substitutions, and code generations, but most come at a cost and require quite some involvement.

So I slapped something much simpler together using... ddoc.

1. I aded this at the top of the original file:

Ddoc

and then this at the bottom:

Macros:

DDOC=$(BODY)
DDOC_COMMENT=/*$0*/
ESCAPES=/</</ />/>/ /&/&/

then saved the file as cssmenu.css.dd. Now I suddenly had a file compilable with ddoc, which produced itself (sans the heading and the macros). Here's the cmdline:

dmd -c -o- -Dfweb/css/cssmenu.css css/cssmenu.css.dd

It's a bit of a bummer that I need to define three unintuitive macros to get idempotent generation, but I guess that's that. We should document that somewhere.

2. Now the fun begins. Now with macros I could define things like variables and even functions, and change all by changing one. Cool! So I started looking for all colors in the document and converted them to macros.

After a short time I had http://paste.ofcode.org/3agBQ3t6C3UJsqMfRe4GeQL working. With that in hand, it was trivially easy to test different colors and see how they impact the look.

The result is as I mentioned at http://erdani.com/d. I trust you'll hate the colors but maybe not the hack.

So, may I add a pull request of this without anyone having an apoplexy attack? When we pass the site for styling we can pass the generated css.


Andrei
January 19, 2015
On Monday, 19 January 2015 at 02:18:32 UTC, Andrei Alexandrescu wrote:
> I'm sure experts must have tools for allowing things like variables and macros for css creation.

My css macro expander (http://code.dlang.org/packages/cssexpand) was in part inspired by ddoc actually, so this is no surprise to me...

My only real complaint about the ddoc site is that the build process is pure evil.
January 19, 2015
On 1/18/2015 6: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.

Nobody likes my taste in color, so I'll not pass judgement!


> ==================
>
> 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. Indeed there are a number of CSS editors that features things
> like variables, substitutions, and code generations, but most come at a cost and
> require quite some involvement.
>
> So I slapped something much simpler together using... ddoc.
>
> 1. I aded this at the top of the original file:
>
> Ddoc
>
> and then this at the bottom:
>
> Macros:
>
> DDOC=$(BODY)
> DDOC_COMMENT=/*$0*/
> ESCAPES=/</</ />/>/ /&/&/
>
> then saved the file as cssmenu.css.dd. Now I suddenly had a file compilable with
> ddoc, which produced itself (sans the heading and the macros). Here's the cmdline:
>
> dmd -c -o- -Dfweb/css/cssmenu.css css/cssmenu.css.dd
>
> It's a bit of a bummer that I need to define three unintuitive macros to get
> idempotent generation, but I guess that's that. We should document that somewhere.

Yes, very nice.


> 2. Now the fun begins. Now with macros I could define things like variables and
> even functions, and change all by changing one. Cool! So I started looking for
> all colors in the document and converted them to macros.
>
> After a short time I had http://paste.ofcode.org/3agBQ3t6C3UJsqMfRe4GeQL
> working. With that in hand, it was trivially easy to test different colors and
> see how they impact the look.
>
> The result is as I mentioned at http://erdani.com/d. I trust you'll hate the
> colors but maybe not the hack.

Consider me meh on the colors but love the hack!


> So, may I add a pull request of this without anyone having an apoplexy attack?
> When we pass the site for styling we can pass the generated css.

Damn the torpedos, full speed ahead!

January 19, 2015
On Monday, 19 January 2015 at 02:25:23 UTC, Adam D. Ruppe wrote:
> On Monday, 19 January 2015 at 02:18:32 UTC, Andrei Alexandrescu wrote:
>> I'm sure experts must have tools for allowing things like variables and macros for css creation.
>
> My css macro expander (http://code.dlang.org/packages/cssexpand) was in part inspired by ddoc actually, so this is no surprise to me...
>
> My only real complaint about the ddoc site is that the build process is pure evil.

I can second that. I haven't tried in the past week, but I've been unable to build the site, stopping the doc pulls I wanted to make in their tracks.
January 19, 2015
On 1/18/15 6:25 PM, Adam D. Ruppe wrote:
> On Monday, 19 January 2015 at 02:18:32 UTC, Andrei Alexandrescu wrote:
>> I'm sure experts must have tools for allowing things like variables
>> and macros for css creation.
>
> My css macro expander (http://code.dlang.org/packages/cssexpand) was in
> part inspired by ddoc actually, so this is no surprise to me...

Awesome.

> My only real complaint about the ddoc site is that the build process is
> pure evil.

Let's angelize it. Speak up. What's the matter?


Andrei
January 19, 2015
On 1/18/15 6:32 PM, Meta wrote:
> On Monday, 19 January 2015 at 02:25:23 UTC, Adam D. Ruppe wrote:
>> On Monday, 19 January 2015 at 02:18:32 UTC, Andrei Alexandrescu wrote:
>>> I'm sure experts must have tools for allowing things like variables
>>> and macros for css creation.
>>
>> My css macro expander (http://code.dlang.org/packages/cssexpand) was
>> in part inspired by ddoc actually, so this is no surprise to me...
>>
>> My only real complaint about the ddoc site is that the build process
>> is pure evil.
>
> I can second that. I haven't tried in the past week, but I've been
> unable to build the site, stopping the doc pulls I wanted to make in
> their tracks.

Destroy!!! What's not working? -- Andrei
January 19, 2015
On Monday, 19 January 2015 at 02:18:32 UTC, 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.

Well I'd prefer less red-ish: http://i.imgur.com/AIvcoWl.png

But you know this is a personal thing, and if you looking for martian aspect so you're ok. Anyway this menu is better than your previous one. :)

Matheus.
January 19, 2015
On Monday, 19 January 2015 at 02:36:35 UTC, Andrei Alexandrescu wrote:
> On 1/18/15 6:32 PM, Meta wrote:
>> On Monday, 19 January 2015 at 02:25:23 UTC, Adam D. Ruppe wrote:
>>> On Monday, 19 January 2015 at 02:18:32 UTC, Andrei Alexandrescu wrote:
>>>> I'm sure experts must have tools for allowing things like variables
>>>> and macros for css creation.
>>>
>>> My css macro expander (http://code.dlang.org/packages/cssexpand) was
>>> in part inspired by ddoc actually, so this is no surprise to me...
>>>
>>> My only real complaint about the ddoc site is that the build process
>>> is pure evil.
>>
>> I can second that. I haven't tried in the past week, but I've been
>> unable to build the site, stopping the doc pulls I wanted to make in
>> their tracks.
>
> Destroy!!! What's not working? -- Andrei

It's late now, but I'll try building tomorrow and see what doesn't work.
January 19, 2015
On Monday, 19 January 2015 at 02:36:35 UTC, Andrei Alexandrescu wrote:

>>> My only real complaint about the ddoc site is that the build process
>>> is pure evil.
>>
>> I can second that. I haven't tried in the past week, but I've been
>> unable to build the site, stopping the doc pulls I wanted to make in
>> their tracks.
>
> Destroy!!! What's not working? -- Andrei

For starters, simple, accurate instructions in dlang.org's Readme.md file.

Mike
January 19, 2015
On 1/18/15 6:43 PM, MattCoder wrote:
> On Monday, 19 January 2015 at 02:18:32 UTC, 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.
>
> Well I'd prefer less red-ish: http://i.imgur.com/AIvcoWl.png
>
> But you know this is a personal thing, and if you looking for martian
> aspect so you're ok. Anyway this menu is better than your previous one. :)

No personal aspect to this. What hex colors did you use? -- Andrei

« First   ‹ Prev
1 2 3