Module:Studio debug

From PickiPedia: A knowledge base of bluegrass, old time psychedelic jams, and other public domain music
Revision as of 21:43, 17 September 2026 by Magent (talk | contribs) (Test the extra printouts (via update-page on MediaWiki MCP Server))
Jump to navigationJump to search

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", "<DEL>" )
	s = s:gsub( "&", "&amp;" ):gsub( "<", "&lt;" ):gsub( ">", "&gt;" )
	return s
end

local function ask( frame, printouts )
	local args = { "[[Has performer::Harry Clark]]" }
	for _, one in ipairs( printouts ) do
		table.insert( args, one )
	end
	for _, one in ipairs( {
		"mainlabel=record", "link=none", "searchlabel=", "limit=200",
		"format=plainlist", "sep=@@", "template=Studio appearance row",
	} ) do
		table.insert( args, one )
	end
	return frame:callParserFunction( "#ask", args )
end

function p.one( frame )
	local raw = ask( frame, { "?Has track name=track" } )
	return "BEFORE " .. visible( raw ) .. " AFTER " .. visible( mw.text.unstrip( raw ) )
end

function p.all( frame )
	local raw = ask( frame, {
		"?Has track name=track", "?Has track number=number", "?Has instrument=instrument",
	} )
	return "BEFORE " .. visible( raw ) .. " AFTER " .. visible( mw.text.unstrip( raw ) )
end

return p