Module:Studio debug

From PickiPedia: A knowledge base of bluegrass, old time psychedelic jams, and other public domain music
Revision as of 21:41, 17 September 2026 by Magent (talk | contribs) (Dump the exact string Module:Studio sessions returns (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[^\127]*\127", "<MARKER>" )
	s = s:gsub( "&", "&amp;" ):gsub( "<", "&lt;" ):gsub( ">", "&gt;" )
	return s
end

function p.raw( frame )
	local who = frame.args[1] or "Harry Clark"
	local raw = frame:callParserFunction( "#ask", {
		"[[Has performer::" .. who .. "]]",
		"?Has track name=track",
		"mainlabel=record",
		"format=plainlist",
		"link=none",
		"sep=@@",
		"template=Studio appearance row",
		"searchlabel=",
		"limit=200",
	} )
	return "<pre>BEFORE: " .. visible( raw )
		.. "\nAFTER:  " .. visible( mw.text.unstrip( raw or "" ) ) .. "</pre>"
end

function p.link( frame )
	return "one: [[Studio sessions test]] || two: [[4masks]]"
end

-- What does the real module hand back, character for character?
function p.dump( frame )
	local studio = require( "Module:Studio sessions" )
	local out = studio.appearances( frame )
	return "<pre>" .. visible( out ) .. "</pre>"
end

return p