Template:Lua component
Jump to navigation
Jump to search
|-
| :
|
|
|
|
|
|
Documentation
About the Template
This template can be used to produce a table of component's properties. It has three sub-templates: Template:Lua component/start for headers, Template:Lua component/end for footers and Template:Lua component/note for notes.
Usage
{{Lua component/note | property = | desc = | overwrite = <!-- set to any non-empty value to overwrite docstring --> }} <!-- More Lua component/note --> {{Lua component/start | name = }} {{Lua component | role = | property = | type = | width = | default = | range = | docstring = }} <!-- More Lua component --> {{Lua component/end}}
Examples
{{Lua component/note | property = member_with_docstring | desc = A member's note }} {{Lua component/note | property = private_without_docstring | desc = A private's note }} {{Lua component/note | property = private_overwritten | desc = A private's note, overwritten | overwrite = blah }} {{Lua component/start | name = ExampleComponent }} {{Lua component | role = public | property = member_with_docstring | type = bool | width = 1 | default = 0 | range = [0, 1] | docstring = Docstring of member_with_docstring }} {{Lua component | role = public | property = member_without_docstring | type = int | default = 0 }} {{Lua component | role = private | property = private_with_docstring | width = 4 | range = [0, 1] | docstring = Docstring of private_with_docstring }} {{Lua component | role = private | property = private_without_docstring }} {{Lua component | role = private | property = private_overwritten | docstring = Docstring got overwritten }} {{Lua component | role = private | property = private_complex_type | type = class std::basic_string<char,struct std::char_traits<char>,class std::allocator<char> > | width = 24 }} {{Lua component/end}}
Results in:
ExampleComponent | ||||||
---|---|---|---|---|---|---|
Role | C++ type | Property | Default | Range | Width | Description |
public:
|
bool
|
member_with_docstring
|
=0
|
∈[0, 1]
|
1 | "Docstring of member_with_docstring" A member's note |
public:
|
int
|
member_without_docstring
|
=0
|
|||
private:
|
private_with_docstring
|
∈[0, 1]
|
4 | "Docstring of private_with_docstring" | ||
private:
|
private_without_docstring
|
A private's note | ||||
private:
|
private_overwritten
|
A private's note, overwritten | ||||
private:
|
class std::basic_string<char,struct std::char_traits<char>,class std::allocator<char> >
|
private_complex_type
|
24 |