Documentation
Comment tags
ContRap uses ''java-doc''-style comments to adjust code generation in the native C++ export mode. A fully commented plugin has the following form:
/**
* Plugin description
*
* @export Export
* @group Group
* @icon Icon
* @color Color
* @author Author
* @copyright Copyright
* @condition Condition
* @param Parameter Info
* @default Parameter Value
* ...
* @option Option Info
* @default Option Value
* ...
* @return Info
*/
CONTRAP_FUNCTION ReturnType* function_name(...) { ... }
* Plugin description
*
* @export Export
* @group Group
* @icon Icon
* @color Color
* @author Author
* @copyright Copyright
* @condition Condition
* @param Parameter Info
* @default Parameter Value
* ...
* @option Option Info
* @default Option Value
* ...
* @return Info
*/
CONTRAP_FUNCTION ReturnType* function_name(...) { ... }
All the tags except the default tag of each option are optional. The order of the tags does not matter. The ''...'' indicate that there may be more than one parameter or options with corresponding descriptions.
In the following table a description of the tags and the semantics are given.
Tag | Syntax | Semantics |
---|---|---|
export | @export Export | Function name in the user mode |
group | @group Group | Logical group of the plugin with subgroups separated by '':'' |
icon | @icon Icon | Icon of the plugin in the IDE |
color | @color Color | Color of the plugin background in the IDE |
author | @author Author | List of the authors of the plugin |
condition | @condition Condition | Execution condition of the function |
copyright | @copyright Copyright | Copyright and license notice |
param | @param Parameter Info | Comments the parameter ''Parameter'' with the information ''Info'' |
option | @option Option Info | Comments the option ''Option'' with the information ''Info''. The default tag is required in the case of options. |
default | @default Parameter Value | Sets the default value for the parameter ''Parameter'' to ''Value'' |
return | @return Info | Return value description of the plugin |
It is possible and desired to group all the comments which apply to the whole file in a separate comment block at the beginning of the plugin file. This file header starts with the tag @file followed by the exact name of the file (without path).
/**
* File description
*
* @file filename.cpp
* @group Group
* @icon Icon
* @color Color
* @author Author
* @copyright Copyright
*/
* File description
*
* @file filename.cpp
* @group Group
* @icon Icon
* @color Color
* @author Author
* @copyright Copyright
*/