-- Low-overhead version of to avoid exceeding-- template include size at List of baryons.
local particleTable, supsub
local function stripToNil(text) -- If text is a string, return its trimmed content, or nil if empty. -- Otherwise return text (which may, for example, be nil). if type(text)
local BREAK = "__BR__"
-- A group is a list of one or more particles with optional separating text.-- Some items are defined with special meanings:-- Parameter Output-- / " / "-- + " + "-- or " or "-- seen " (seen) "-- _word1_word2 " word1 word2" (wordN is any text)-- (text) "(text)" (text is any text)-- br "
" (and separates the group into logical lines)-- Each logical line in the final text is in a nowrap span.local GroupGroup = Group.__index = Group
local keyitems =
local function expand(item, wantLink) -- Return text after expanding given item. -- Throw an error if item is not recognized. local function quit(reason) reason = reason or 'has an invalid definition' error('Particle "' .. item .. '" ' .. reason, 0) end local function su(sup, sub, align) local options = return supsub(sup, sub, options) end local kw = keyitems[item] if kw then return kw end if item:sub(1, 1)
'(' and item:sub(-1)
local function main(frame, wantLink) -- Arguments are passed using #invoke in an article to avoid double-expansion. local sandbox = frame:getTitle:find('sandbox', 1, true) and '/sandbox' or particleTable = mw.loadData('Module:Particles/data' .. sandbox).particles supsub = require('Module:Su')._main local group = Group.new for _, arg in ipairs(frame.args) do arg = stripToNil(arg) if arg then group:add(expand(arg, wantLink)) end end return group:textend
local function link(frame) return main(frame, true)end
local function nolink(frame) return main(frame, false)end
return