How to generate ddoc html?

Pavel Shkadzko p.shkadzko at gmail.com
Wed Jan 29 20:50:14 UTC 2020


I've been skimming through https://dlang.org/spec/ddoc.html in 
order to understand how can one use ddoc to generate nice htmls. 
I tend to use markdown to log some daily work or copy down code 
examples. For learning purposes I wanted to try ddoc for this but 
could not find any information on ddoc.html page on how to 
actually generate the html page. I guessed that dmd should have a 
switch to generate docs and was correct: dmd mylogs.dd -D would 
generate mylogs.html.

I decided to generate the actuall ddoc.html by simply copying its 
contents into a separate file and calling dmd -D on it but the 
generated ddoc.thml file contained only the title and nothing 
else. I was then told on IRC that ddoc.dd lacks files with marco 
definitions. But where are these files? I suspect these are the 
many .ddoc files in https://github.com/dlang/dlang.org root dir:

https://github.com/tastyminerals/dlang.org/blob/master/macros.ddoc
https://github.com/dlang/dlang.org/blob/master/doc.ddoc
https://github.com/tastyminerals/dlang.org/blob/master/errorpage.ddoc

etc.

But how do I link them together then? Do I need to have some 
specific dir structure? I might be wrong but I couldn't find this 
information on ddoc.thml. Maybe the documentation page needs some 
improvement? I could add this information if only I knew how to 
do it in the first place :)


More information about the Digitalmars-d-learn mailing list