Difference between revisions of "Template:Apicall/doc"

From BZFlagWiki
Jump to: navigation, search
Line 8: Line 8:
  
 
This would result in the following:
 
This would result in the following:
 +
  
 
:{{apicall
 
:{{apicall
 
| name            = bz_testApiCall()
 
| name            = bz_testApiCall()
 +
}}
 +
 +
 +
If we wanted a description for our call, we could do something like this:
 +
 +
<pre>{{apicall
 +
| name            = bz_testApiCall()
 +
| description      = This is the description for the function. This particular function doesn't really do anything. The text of this function's description is intentionally long, so that you can see that, when it line-wraps, the text is still indented.
 +
}}</pre>
 +
 +
This would result in the following:
 +
 +
 +
:{{apicall
 +
| name            = bz_testApiCall()
 +
| description      = This is the description for the function. This particular function doesn't really do anything. The text of this function's description is intentionally long, so that you can see that, when it line-wraps, the text is still indented.
 
}}
 
}}

Revision as of 22:50, 14 December 2008

This template can be used for bzfs api call documentation pages. It contains fields for the parameters of the api call, it's return type (if any), a description for it, and some other api calls that can be referenced. The template supports up to 10 api call parameters, although support for more can be added by editing this template.

To use the template, you must include at least a name parameter, and preferably a description. For example, a call that takes no arguments and returns nothing, and that doesn't have a desctiption, could be declared like this:

{{apicall
| name             = bz_testApiCall()
}}

This would result in the following:


void bz_testApiCall() ()


No description



If we wanted a description for our call, we could do something like this:

{{apicall
| name             = bz_testApiCall()
| description      = This is the description for the function. This particular function doesn't really do anything. The text of this function's description is intentionally long, so that you can see that, when it line-wraps, the text is still indented.
}}

This would result in the following:


void bz_testApiCall() ()


This is the description for the function. This particular function doesn't really do anything. The text of this function's description is intentionally long, so that you can see that, when it line-wraps, the text is still indented.