General information
When commenting the source code, Adelia developers can indicate that a comment must be integrated into the technical documentation using a dedicated syntax called an "annotation".
Depending on the type of program, annotations must be inserted in a specific place in the source code:
For Visual and Event programs: whether it is a program, procedure or management rule, annotations must be placed in the declaration blocks (
DECL PGM/DECLARATION
) before using the PARAM instruction.For Adelia programs: to ensure readability, annotations must be placed at the beginning of the source and in all cases before the RECEIVE instruction.
For classes: annotations are not supported in the class sources.
However, for classes referenced in Visual and Event programs, AdeliaDoc uses the class option and *SER_DESC attribute to insert a customized description when generating the class documentation.
Syntax
All AdeliaDoc annotations observe the same syntax rules, as described below:
- An annotation is comprised of a keyword and one or more parameters.
- A keyword always starts with the "
*@
" digraph. - The "
:
" character is used as a separator between the keyword and the parameters; "blank
" characters may be inserted before or after the separator character. - The "
,
" character is used as a parameter separator; it is not advisable to insert "blank
" characters before or after the separator character. - A keyword is not case sensitive but its parameters are.
- An annotation must be at the start of a line (but it can be preceded by "
blank
" or "tabulation
" characters). - Annotation parameters corresponding to text descriptions can be entered over several lines. In this case:
- the "
*@
" digraph must mark the start of the new line, - if you need to maintain the multiline formatting in the document, the "
*@|
" trigraph must mark the start of the new line.
- the "
- Examples:
- Simple annotation with one parameter:
*@deprecated : 3.2.5
Annotation with a multiline parameter - in this example, the description will appear in the form of two lines in the documentation:
*@description : Selection of an unrecorded item code.
*@|The P_DISP_ALL parameter must be initialized to the 0 value
*@to filter on unrecorded and active items.
Result obtained in the documentation:Selection of an unrecorded item code The P_DISP_ALL parameter must be initialized to the 0 value to filter on unrecorded and active items.
- Simple annotation with one parameter:
Description table of supported annotations
Each of the annotations referenced below can be used interchangeably in a program or procedure declaration block.
Annotation | Role |
---|---|
*@adeliadoc | Used to label (i.e. tag) a section in order to apply filter rules when producing documentation. |
*@description | Section description |
*@param | Section parameter description |
*@field | Description of a field associated with a "List " type parameter |
*@version | Indicates a section's version |
*@author | Name of section developer |
*@since | Indicates which version the section has been added since |
*@date | Date of last section modification |
*@deprecated | Indicates that the section is deprecated |
*@index | Used to add an index entry associated with the section to the documentation's global index |
It is understood that all annotations are optional. Bearing in mind that for a specific section, when only some or none of the required annotations have been entered, where possible, and if the AdeliaDoc configuration allows, default values from the source analysis and Adelia program description information are used instead to produce the documentation.
Detailed description of annotations
In the rest of the document:
the term "markup" indicates that it is possible to use certain elements of the reStructuredText syntax or certain Sphinx roles to format text content and primarily to add links to other sections of the documentation.
You are, however, strongly advised not to use formatting elements intensively or inappropriately as the correct display in the produced documentation cannot be completely guaranteed.When adding hypertext links, AdeliaDoc requires specific coding to identify the sections, which needs to be observed if you want to use the ad hoc "
:ref:
" role:Program section identification: the identifier is the name of the program itself.
*@description: this program corresponds to a variation of the margin calculation compared to the version proposed in the program :ref:'COMPUTE_PROFIT'.
Procedure section identification: the identifier is the concatenation of the program name and the procedure name in PROGRAM.PROC form.
*@description: this program corresponds to a variation of the margin calculation compared to the version proposed in the procedure :ref:'COMMONSPROCS.PROC_PROFIT'.
Class section identification: the class identifier is expressed as follows: class_CLASSNAME:
*@description: this program uses the class :ref:'class_ORDER' to create an order.
The concept of "default value" corresponds to the provenance of the substitution data when the corresponding annotation has not been entered by the developer (taking into account substitution rules from AdeliaDoc configuration parameters)
*@adeliadoc
Role | Used to label (i.e. tag) a section, mainly to identify target audience categories. Directly linked to the filter generation parameter which uses this annotation to include/exclude sections when generating documentation. For further details, see the help page for the filter parameter of AdeliaDoc call parameters. |
---|---|
Sections | Program/procedure |
Parameters |
|
Markup | No |
Notes | The |
Examples |
|
*@description
Role | Used to describe a section for the attention of the end user |
---|---|
Section | Program/procedure |
Parameters | Description itself |
Markup | |
Default value | Program description |
Examples |
|
*@param
Role | Used to describe a section parameter associated with instructions PARAM or RECEIVE. |
---|---|
Section | Program/procedure |
Parameters | Four parameters in the following form:
|
Markup | Yes for the parameter |
Default value | In all cases, the generator uses the PARAM or RECEIVE instructions from the 4GL to produce or complete the documentation associated with the parameter by automatically generating the information relating to the type, length and size of the variable. |
Notes |
|
Examples |
|
*@field
Role | Describes a field associated with a previously annotated |
---|---|
Section | Program/procedure |
Parameters | Three parameters in the following form:
|
Markup | Yes for the parameter |
Default value | In all cases, the generator uses the |
Notes |
|
Example | Example of a list parameter with three fields:
|
*@version
Role | Indicates the section version number |
---|---|
Section | Program |
Parameter | Version (free format) |
Markup | No |
Default value | Adelia object version |
Example |
|
*@author
Role | Indicates the developer's name |
---|---|
Section | Program/procedure |
Parameter | Developer's name |
Markup | No |
Default value | Name of Adelia object software engineer |
Example |
|
*@since
Role | Specifies the version since which the element was added. |
---|---|
Section | Program/procedure |
Parameter | Relevant version (free format) |
Markup | No |
Default value | Not supported |
Example |
|
*@date
Role | Indicates the date of the last section modification. |
---|---|
Section | Program/procedure |
Parameter | Relevant date (free format) |
Markup | No |
Default value | Adelia object modification date |
Notes | The use of this annotation in the documentation may not, in certain situations, correspond to the required behavior. That is why the date_annotation parameter in the configuration file can be used to force the default value (from the program information) in place of the entered parameter. |
Example | *@date: 05/05/2021 |
*@deprecated
Role | Indicates that the entity is deprecated |
---|---|
Section | Program/procedure |
Parameters | Two parameters in the following form:
|
Markup | Yes for the <description> parameter |
Default value | Not supported |
Notes | AdeliaDoc uses the appropriate Sphinx directive to generate this annotation. |
Examples |
|
*@index
Role | Used to index the section and describe the way it needs to appear in the global index of the documentation. |
---|---|
Section | Program/procedure |
Parameters | Indexing values (see notes below) |
Markup | No |
Default value | Name of the object section |
Notes |
|
Examples |
|