Module:Infobox MOS: Difference between revisions

Ganaram inukshuk (talk | contribs)
m Removed extra newlines
Ganaram inukshuk (talk | contribs)
Fixed logic for debug categories, removed tuning categories
Line 7: Line 7:
local xp = require('Module:Xenpaper')
local xp = require('Module:Xenpaper')
local infobox = require('Module:Infobox')
local infobox = require('Module:Infobox')
-- TODO: add back debug mode, as categories are added no matter what


local common_suffix = {
local common_suffix = {
Line 57: Line 55:
-- Add tuning category
-- Add tuning category
categories = categories .. string.format('[[Category:%s]]', tuning)
--categories = categories .. string.format('[[Category:%s]]', tuning)
-- Add notecount category if the notecount is greater than 3
-- Add notecount category if the notecount is greater than 3
Line 289: Line 287:
local tuning = frame.args['Tuning']
local tuning = frame.args['Tuning']
local other_names = frame.args['Other names'] or nil
local other_names = frame.args['Other names'] or nil
local debug_mode = frame.args['debug'] ~= nil
local debug_mode = tonumber(frame.args['debug']) == 1
local result = p._infobox_MOS(tuning, other_names)
local result = p._infobox_MOS(tuning, other_names)
-- Force categories
if not debug_mode then
result = result .. p.categorize(tuning)
result = result .. p.categorize(tuning)
end
return result
return result