Ddoc

Ddoc is a compiler-embedded documentation generator and associated syntax, for the D programming language, designed by Walter Bright. Its emphasis is on being able to write documentation in code comments in a natural style, minimizing the need for embedded markup and thus improving the legibility of the code comments. It is similar in concept to Doxygen and Javadoc.

Code comments are associated with symbols in the code, and Ddoc uses the semantic and syntactic information available from the D compiler to fill in routine information such as parameters and return types automatically.

The code comments and symbol table information are processed by Ddoc into an internal structured format. Each of these structures corresponds to a template expressed as a macro. The template macros convert the structured format into another set of macros that express the markup. The latter set of markup macros are expanded to produce, by default, HTML.

Both the template macros and the markup macros can be overridden by the user, and can be applied via external files analogous to HTML style sheets. The template macros can be changed to customize the high level formatting, and the markup macros can be altered to produce other output forms such as XML and XHTML.

Compiler options

Several compiler options are available to cause the dmd D compiler to output an HTML documentation file:

  • -D generate documentation - output will be the same name as the D source file, with the ".d" extension replaced with ".html".
  • -Dd<directory> write documentation file to directory, output filename is the same as from the -D option.
  • -Df<filename> write documentation file to filename (does not automatically append .html extension)


gollark: Hmm, yes, if you *know* that then it's kind of similar to coercion.
gollark: > i shouldn't need to deal with people who live in the time of the old testament properly if they're not willing to catch up to the centuries of science which have undermined their very base belief about the earthYes, and you can ignore them/block them/etc.
gollark: You can blame it on your upbringing and environment and genes or the initial conditions of the universe and the rules for updating it or something like that, but I'm a compatibilist.
gollark: Probably.
gollark: Maybe you could say that about political ideologies too. Hmm. They're generally less reason-based, inasmuch as you can't really measure "opinion goodness" objectively.
This article is issued from Wikipedia. The text is licensed under Creative Commons - Attribution - Sharealike. Additional terms may apply for the media files.