From 0dcfcba9269f5eec9d59c7b2877f35cc0a4aca7f Mon Sep 17 00:00:00 2001
From: Wuzzy <almikes@aol.com>
Date: Fri, 5 Aug 2016 02:43:12 +0200
Subject: Move yesno function to top hierarchy

---
 init.lua | 25 +++++++------------------
 1 file changed, 7 insertions(+), 18 deletions(-)

diff --git a/init.lua b/init.lua
index 38609e5..1e14158 100644
--- a/init.lua
+++ b/init.lua
@@ -22,6 +22,13 @@ local item_name_overrides = {
 }
 
 -- Helper functions
+local yesno = function(bool)
+	if bool==true then return "Yes"
+	elseif bool==false then return "No"
+	else return "N/A" end
+end
+
+
 local groups_to_string = function(grouptable, filter)
 	local gstring = ""
 	local groups_count = 0
@@ -204,12 +211,6 @@ doc.new_category("nodes", {
 
 			formstring = formstring .. "\n"
 
-			local yesno = function(bool)
-				if bool==true then return "Yes"
-				elseif bool==false then return "No"
-				else return "N/A" end
-			end
-
 			formstring = formstring .. "Collidable: "..yesno(data.def.walkable).. "\n"
 			local liquid
 			if data.def.liquidtype ~= "none" then liquid = true else liquid = false end
@@ -536,12 +537,6 @@ doc.new_category("tools", {
 				formstring = formstring .. "Maximum stack size: "..data.def.stack_max.. "\n"
 			end
 
-			local yesno = function(bool)
-				if bool==true then return "Yes"
-				elseif bool==false then return "No"
-				else return "N/A" end
-			end
-
 			formstring = formstring .. range_factoid(data.itemstring, data.def) .. "\n"
 
 			formstring = formstring .. "\n"
@@ -595,12 +590,6 @@ doc.new_category("craftitems", {
 			end
 			formstring = formstring .. "Maximum stack size: "..data.def.stack_max.. "\n"
 
-			local yesno = function(bool)
-				if bool==true then return "Yes"
-				elseif bool==false then return "No"
-				else return "N/A" end
-			end
-
 			formstring = formstring .. range_factoid(data.itemstring, data.def) .. "\n"
 
 			formstring = formstring .. "\n"
-- 
cgit v1.2.3