MXDOC

HTML documentation generator for C

Doug Eleveld (deleveld@dds.nl)
Saffierstraat 19
Groningen 9743 LE
The Netherlands
050 318 9339

This program parses C headers and source files reading comments of the form /** ... */ and outputs HTML documentation of the files. An example of the documentation generated is here.

News

Download

Source code and binary (made with Flex and DJGPP) MXDOC 2.4.
This program is distributed under the GNU General Public License. See also here.

Why?

Other automatic documentation systems exist, such as Doxygen, GNU GLobal, or Natural Docs. All of these systems allow documentation to be embedded in the C source code so it's easy to keep code and comments properly synchronized. So there is no need to maintain separate source code and documentation and risk having them become unsyncronized. So what is special about MXDOC?

Advantages of MXDOC

Disadvantages of MXDOC

How do I document using MXDOC?

MXDOC parses your C headers and source files looking for specially formated comments. These comments are in the form /** ... */. These specially formatted comments may be placed immediatly before a 'object' such as a typedef, function, define or macro. The contents of the comment will be added to the documentation for that object. For functions or typedefs, the same specially formatted comments may be within the function/typedef and the contents of the comment will also be added to the associated documentation.

There are several ways in which objects can be documented:

What are tags?

Comments may be 'tagged' using a comma separated list of 'tags'. These tags are collected and documented together. For example all functions are given the 'func' tag.

Tags can be user defined. A useful tag is the 'todo' tag which can collect documentation in a central 'todo' page. An example of a user generated tags is:

/**todo,fixme This function needs to be completed */
void unfinished function(void) 
{
}
The name of the object and any associated documentation will be added to a 'todo' list and a 'fixme' list.

A special tag _top_ exists to force the associated text to the top of the tag page. This is useful for summaries of the tags.

Short-form documentation

You can specify a short-form documentation title by making the first non whitespace character of the documentation to be a ! character. The contents of the short-form documentation title start after the ! character and continue to, but do not include, the following newline. The short-form documentation is used when making lists of documented objects.

What is modular programing?

Modular programming consists of grouping related functions into a module. The module is divided into an interface and an implementation. The specific implementation of the module remains private and hidden from uses of the module. This speparation of programs into component modules is a powerful organizing principle for designing non-trivial programs. Modules provide abstraction, encapsulation, and information-hiding as well as making the large-scale structure of a program easier to understand. A well-designed modular structure also promotes software reuse.

Modular programming in C is a method of organizing header files and source code so that application programming interfaces (APIs) are sensible and useful. There are 3 different kinds of C modules:

Collections of modules in a directory are known as libraries.