Module:ChessBowserPrototype

local function demo(frame) local pgn = frame.args.pgn if not pgn then error('no valid pgn found') end local parser = require('Module:Parse-pgn') local fens, plys, notations, metadata = parser.parsePgn(pgn) local passToScript = { fen = fens[1], plys = plys, }	local baseTemp = [[	        		 $rowLegends 		 $rowLegends 		 $fileLegends 		 $fileLegends

]]	local file_letters = { [0] = "a", [1] = "b", [2] = "c", [3] = "d", [4] = "e", [5] = "f", [6] = "g", [7] = "h" } local rowlegends, filelegends = ,  for r = 0 ,7 do rowlegends = rowlegends .. ' ' .. r + 1 .. ' '		filelegends = filelegends .. ' ' .. file_letters[r] .. ' '	end;

local result = string.gsub(baseTemp, '$passToScript', mw.text.jsonEncode(passToScript)) result = string.gsub(result, '$rowLegends', rowlegends) result = string.gsub(result, '$fileLegends', filelegends) return result end

return { ['demo'] = demo, }