Next: Metrics, Previous: Code Fixing, Up: Tools
GPS provides a documentation generator which processes source files and generates annotated HTML files.
It is based on the source cross-reference information (e.g. generated by GNAT for Ada files). This means that you should ensure that cross-reference information has been generated before generating the documentation. It also relies on standard comments that it extracts from the source code. Note that unlike other similar tools, no macro needs to be put in your comments. The engine in charge of extracting them coupled with the cross-reference engine gives GPS all the flexibility needed to generate accurate documentation.
Currently, documentation can only be generated for Ada files.
The documentation is put into a directory called html, created under the object directory of the root project loaded in GPS.
Once the documentation is generated, the main documentation file is loaded in your default browser.
The documentation generator uses a set of templates files to control the final rendering. This means that you can control precisely the rendering of the generated documentation. The default set of templates is defined in the file docgen.xml and can be found under <install_dir>/share/gps/docgen/html. For a description of the documentation generator renderer see Defining a documentation format.
The documentation generator can be invoked from two places inside GPS:
Documentation
contextual menu.
From a source file contextual menu, you have one option called Generate for <filename>, that will generate documentation for this file and if needed its corresponding body (see The Preferences Dialog).
From a project contextual menu (see The Project View), you will have the choice between generating documentation for all files from the selected project or from the selected project recursively.
You will find the list of all documentation options in
The Preferences Dialog.
Furthermore, the documentation generator relies on the ALI files created by GNAT. Depending on the version of GNAT used, the following restrictions may or may not apply: