Chapter 7. Documentation with Doxygen

To get started with Doxygen-based documentation for your project you will create a docs directory under your project directory, and there create the Doxyfile configuration file.

You can also create any input or resource files that you may need in this directory.

7.1. Doxygen Configuration

This section identifies a few Doxgen configuration settings you can consider.

PROJECT_NAME

You can set PROJECT_NAME manually:

PROJECT_NAME      = "My Project"
	

or have it automatically set, based on the name of the project directory as follows:

PROJECT_NAME      =  $(PROJNAME)
	

OUTPUT_DIRECTORY

Set this to docs:

OUTPUT_DIRECTORY       = docs
	

FILE_PATTERNS

Add the *.ino and *.S patterns to this list.

USE_MDFILE_AS_MAINPAGE

This allows you to create a mainpage for your documentation that is written in Markdown. Something like this is good:

USE_MDFILE_AS_MAINPAGE = ./docs/README.md
	

7.2. Documenting Libraries

As well as being able to create whole project documentation, individual libraries can be separately documented.

This is done just as for projects, by creating a docs subdirectory within the library directory, and creating a suitable Doxyfile.

7.3. Building Documentation

Project documentation can be built by invoking:

  • dno docs in the project root directory;
  • dno docs in the project docs directory;
  • dno in the project docs directory.

Library documentation can be built by invoking:

  • dno docs in the library directory;
  • dno docs in the library's docs directory;
  • dno in the library's docs directory.