Дополнительные действия
iCCup API Documentation Guide Allows for easy creation of API documentation (e.g., for modules) within the iCCup platform. Use in combination with {{ApiDocStart}} and {{ApiDocEnd}} (at the start and end of the documentation section). Functions generate links to a subpage, so that more detailed documentation can be provided. Use {{ApiDocBig}} there. By default, this setup stores documentation into LPDB (as datapoints). To turn this off, use the {{ApiDocStart}} parameter.
Parameters[править код]
|
the function name to document. This is a required parameter that identifies the function being documented. ;|description=
a brief description of what the function does. This should be a concise summary that gives an overview of the function’s purpose. ;|params= :(Optional) Lists and describes the parameters that the function accepts. This can include the parameter type, name, and a brief description of its role. ;|returns= :(Optional) Specifies the return value of the function, including the type and a brief description. If the function does not return anything, this can be left blank.
Copy/Paste Code[править код]
To quickly add API documentation for your modules or functions, use the following template. Copy and paste the code below and fill in the appropriate details for each function:
{{ApiDoc | |description= |returns= |params= }}
Example[править код]
Below is an example of how to use the API documentation templates to create structured documentation for module functions:
{{ApiDocStart}} {{ApiDoc|createGameInstance|returns=object|description=Creates a new game instance in the system|params=name, settings}} {{ApiDoc|deleteGameInstance|returns=void|description=Deletes an existing game instance by its identifier|params=id}} {{ApiDocEnd}}
In some cases, you might want to turn off storing documentation into LPDB. Use the store parameter as shown below:
{{ApiDocStart|store=false}} {{ApiDoc|createGameInstance|returns=object|description=Creates a new game instance in the system|params=name, settings}} {{ApiDoc|deleteGameInstance|returns=void|description=Deletes an existing game instance by its identifier|params=id}} {{ApiDocEnd}}
See Also[править код]
{{ApiDocList}}: Use this template to list all documented API functions. {{ApiDocStart}}: Marks the beginning of an API documentation section. {{ApiDocEnd}}: Marks the end of an API documentation section. {{ApiDocBig}}: Use this on subpages to provide detailed documentation for a specific function.