Feature Request - Raw HTML in ddoc comments

Derek Parnell derek at psych.ward
Sat Mar 1 14:30:53 PST 2008


On Sat, 01 Mar 2008 17:04:30 -0500, Ty Tower wrote:

> l
>>> OK so how can the pages be easly extracted into html form?
>>> Do you have a program or application to do this automatically?
>> 
>> Yes I do, its called DMD.
>> 
>> -- 
>> Derek Parnell
>> Melbourne, Australia
>> skype: derek.j.parnell
> 
> Would you care to elaborate on this ,  dmd  is the compiler -how does it run ddoc?

Sure. DMD is the compiler, no doubt about that. However, inside the
compiler is a DDoc processor as well. Try this out ...

Create two text files. The first one "testmac.ddoc" contains macro
definitions ...

//----

DDOC=**Start of document**
$(DDOC_HEAD)
$(DDOC_BODY)
**End of document**
DDOC_HEAD=**Note : Generated by a test macro set**
DDOC_BODY=$(BODY)
SECTION=**SECTION: "$0" **
I=**ITALIC"$0"**


and the second one "testmac.d" contains the document ...

Ddoc
$(SECTION Introduction)
In this section I'd like to introduce the next section.
$(SECTION Acknowledgements)
I'd like to thank my $(I parents) and $(I Walter Bright).
$(SECTION Epilogue)
And in conclusion, goodnight.

Then generate the document with the command line ...

dmd testmac.ddoc testmac.d -Dftestmac.txt


The resulting document will be in "testmac.txt" file. And it should look
like ...


**Start of document**
**Note : Generated by a test macro set**
<!-- Generated by Ddoc from testmac.d -->

**SECTION: "Introduction" **
In this section I'd like to introduce the next section.
**SECTION: "Acknowledgements" **
I'd like to thank my **ITALIC"parents"** and **ITALIC"Walter Bright"**.
**SECTION: "Epilogue" **
And in conclusion, goodnight.

**End of document**


Note! NO HTML AT ALL.
-- 
Derek Parnell
Melbourne, Australia
skype: derek.j.parnell



More information about the Digitalmars-d mailing list