Module:Studio debug
From PickiPedia: A knowledge base of bluegrass, old time psychedelic jams, and other public domain music
Documentation for this module may be created at Module:Studio debug/doc
-- Temporary. Delete once Module:Studio sessions is behaving.
local p = {}
local function visible( s )
s = ( s or "" ):gsub( "\127[^\127]*\127", "<MARKER>" )
s = s:gsub( "&", "&" ):gsub( "<", "<" ):gsub( ">", ">" )
return s
end
local function ask( frame, extra )
local args = {
"[[Has performer::Harry Clark]]",
"?Has track name=track",
"mainlabel=record",
"link=none",
"searchlabel=",
"limit=200",
}
for _, one in ipairs( extra ) do
table.insert( args, one )
end
local raw = frame:callParserFunction( "#ask", args )
return mw.text.unstrip( raw or "" )
end
-- With a row template, as the real module does.
function p.withtemplate( frame )
local raw = ask( frame, { "format=plainlist", "sep=@@", "template=Studio appearance row" } )
return "got " .. visible( raw ) .. " -- link after: [[4masks]]"
end
-- Without one: the values come back separated by SMW's own punctuation.
function p.notemplate( frame )
local raw = ask( frame, { "format=list", "sep=@@", "propsep=||" } )
return "got " .. visible( raw ) .. " -- link after: [[4masks]]"
end
-- No query at all, for a baseline.
function p.noask( frame )
return "got nothing -- link after: [[4masks]]"
end
return p