Doxygen
Automatic HTML Documentation with C++.
Creating Comments in Libs
- You can create local documentation for your code for MR_LIBS by runnig this:
The documentation will be created in /home/$USER/html/libs/html, please edit the script to change the desired location if needed.
To access, you can just open the index.html file or host the directory with python -m http.server -d /home/$USER/html/libs/html 8000 on port 8000
The build process of this repository is being executed by runnnig this script:
General Use of Doxygen tool for other projects:
- Create a Doxygen configuration file by running (on Linux) to create default config file:
- Edit the following lines in the created file Doxyfile:
- PROJECT_NAME - write project name
- OUTPUT_DIRECTORY - the output html directory. If empty, docs will be written to html/ in the project directory. For public use, change to /var/www/html/${YOUR_DOCUMENTATION_ROOT_NAME, e.g., "Libs"}
- JAVADOC_AUTOBRIEF = YES
- OPTIMIZE_OUTPUT_FOR_C = YES
- QUIET = YES
- RECURSIVE= YES
- GENERATE_LATEX = NO
- The following command will generate html documentation from comments in the code (see next section). Re-run the command if you want newly-added Doxygen comments to be incorporated.
If OUTPUT_DIRECTORY was empty, simply view html/index.html in the project directory with any browser. The public documentation (e.g., for Libs) look for Creating Lib documentation section
How to create documentation in code
- An example of documenting class members:
The "///" initiates a Doxygen comment and the "<" specifies that the comment comes after the element declaration. A second option is to add a comment before the member declaration:
- To document a class or a file, put this section before the class declaration:
- For functions, the following syntax is better:
For more details, see (external network): https://www.stack.nl/~dimitri/doxygen/manual/docblocks.html