www.digitalmars.com         C & C++   DMDScript  

digitalmars.D.learn - How to generate ddoc html?

reply Pavel Shkadzko <p.shkadzko gmail.com> writes:
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 :)
Jan 29 2020
next sibling parent aberba <karabutaworld gmail.com> writes:
On Wednesday, 29 January 2020 at 20:50:14 UTC, Pavel Shkadzko 
wrote:
 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.

 [...]
Yeah, I figured the ddoc documentation doesn't help much with this. And its true we need to document that part.
Jul 18 2020
prev sibling parent aberba <karabutaworld gmail.com> writes:
On Wednesday, 29 January 2020 at 20:50:14 UTC, Pavel Shkadzko 
wrote:
 I've been skimming through https://dlang.org/spec/ddoc.html in 
 order to understand how can one use ddoc to generate nice 
 htmls. [...]
This post contains information on how to do that. https://dlang.org/blog/2017/03/08/editable-and-runnable-doc-examples-on-dlang-org/
Jul 18 2020