Improving ddoc

Steven Schveighoffer via Digitalmars-d digitalmars-d at puremagic.com
Fri Jan 2 04:32:20 PST 2015


On 1/1/15 4:39 AM, Walter Bright wrote:
> On 1/1/2015 1:19 AM, Andrei Alexandrescu wrote:
>> On 12/31/14 1:12 PM, Dicebot wrote:
>>> I don't feel like any small change in DDOC will make me like/use it.
>>
>> I'm envisioning quite an interesting possibility in which certain
>> constructs are
>> automatically converted to macros:
>>
>> `hello world` --> $(BACKQUOTED hello world)
>> "hello world" --> $(QUOTED hello world)
>> 'hello world' --> $(SQUOTED hello world)
>> _hello world_ --> $(UNDERLINED hello world)
>> *hello world* --> $(STARRED hello world)
>>
>> ... and such. Then generating nice formatting for each of these
>> constructs is
>> achieved by simply defining these macros appropriately.
>
> " and ` naturally come in pairs, but *, _ and ' do not.
>

What about #[{( anything inside here can use markdown )}]#

I'm half joking about the brackets, but some method of saying "in here, 
I permit markdown" would make this both backwards compatible, and not 
inflict too much damage to readability of ddoc.

In fact, if you did something like:

/**[[
    ... comments with markdown
]]*/

or something like this at the beginning of each ddoc comment, it would 
be almost unnoticeable.

I'd also suggest giving a toggling mechanism, something like:

/**
   $(MARKDOWN true/false)
**/

Which allows one to set the default for the enclosed ddocs.

That's my contribution to the project :) I wish I could actually code it...

-Steve


More information about the Digitalmars-d mailing list