Add size constraints to API doc

This commit is contained in:
Wuzzy 2016-08-03 01:02:55 +02:00
parent 698609945e
commit bbf32f28e4

13
API.md
View File

@ -53,18 +53,23 @@ data.
only parameter (has the data type of the entry data) and must only parameter (has the data type of the entry data) and must
return a formspec which is inserted in the Entry tab. return a formspec which is inserted in the Entry tab.
#### Predefined values `build_formspec` #### Using `build_formspec`
For `build_formspec` you can either define your own function or use one For `build_formspec` you can either define your own function which
of the following predefined functions: procedurally generates the entry formspec or you use one of the
following predefined convenience functions:
* `doc.entry_builders.text`: Expects entry data to be a string. * `doc.entry_builders.text`: Expects entry data to be a string.
It will be inserted directly into the entry. Useful for entries with It will be inserted directly into the entry. Useful for entries with
a freeform text. a freeform text.
* `doc.entry_builders.formspec`: Entry data is expected to contain the * `doc.entry_builders.formspec`: Entry data is expected to contain the
complete entry formspec as a string. Useful if your entries. Useful complete entry formspec as a string. Useful if your entries. Useful
if you expect your entries to differ wildly in layouts. if you expect your entries to differ wildly in layouts.
When building your formspec, you have to respect the size limitations.
The documentation system uses a size of `12,9` and you should place
all your formspec elements at positions not lower than `0.25,0.5` to
avoid overlapping.
#### Return value #### Return value
Always `nil`. Always `nil`.