Misplaced Pages

Ddoc

Article snapshot taken from Wikipedia with creative commons attribution-sharealike license. Give it a read and then ask your questions in the chat. We can research this topic together.
This article does not cite any sources. Please help improve this article by adding citations to reliable sources. Unsourced material may be challenged and removed.
Find sources: "Ddoc" – news · newspapers · books · scholar · JSTOR (April 2024) (Learn how and when to remove this message)

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)

References

External links


Stub icon

This programming-tool-related article is a stub. You can help Misplaced Pages by expanding it.

Categories: