www.digitalmars.com         C & C++   DMDScript  

digitalmars.D.learn - Ddoc

reply "sg" <none none.com> writes:
I have looked at http://dlang.org/ddoc.html and 
http://qznc.github.io/d-tut/documentation.html and have some idea 
about how to write the text that will eventually become the 
document.  But I have no clue as to go from the input file with 
Ddoc comments to the final document.  I am on Windows 7, 64 bit;  
I have not installed anything related to the D Programming 
Language yet.  I usually develop in C/C++ and my present interest 
is in commenting C/C++ code with Ddoc comments and ending up with 
the documentation.  So what do I need to install and where can I 
find an example of generating documentation for a hello world 
program?
Jan 23 2014
parent reply "Rikki Cattermole" <alphaglosined gmail.com> writes:
On Thursday, 23 January 2014 at 13:57:43 UTC, sg wrote:
 I have looked at http://dlang.org/ddoc.html and 
 http://qznc.github.io/d-tut/documentation.html and have some 
 idea about how to write the text that will eventually become 
 the document.  But I have no clue as to go from the input file 
 with Ddoc comments to the final document.  I am on Windows 7, 
 64 bit;  I have not installed anything related to the D 
 Programming Language yet.  I usually develop in C/C++ and my 
 present interest is in commenting C/C++ code with Ddoc comments 
 and ending up with the documentation.  So what do I need to 
 install and where can I find an example of generating 
 documentation for a hello world program?
Ddoc itself is provided as part of the D compiler. For usage with D source code. There is no form of preprocessor to my knowledge that you could utilise. Its too heavily tied into D's frontend to be usable from other languages. At this point I don't think you can get the power of Ddoc without using D itself.
Jan 23 2014
parent reply "sg" <none none.com> writes:
On Thursday, 23 January 2014 at 14:25:41 UTC, Rikki Cattermole 
wrote:
 On Thursday, 23 January 2014 at 13:57:43 UTC, sg wrote:

 Ddoc itself is provided as part of the D compiler. For usage 
 with D source code.
Following is from http://dlang.org/ddoc.html Using Ddoc for other Documentation Ddoc is primarily designed for use in producing documentation from embedded comments. It can also, however, be used for processing other general documentation. The reason for doing this would be to take advantage of the macro capability of Ddoc and the D code syntax highlighting capability. If the .d source file starts with the string "Ddoc" then it is treated as general purpose documentation, not as a D code source file. ... Much of the D documentation itself is generated this way, including this page. Such documentation is marked at the bottom as being generated by Ddoc.
Jan 23 2014
parent "Rikki Cattermole" <alphaglosined gmail.com> writes:
On Thursday, 23 January 2014 at 15:00:17 UTC, sg wrote:
 On Thursday, 23 January 2014 at 14:25:41 UTC, Rikki Cattermole 
 wrote:
 On Thursday, 23 January 2014 at 13:57:43 UTC, sg wrote:

 Ddoc itself is provided as part of the D compiler. For usage 
 with D source code.
Following is from http://dlang.org/ddoc.html Using Ddoc for other Documentation Ddoc is primarily designed for use in producing documentation from embedded comments. It can also, however, be used for processing other general documentation. The reason for doing this would be to take advantage of the macro capability of Ddoc and the D code syntax highlighting capability. If the .d source file starts with the string "Ddoc" then it is treated as general purpose documentation, not as a D code source file. ... Much of the D documentation itself is generated this way, including this page. Such documentation is marked at the bottom as being generated by Ddoc.
Yes, but it requires the source file to have the extension of d as listed in the quote you gave. It may be possible to rig it to do what you want. But you'll loose all the niceness e.g. function parameter grabbing. This may be a good use case for an enhancement to the front end, to provide what you want.
Jan 23 2014