summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorWuzzy <almikes@aol.com>2016-08-03 00:55:35 +0200
committerWuzzy <almikes@aol.com>2016-08-03 00:55:35 +0200
commit698609945e48a869594e2a1ac9189985f5fbf521 (patch)
tree4894c0463ae2b2aa7d5edd40df6c523437c06638
parentbcdd9427d3e179d2f94671e4966305eac8c2ad84 (diff)
entry_builders instead of entry_templates
-rw-r--r--API.md4
-rw-r--r--init.lua6
2 files changed, 5 insertions, 5 deletions
diff --git a/API.md b/API.md
index f5a0a44..5efcc2d 100644
--- a/API.md
+++ b/API.md
@@ -57,11 +57,11 @@ data.
For `build_formspec` you can either define your own function or use one
of the following predefined functions:
-* `doc.entry_templates.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
a freeform text.
-* `doc.entry_templates.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
if you expect your entries to differ wildly in layouts.
diff --git a/init.lua b/init.lua
index a87c019..dd9474b 100644
--- a/init.lua
+++ b/init.lua
@@ -147,15 +147,15 @@ function doc.get_viewed_count(playername, category_id)
end
-- Template function templates, to be used for build_formspec in doc.new_category
-doc.entry_templates = {}
+doc.entry_builders = {}
-- Freeform text
-doc.entry_templates.text = function(data)
+doc.entry_builders.text = function(data)
return "textarea[0.25,0.5;12,8;;"..minetest.formspec_escape(data)..";]"
end
-- Direct formspec
-doc.entry_templates.formspec = function(data)
+doc.entry_builders.formspec = function(data)
return data
end