Feature Request - Raw HTML in ddoc comments

Derek Parnell derek at psych.ward
Mon Mar 3 01:17:17 PST 2008


On Mon, 03 Mar 2008 09:30:18 +0100, Roberto Mariottini wrote:


> Ddoc must provide a way to define escaping of characters for every 
> particular output format. I don't know how, but some way must be found.
> 
> Otherwise programmers will stop to write documentation.

I was thinking something along the lines of whenever dmd, while generating
DDoc code, sees *any* punctuation character it automatically converts it
into a DDoc macro for that character. Then then macro expansion can take
care of the 'escape' situation. 

So, if dmd sees ...

   this function turns & into &

it generates ...

   this function turns $(D_AMP)amp$(D_SC) into $(D_AMP)

then uses the 'current' macro set to do the expansion.

So if the current macro set is for HTML we have ...

D_AMP=&
D_SC=;

so the end result is ...

   this function turns & into &


OK, so this means that there are a lot more macros to define, but it should
make it a lot more portable. I'm not sure if it covers all cases but I
think it will cover most.

-- 
Derek Parnell
Melbourne, Australia
skype: derek.j.parnell



More information about the Digitalmars-d mailing list