Module:Infobox AFDO: Difference between revisions

From Xenharmonic Wiki
Jump to navigation Jump to search
CompactStar (talk | contribs)
No edit summary
CompactStar (talk | contribs)
No edit summary
Line 5: Line 5:
local steps = frame.args['steps']
local steps = frame.args['steps']
local stepnum = tonumber(steps)
local stepnum = tonumber(steps)
local dualfifth = stepnum % 2 == 1
local fifth = math.ceil(steps/2)
local infobox_data = {}
local infobox_data = {}
-- table.insert(infobox_data, {
table.insert(infobox_data, {
-- 'Prime factorization',
'Prime factorization',
-- tostring(u._prime_factorization(stepnum))
u._prime_factorization(stepnum)
-- })
})


local result = infobox.build(
local result = infobox.build(
'<-&nbsp;[[' .. (steps - 1).. 'afdo]]&nbsp;' .. '[[' .. steps .. 'afdo]]' .. '&nbsp;[[' .. (steps + 1).. 'afdo]]&nbsp;->',
'<-<small>&nbsp;[[' .. (steps - 1).. 'afdo]]&nbsp;</small>' .. '[[' .. steps .. 'afdo]]' .. '<small>&nbsp;[[' .. (steps + 1).. 'afdo]]&nbsp;-></small>',
infobox_data
infobox_data
)  
)  

Revision as of 23:18, 11 April 2023

Module documentation[view] [edit] [history] [purge]
This module should not be invoked directly; use its corresponding template instead: Template:Infobox AFDO.

Generates an infobox providing information about a given arithmetic frequency division of the octave.

Introspection summary for Module:Infobox AFDO 
Functions provided (1)
Line Function Params
4 infobox_AFDO (invokable) (frame)
Lua modules required (2)
Variable Module Functions used
infobox Module:Infobox build
u Module:Utils _prime_factorization

No function descriptions were provided. The Lua code may have further information.


local p = {}
local u = require('Module:Utils')
local infobox = require('Module:Infobox')
function p.infobox_AFDO(frame)
	local steps = frame.args['steps']
	local stepnum = tonumber(steps)
	local dualfifth = stepnum % 2 == 1
	local fifth = math.ceil(steps/2)
	
	local infobox_data = {}
	table.insert(infobox_data, {
		'Prime factorization',
		u._prime_factorization(stepnum)
	})

	local result = infobox.build(
		'<-<small>&nbsp;[[' .. (steps - 1).. 'afdo]]&nbsp;</small>' .. '[[' .. steps .. 'afdo]]' .. '<small>&nbsp;[[' .. (steps + 1).. 'afdo]]&nbsp;-></small>',
		infobox_data
	) 
	
	return result
end

return p