DEV Community

Ajith Kumar P M
Ajith Kumar P M

Posted on

Documenting your code with DOXYGEN

1 : Installation

  1. go to https://www.doxygen.nl/download.html
  2. Install from git source as per the instructions shown in the page. NB: Don't forget to install doxywizard

2 : Configuration

  1. generate the configuration file for doxygen within your project directory doxygen -g dconfig
  2. Assign values for variables such as PROJECT_NAME: Name of the Project that will be displayed on the home page. a. PROJECT_NUMBER: Version number given b. PROJECT_BRIEF: Brief description of the project c. OUTPUT_DIRECTORY: Where the Latex and HTML compiled output displayed d. INPUT: path to the files to be scanned e. FILE_PATTERNS: (eg: .c *.h)) f. RECURSIVE: Allow recursive search over the input dirs(YES/NO) g. **SOURCE_BROWSER = YES, h. Set the **INLINE_SOURCES=YES, Setting the j. **INLINE_SOURCES*: YES will include the body of functions, classes and enums directly into the documentation.

3 : How to write comments for doxygen

Comments can be written in the format //!<Comment Here>, so that doxygen can detect them.

3.1: Some general suggestions for writing docs

  1. Know your audience: Before you start writing, understand who our audience is, what they already know, and what they want to know. This will help you tailor your documentation to their needs and level of understanding.

  2. Organize your content: Structure your documentation in a way that is easy to navigate and understand. Use headings, subheadings, lists, and other formatting tools to make your content easy to skim and find information

  3. Use clear and concise language: Avoid using technical jargon and use plain language wherever possible. Make sure your instructions are easy to follow and understand, and avoid using overly complex sentences or

  4. **Test your documentation: **Make sure to test your documentation to ensure that it is accurate and complete. This can be done by having others read through your documentation and provide

  5. Update your documentation: Keep your documentation up-to-date and relevant. As the system, software, or process changes, make sure to update your documentation

  6. Provide examples and use cases: Including examples and use cases can help illustrate how your system, software, or process can be used in real-world scenarios.

6. Compilation

doxygen dconfig

Top comments (0)