Using FPDoc is quite simple. It takes some command-line options, and based on these options, creates documentation. The command-line options can be given as long or short options, as is common for most GNU programs.
In principle, only 2 command-line options are needed:
Some examples:
This will scan the crt.pp file and generate documentation for it in a directory called fcl.
This will scan the file classes.pp, with the DEBUG symbol defined, the scanner will look for include files in the ../inc directory, and OBJFPC-mode syntax will be accepted.
(for more information about these options, see the Free Pascal compiler user’s guide)
With the above commands, a set of documentation files will be generated in HTML format (this is the standard). There will be no description of any of the identifiers found in the unit’s interface section, but all identifiers declarations will be present in the documentation.
The actual documentation (i.e. the description of each of the identifiers) resides in a description file, which can be specified with the descr option:
This will scan the crt.pp file and generate documentation for it, using the descriptions found in the filecrt.xml file. The documentation will be written in a directory called fcl.
All options should be given on one line. This will scan the file classes.pp, with the DEBUG symbol defined, the scanner will look for include files in the ../inc directory, and OBJFPC-mode syntax will be accepted.
More than one input file or description file can be given:
Here, documentation will be generated for 2 units: classes and process
The format of the description file is discussed in the next chapter.
Other formats can be generated, such as latex:
This will generate a LaTeX file called fcl.tex, which contains the documentation of the units classes and process. The latex file contains no document preamble, it starts with a chapter command. It is meant to be included (using the LaTeX include command) in a latex document with a preamble.
The output of FPDoc can be further customised by several command-line options, which will be explained in the next section.