Module:MOSes by EDO: Difference between revisions
mNo edit summary Tags: Mobile edit Mobile web edit Advanced mobile edit |
No edit summary |
||
(5 intermediate revisions by 2 users not shown) | |||
Line 3: | Line 3: | ||
local utils = require("Module:Utils") | local utils = require("Module:Utils") | ||
local mosinedo = require("Module:MOS in EDO") | local mosinedo = require("Module:MOS in EDO") | ||
local yesno = require("Module:Yesno") | |||
local p = {} | local p = {} | ||
-- Copied from Ganaram Inukshuk's module on 22 Oct 2024, the only change was changing from 2nd level headings to plain bold text. | -- Copied from Ganaram Inukshuk's module on 22 Oct 2024, the only change was changing from 2nd level headings to plain bold text and removing the auto-categories, to allow calling multiple times inside of a single page. | ||
-- Helper function | -- Helper function | ||
Line 115: | Line 116: | ||
local temperament_index = 1 + i - starting_generator | local temperament_index = 1 + i - starting_generator | ||
if show_temperament then | if show_temperament then | ||
result = result .. mosinedo.mos_in_edo_simplified(edo, i, number_of_periods, generation_limit, temperaments[temperament_index]) | result = result .. mosinedo.mos_in_edo_simplified(edo, i, number_of_periods, generation_limit, temperaments[temperament_index]) .. "\n" | ||
else | else | ||
result = result .. mosinedo.mos_in_edo_simplified(edo, i, number_of_periods, generation_limit) | result = result .. mosinedo.mos_in_edo_simplified(edo, i, number_of_periods, generation_limit) .. "\n" | ||
end | end | ||
end | end | ||
Line 123: | Line 124: | ||
end | end | ||
end | end | ||
return result | return result | ||
Line 152: | Line 148: | ||
local max_periods = tonumber(frame.args["Period Limit"]) or -1 | local max_periods = tonumber(frame.args["Period Limit"]) or -1 | ||
local generation_limit = tonumber(frame.args["Generation Limit"]) or -1 | local generation_limit = tonumber(frame.args["Generation Limit"]) or -1 | ||
local debugg = yesno(frame.args["debug"]) | |||
local result = p.mos_in_edo_allperiods(edo, max_periods, show_subsets, generation_limit, temperaments) | |||
-- Debugger option | |||
if debugg == true then | |||
result = "<syntaxhighlight lang=\"wikitext\">" .. result .. "</syntaxhighlight>" | |||
end | |||
return frame:preprocess(result) | |||
end | end | ||
return p | return p |