Module:ACImplNotes

local p = {}

function p.getSectionsFromWikitext(wikitext, sectionLevel) if (wikitext == nil) then return {} end -- Next split by section levels local sectionDefinitionRegex = '' if (sectionLevel == nil) then sectionDefinitionRegex = '=+' else sectionDefinitionRegex = mw.ustring.rep('=', sectionLevel) end local sectionRegex = '\n[ ]-' .. sectionDefinitionRegex .. '[^=]+' .. sectionDefinitionRegex .. '[ ]-\n' local sections = mw.text.split(wikitext, sectionRegex) return sectionRegex end

function p.getSectionsFromTitle(title, sectionLevel) local titleObject = mw.title.new(title) local pageWikitext = titleObject:getContent return p.getSectionsFromWikitext(wikitext, sectionLevel) end

function p.getPrinciples(title) local sections = p.getSectionsFromTitle(title, 2) end

return p