Documenting the code

GTK-Doc uses source code comment with a special syntax for code documentation. Further it retrieves information about your project structure from other sources. During the next section you will find all information about the syntax of the comments.

Documentation placement

In the past most documentation had to be filled into files residing inside the tmpl directory. This has the disadvantages that the information is often not updated and also that the file tend to cause conflicts with version control systems.

The avoid the aforementioned problems we suggest putting the documentation inside the sources. This manual will only describe this way of documenting code.

The scanner can handle the majority of C headers fine. In the case of receiving warnings from the scanner that look like a special case, one can hint GTK-Doc to skip over them.

Example 3-1GTK-Doc comment block
#ifndef __GTK_DOC_IGNORE__
/* unparseable code here */
#endif

Limitations

Note, that GTK-Doc's supports #ifndef(__GTK_DOC_IGNORE__) but not #if !defined(__GTK_DOC_IGNORE__) or other combinations.