Module:Infobox ET: Difference between revisions

Try automating some categories and internal refactoring using octave and twelfth
Try automating the category of the main article and the equal division
Line 48: Line 48:
local tuning = frame.args['tuning']
local tuning = frame.args['tuning']
local et = ET.parse(tuning) or ET.parse('12edo')
local et = ET.parse(tuning) or ET.parse('12edo')
-- category of the main article
categories = categories .. '[[Category:' .. tuning .. '| ]]'
-- category of the equal division
if rat.eq(et.equave, 2) then
categories = categories .. '[[Category:Equal divisions of the octave|' .. string.rep ('#', string.len (et.size)) .. ']]'
else
local equave_text = ET.common_suffix[et.equave]
if equave_text == nil then
equave_text = et.equave
end
categories = categories .. '[[Category:Ed' .. equave_text .. '|' .. string.rep ('#', string.len (et.size)) .. ']]'
end
local prime = ""
local prime = ""