Changes

no edit summary
Line 15: Line 15:  
_good_stat_color = "#ffff40",
 
_good_stat_color = "#ffff40",
 
_outstanding_stat_color = "#73ff4d",
 
_outstanding_stat_color = "#73ff4d",
 +
_emphasis_template = "'''${value}'''",
 
_transparent = "transparent",
 
_transparent = "transparent",
 
_start_align = "start",
 
_start_align = "start",
Line 31: Line 32:  
_args = args,
 
_args = args,
 
}:create_table()
 
}:create_table()
 +
end
 +
 +
function BaseTable:get_emphasis(value, formatted, operator, good)
 +
local comparison = self._operators[operator or ">"]
 +
if value and good and comparison(value, tonumber(good)) then
 +
return format{self._emphasis_template, value = formatted}
 +
end
 +
return formatted
 
end
 
end
   Line 62: Line 71:  
function BaseTable:create_header()
 
function BaseTable:create_header()
 
self._header = self._header_template
 
self._header = self._header_template
 +
end
 +
 +
function BaseTable:process_item_key(item_key)
 +
return item_key
 
end
 
end
   Line 71: Line 84:  
table.insert(self._items, "header")
 
table.insert(self._items, "header")
 
else
 
else
local item = self._item_class(item_key)
+
local item = self._item_class(self.process_item_key(item_key))
 
table.insert(self._items, item)
 
table.insert(self._items, item)
 
local note = self._args[item_key .. self._notes_suffix]
 
local note = self._args[item_key .. self._notes_suffix]
Anonymous user