Modul:Textinfo

Z Wikizdrojů, volně dostupné knihovny

Dokumentaci tohoto modulu lze vytvořit na stránce Nápověda:Modul:Textinfo

-- @brief
--  Backend for {{Textinfo}} & {{NavigacePaP}}.
-- 
-- @author
--  [[meta:User:Danny B.]]
local _module = {}
----------------------------------------


-- @brief
--  Escapes the string, so it can be safely used in patterns.
-- 
-- @param
--  value String to be escaped
-- 
-- @return
--  String Escaped input string
local function escapeForPattern( value )

	return mw.ustring.gsub( value, "([%(%)%[%]%.%+%-%*%?%%])", "%%%1" )
	
end


local function params2table ( param, ... )
	
	return param ~= nil and { param, ... } or nil
	
end


local Patterns = {
	["disambiguationSuffix"] = " %(%d%d%d%d–%d%d%d%d%)",
	["extlink"] = "%[[^%[][^%]]+%]",
	["nowiki"] = "\127'\"`UNIQ%-%-nowiki%-%x%x%x%x%x%x%x%x%-QINU`\"'\127",
	["plaintext"] = "[^%]\127]*",
	["ref"] = "\127'\"`UNIQ%-%-ref%-%x%x%x%x%x%x%x%x%-QINU`\"'\127",
	["wikilink"] = "%[%[[^%]]+%]%]"
}


local Wikilink = {}


function Wikilink.getType( link )
	
	local output
	local prefix
	
	local target = mw.ustring.match( link, "%[%[([^|%]]+)[|%]]" ) or ""
	
	output, prefix = Wikilink.getTargetType( target )
	
	if mw.ustring.find( link, "|" ) ~= nil then
		output = string.format( "%s s textem (%s)", output, Wikilink.getTextType( link, prefix ) )
	end
	
	return output
	
end


function Wikilink.getTargetType( target )
	
	local output = ""
	local prefix = ""
	
	local titleObject = mw.title.new( target )
	-- expensive++
	
	if titleObject then
		
		output = titleObject.isRedirect and "přesměrování" or "odkaz"
		
		if titleObject.nsText ~= "" then
			output = string.format( "%s %s", output, titleObject.nsText )
			prefix = string.match( target, "([^:]+:).*" )
		end
		
	end

	return output, prefix
	
end


function Wikilink.getTextType( link, prefix )
	
	local linkTextTypes = {
		{
			["name"] = "stejné",
			["target"] = "([^|]+)",
			["text"] = "%1"
		}, {
			["name"] = "bez rozlišovače",
			["target"] = "([^|]+)" .. Patterns.disambiguationSuffix,
			["text"] = "%1"
		}, {
			["name"] = "rozšířené",
			["target"] = "([^|]+)",
			["text"] = "[^%]]-%1[^%]]-"
		}, {
			["name"] = "odlišné",
			["target"] = "[^|]+",
			["text"] = "[^]]+"
		}
	}
	
	local output = ""
	
	local _
	local linkTextType
	
	for _, linkTextType in ipairs( linkTextTypes ) do
		
		local pattern = string.format( "%%[%%[%s%s|%s%%]%%]", prefix, linkTextType["target"], linkTextType["text"] )
		
		if mw.ustring.match( link, pattern ) ~= nil then
			output = linkTextType["name"]
			break
		end
		
	end
	
	return output
	
end


_module.authorPrefix = mw.site.namespaces[100]["name"] .. ":"


function _module._getLinkType( value )
	
	local output
	
	value = select( 3, mw.ustring.find( value, "(" .. Patterns.wikilink .. ")" ) )
	
	output = Wikilink.getType( value )
	
	return output
	
end


function _module._replaceLink( value )
	
	return mw.ustring.gsub( value, Patterns.wikilink, "⌂" )
	
end


function _module._trimDisambiguationSuffix ( value )
	
	return mw.ustring.match( value, "^(.*)" .. Patterns.disambiguationSuffix .. "$" ) or value
	
end


function _module._createAuthorsPattern( count )
	
	local authorPattern = "%[%[" .. _module.authorPrefix .. "([^%]|]+)|%1%]%]"
	local output = authorPattern
	
	for i = 2, count do
		output = output .. ", " .. string.gsub( authorPattern, "%%1", "%%" .. i )
	end
	
	output = "^" .. output .. "$"
	
	return output
	
end


-- @brief
--  Categorizes the page according to the "AUTOR" parameter, if it has value in defined simple formats.
-- 
-- @param
--  frame The current frame object
-- 
-- @return
--  Preprocessed wikitext
function _module.printAuthorCategory( frame )
	
	local titleObject = mw.title.getCurrentTitle()
	
	if titleObject.namespace ~= 0 then
		return
	end
	
	local output = ""
	
	local authorParam = mw.text.trim( frame:getParent().args["AUTOR"] or "" )
	
	local valueType
	local pageContent = titleObject:getContent()
	local authorNames = {}
	
	authorNames = params2table( nil
		or mw.ustring.match( authorParam, "^%[%[" .. _module.authorPrefix .. "([^%]|]+)%]%]$" )
		or mw.ustring.match( authorParam, "^%[%[" .. _module.authorPrefix .. "([^%]|]+)|%1%]%]$" )
		or mw.ustring.match( authorParam, "^%[%[" .. _module.authorPrefix .. "(([^%]|]+)" .. Patterns.disambiguationSuffix .. ")|%2%]%]$" )
		or mw.ustring.match( authorParam, "^%[%[" .. _module.authorPrefix .. "([^%]|]+)|[^%]]-%1[^%]]-%]%]$" )
		or mw.ustring.match( authorParam, "^%[%[" .. _module.authorPrefix .. "([^%]|]+)|[^%]]+%]%]$" )
		or mw.ustring.match( authorParam, "^%[%[" .. _module.authorPrefix .. "([^%]|]+)|[^%]]+%]%], neuveden$" )
		or mw.ustring.match( authorParam, "^%[%[" .. _module.authorPrefix .. "([^%]|]+)|[^%]]+%]%], neuveden, redakce$" )
		or mw.ustring.match( authorParam, "^%[%[" .. _module.authorPrefix .. "([^%]|]+)|[^%]]+%]%], neznámý$" )
		or mw.ustring.match( authorParam, "^%[%[" .. _module.authorPrefix .. "([^%]|]+)|[^%]]+%]%], neznámý, redakce$" )
		or mw.ustring.match( authorParam, "^%[%[" .. _module.authorPrefix .. "([^%]|]+)|[^%]]+%]%], redakce$" )
		or mw.ustring.match( authorParam, "^%[%[" .. _module.authorPrefix .. "([^%]|]+)|[^%]]+%]%], redakce, neuveden$" )
		or mw.ustring.match( authorParam, "^neuveden, %[%[" .. _module.authorPrefix .. "([^%]|]+)|[^%]]+%]%]$" )
		or mw.ustring.match( authorParam, "^neznámý, %[%[" .. _module.authorPrefix .. "([^%]|]+)|[^%]]+%]%]$" )
		or mw.ustring.match( authorParam, "^redakce, %[%[" .. _module.authorPrefix .. "([^%]|]+)|[^%]]+%]%]$" )
	)
	
	for i = 2, 9 do
		if authorNames then
			break
		end
		authorNames = params2table( string.match( authorParam, _module._createAuthorsPattern( i ) ) )
	end
	
	if authorNames then
		for _, authorName in ipairs( authorNames ) do
			if mw.ustring.match( pageContent, "%[%[ *[Kk]ategorie *: *" .. escapeForPattern( authorName ) .. " *%]%]" ) ~= nil then
				valueType = "obsahující kategorii autora"
			elseif mw.ustring.match( pageContent, "%[%[ *[Kk]ategorie *: *" .. escapeForPattern( authorName ) .. " *|[^%]]*%]%]" ) ~= nil then
				valueType = "obsahující kategorii autora s řadicím klíčem"
			else
				valueType = "neobsahující kategorii autora"
			end
			output = output .. string.format( "[[Kategorie:%s]][[Kategorie:Monitoring:Textinfo automaticky kategorizující stránku %s]]", authorName, valueType )
		end
	elseif ( authorParam == "neuveden" or authorParam == "neznámý" ) then
		output = output .. "[[Kategorie:Monitoring:Textinfo automaticky nekategorizující stránku s vyhrazeným autorem]]"
	elseif authorParam == "" then
		output = output .. "[[Kategorie:Monitoring:Textinfo automaticky nekategorizující stránku s nevyplněným autorem]]"
	else
		output = output .. "[[Kategorie:Monitoring:Textinfo automaticky nekategorizující stránku podle autora]]"
	end
	
	output = frame:preprocess( output )
	
	return output
	
end


-- @brief
--  Prints the author name trimmed of the disambiguation suffix if any,
-- 
-- @param
--  frame The current frame object
-- 
-- @return
--  Preprocessed wikitext
function _module.printTrimmedAuthorName( frame )
	
	local output
	
	output = _module._trimDisambiguationSuffix( frame.args[1] or "" )
	
	output = frame:preprocess( output )
	
	return output
	
end


-- @brief
--  Prints the list of authors.
-- 
-- @param
--  frame The current frame object
-- 
-- @return
--  Preprocessed wikitext
function _module.printAuthors( frame )
	
	local output
	
	local authors = mw.text.split( ( frame.args[1] or "" ), " *; *" )
	
	for index, author in ipairs( authors ) do
		author = mw.text.trim( author )
		authors[index] = string.format( "[[Autor:%s|%s]]", author, _module._trimDisambiguationSuffix( author ) )
	end
	
	output = table.concat( authors, "; " )
	
	output = frame:preprocess( output )
	
	return output
	
end


-- @brief
--  Checks the legitimacy of usage of given argument.
-- 
-- @param
--  frame The current frame object
-- 
-- @return
--  Preprocessed wikitext
function _module.checkArgumentUsageLegitimacy( frame )
	
	local argumentsLegitimacy = {
		["WIKIPEDIA-HESLO"] = {
			["subpageOf"] = {
				"Encyklopedie Britannica 1911",
				"Encyklopedie československé mládeže",
				"Hudební lexikon",
				"Masarykův slovník naučný",
				"Meyers Konversations-Lexikon 1885-1892",
				"Ottův slovník naučný",
				"Riegrův Slovník naučný",
				"Vlastenský slovník historický",
				"Všeobecná německá biografie",
				"Židovská encyklopedie",
				"Židovská encyklopedie Brockhause a Efrona"
			}
		}
	}
	
	local output = ""
	
	local titleObject = mw.title.getCurrentTitle()
	local argumentName = mw.text.trim( frame.args[1] )
	local argumentValue = mw.text.trim( frame:getParent().args[argumentName] or "" )
	
	if argumentValue == "" then
		return
	end
	
	for criteria, criteriaData in pairs( argumentsLegitimacy[argumentName] ) do
		if criteria == "subpageOf" then
			local errorMessage = "{{Chyba|šablona=Textinfo|text=Nesprávné použití parametru „" .. argumentName .. "“|kategorie=Opravit použití parametru „" .. argumentName .. "“}}"
			for _, subpage in ipairs( criteriaData ) do
				if mw.ustring.match( titleObject.text, "^" .. escapeForPattern( subpage ) .. "/" ) then
					errorMessage = ""
				end
			end
			output = output .. errorMessage
		end
	end
	
	output = frame:preprocess( output )
	
	return output
	
end


-- @brief
--  Monitors the "AUTOR", "AUTOR2" & "PŘELOŽIL" parameters in {{Textinfo}}
--  and the "AUTOR" & "AUTOR2" parameters in {{NavigacePaP}}.
-- 
-- @param
--  frame The current frame object
-- 
-- @return
--  Preprocessed wikitext
function _module.monitorAuthors( frame )
	
	if mw.title.getCurrentTitle().namespace ~= 0 then
		return
	end
	
	local output = ""
	
	local template = frame:getParent()
	local templateName = mw.title.new( template:getTitle() ).text
	local variableName = mw.text.trim( frame.args[1] )
	local value = mw.text.trim( template.args[variableName] or "" )
	
	local valueType = ""
	
	value = mw.ustring.gsub( value, "[<>\n]", { ["<"]="⧀", [">"]="⧁", ["\n"]="⏎" } )
	
	if value == "" then
		valueType = "(nevyplněno)"
	elseif value == "neuveden" then
		valueType = "neuveden"
	elseif value == "neznámý" then
		valueType = "neznámý"
	elseif mw.ustring.match( value, "^" .. Patterns.nowiki ) ~= nil then
		valueType = "nowiki"
	elseif mw.ustring.match( value, "^%[%[" .. _module.authorPrefix .. "Anonym|[^%]]*%]%]$" ) ~= nil then
		valueType = "Anonym/" .. mw.ustring.match( value, "^%[%[" .. _module.authorPrefix .. "Anonym|([^%]]*)%]%]$" )
	elseif mw.ustring.match( value, "^%[%[ *Uživatel:[^%]]+%]%]$" ) ~= nil then
		valueType = "Uživatel"
	elseif mw.ustring.match( value, "^%*" ) ~= nil then
		valueType = "seznam/" .. select( 2, mw.ustring.gsub( value, "%*", "%0" ) )
	elseif mw.ustring.match( value, "%]%].*%[%[" ) ~= nil then
		valueType = "více odkazů/" .. select( 2, mw.ustring.gsub( value, Patterns.wikilink, "%0" ) )
	elseif mw.ustring.match( value, "^" .. Patterns.wikilink .. "$" ) ~= nil then
		valueType = _module._getLinkType( value )
	elseif mw.ustring.match( value, "^" .. Patterns.wikilink .. Patterns.ref .. "$" ) ~= nil then
		valueType = _module._getLinkType( value ) .. " + ref"
	elseif mw.ustring.match( value, "^" .. Patterns.wikilink .. ".+$" ) ~= nil then
		valueType = _module._getLinkType( value ) .. " + plaintext/" .. _module._replaceLink( value )
	elseif mw.ustring.match( value, "^.+" .. Patterns.wikilink .. "$" ) ~= nil then
		valueType = "plaintext + " .. _module._getLinkType( value ) .. "/" .. _module._replaceLink( value )
	elseif mw.ustring.match( value, "^.+" .. Patterns.wikilink .. Patterns.ref .. "$" ) ~= nil then
		valueType = "plaintext + " .. _module._getLinkType( value ) .. " + ref"
	elseif mw.ustring.match( value, "^.+" .. Patterns.wikilink .. ".+$" ) ~= nil then
		valueType = "plaintext + " .. _module._getLinkType( value ) .. " + plaintext/" .. _module._replaceLink( value )
	elseif mw.ustring.match( value, "^[^%[%]]*" .. Patterns.ref .. "$" ) ~= nil then
		valueType = "plaintext + ref"
	elseif mw.ustring.match( value, ";" ) ~= nil then
		valueType = "více položek plaintext/"
		local authors = mw.text.split( value, " *; *" )
		for index, author in ipairs( authors ) do
			author = mw.text.trim( author )
			local titleObject = mw.title.new( _module.authorPrefix .. author )
			-- expensive++
			if titleObject then
				if titleObject.exists then
					authors[index] = "autor"
					if titleObject.isRedirect then
						authors[index] = authors[index] .. " redirect"
					end
				else
					authors[index] = "plaintext"
				end
			end
		end
		valueType = valueType .. table.concat( authors, "; " )
	else
		local titleObject = mw.title.new( _module.authorPrefix .. value )
		-- expensive++
		if titleObject then
			if titleObject.exists then
				valueType = "plaintext autor"
				if titleObject.isRedirect then
					valueType = valueType .. " redirect"
				end
			else
				valueType = "plaintext/" .. value
			end
		else
			valueType = "nerozeznáno"
		end
	end
	
	output = string.format( "[[Kategorie:Monitoring:%s/%s/=%s]]", templateName, variableName, valueType )
	
	output = frame:preprocess( output )
	
	return output
	
end


-- @brief
--  Monitors the equivalence of passed argument with the page title or its part.
-- 
-- @param
--  frame The current frame object
-- 
-- @return
--  Preprocessed wikitext
function _module.monitorTitleEquivalence( frame )
	
	if mw.title.getCurrentTitle().namespace ~= 0 then
		return
	end
	
	local output = ""
	
	local template = frame:getParent()
	local templateName = mw.title.new( template:getTitle() ).text
	local variableName = mw.text.trim( frame.args[1] )
	local titleValue, nbspReplaces = mw.ustring.gsub( mw.text.trim( template.args[variableName] or "" ), "&nbsp;", " " )
	
	local titleObject = mw.title.getCurrentTitle()
	
	local valueType
	local withNbsp = nbspReplaces > 0 and " s nepřerušitelnou mezerou" or ""
	
	if titleValue == titleObject.text then
		valueType = "název stránky"
		if mw.ustring.match( titleValue, "/" ) ~= nil then
			valueType = valueType .. " obsahující lomítko"
		end
	elseif titleValue == titleObject.subpageText then
		valueType = "název podstránky"
	elseif titleValue == titleObject.rootText then
		valueType = "název kořenové stránky"
	elseif mw.ustring.match( titleObject.text, "^.-/" .. escapeForPattern( titleValue ) .. "/.-$" ) ~= nil then
		valueType = "název mezistránky"
	elseif mw.ustring.match( titleObject.text, "^" ..  escapeForPattern( titleValue ) .. " %(.-%)$" ) ~= nil then
		valueType = "název stránky bez rozlišovače"
	elseif mw.ustring.match( titleObject.subpageText, "^" .. escapeForPattern( titleValue ) .. " %(.-%)$" ) ~= nil then
		valueType = "název podstránky bez rozlišovače"
	elseif mw.ustring.match( titleObject.rootText, "^" .. escapeForPattern( titleValue ) .. " %(.-%)$" ) ~= nil then
		valueType = "název kořenové stránky bez rozlišovače"
	elseif mw.ustring.match( titleValue, "^" .. escapeForPattern( titleObject.text ) .. Patterns.ref ) ~= nil then
		valueType = "název stránky + ref"
	elseif mw.ustring.match( titleValue, "^" .. escapeForPattern( titleObject.subpageText ) .. Patterns.ref ) ~= nil then
		valueType = "název podstránky + ref"
	elseif mw.ustring.match( titleValue, "^" .. escapeForPattern( titleObject.rootText ) .. Patterns.ref ) ~= nil then
		valueType = "název kořenové stránky + ref"
	else
		valueType = "vlastní"
	end
	
	output = string.format( "[[Kategorie:Monitoring:%s/%s/=%s%s]]", templateName, variableName, valueType, withNbsp )
	
	output = frame:preprocess( output )
	
	return output
	
end


-- @brief
--  Monitors the "ZDROJ" parameter of Ottův slovník naučný.
-- 
-- @param
--  frame The current frame object
-- 
-- @return
--  Preprocessed wikitext
function _module.monitorSourceOsn( frame )
	
	if not mw.ustring.match( mw.title.getCurrentTitle().text, "^Ottův slovník naučný" ) then
		return
	end
	
	local osnSources = {
		["První"] = {
			1888,
			{ "15-otto" }
		},
		["Druhý"] = {
			1889,
			{ "07-otto", "34-otto" }
		},
		["Třetí"] = {
			1890,
			{ "00-otto", "33-otto" }
		},
		["Čtvrtý"] = {
			1891,
			{ "25-otto" }
		},
		["Pátý"] = {
			1892,
			{ "22-otto", "55-otto" }
		},
		["Šestý"] = {
			1893,
			{ "19-otto", "51-otto" }
		},
		["Sedmý"] = {
			1893,
			{ "11-otto", "27-otto" }
		},
		["Osmý"] = {
			1894,
			{ "14-otto", "48-otto" }
		},
		["Devátý"] = {
			1895,
			{ "08-otto", "09-otto", "26-otto" }
		},
		["Desátý"] = {
			1896,
			{ "02-otto", "38-otto" }
		},
		["Jedenáctý"] = {
			1897,
			{ "04-otto", "10-otto", "23-otto" }
		},
		["Dvanáctý"] = {
			1897,
			{ "30-otto", "44-otto" }
		},
		["Třináctý"] = {
			1898,
			{ "17-otto" }
		},
		["Čtrnáctý"] = {
			1899,
			{ "00-stud", "42-otto" }
		},
		["Patnáctý"] = {
			1900,
			{ "28-otto" }
		},
		["Šestnáctý"] = {
			1900,
			{ "01-otto", "29-otto", "32-otto" }
		},
		["Sedmnáctý"] = {
			1901,
			{ "40-otto", "50-otto" }
		},
		["Osmnáctý"] = {
			1902,
			{ "01-stud", "31-otto", "56-otto" }
		},
		["Devatenáctý"] = {
			1902,
			{ "37-otto", "57-otto" }
		},
		["Dvacátý"] = {
			1903,
			{ "13-otto" }
		},
		["Dvacátýprvý"] = {
			1904,
			{ "35-otto", "53-otto" }
		},
		["Dvacátýdruhý"] = {
			1904,
			{ "16-otto", "36-otto" }
		},
		["Dvacátýtřetí"] = {
			1905,
			{ "47-otto" }
		},
		["Dvacátýčtvrtý"] = {
			1906,
			{ "21-otto", "24-otto", "39-otto" }
		},
		["Dvacátýpátý"] = {
			1906,
			{ "12-otto" }
		},
		["Dvacátýšestý"] = {
			1907,
			{ "41-otto" }
		},
		["Dvacátýsedmý"] = {
			1908,
			{ "20-otto", "43-otto" }
		}
	}
	
	local output = ""
	local moduleArgs = frame.args
	
	local value = mw.text.trim( moduleArgs[1] or "" )
	
	local valueType
	
	if mw.ustring.match( value, "https?://" ) ~= nil then
		
		if mw.ustring.match( value, "https?://.*https?://" ) ~= nil then
			
			valueType = "(více URL)"
			
		else
			
			local dil, rok, protocol, www, idNum, idStr
			
			dil, rok, protocol, idNum, idStr = mw.ustring.match( value, "''Ottův slovník naučný.'' (.-) díl%..-(%d%d%d%d).-(https?)://archive.org/stream/ottvslovnknauni(%d%d)(%l%l%l%l)goog#page/n%d-" )
			www = "∅"
			
			if not dil then
				dil, rok, protocol, idNum, idStr = mw.ustring.match( value, "''Ottův slovník naučný.'' (.-) díl%..-(%d%d%d%d).-(https?)://www.archive.org/stream/ottvslovnknauni(%d%d)(%l%l%l%l)goog#page/n%d-" )
				www = "www"
			end
			
			if dil then
				local mode = mw.ustring.match( value, "''Ottův slovník naučný.'' .- díl%..-%d%d%d%d.-ottvslovnknauni%d%d%l%l%l%lgoog#page/n%d-/mode/(%d)up" )
				if mode then
					valueType = string.format( "archive-%s-%s-%s-%s-%s-%s-%s", dil, rok, protocol, www, idNum, idStr, mode )
				else
					valueType = string.format( "archive-%s-%s-%s-%s-%s-%s", dil, rok, protocol, www, idNum, idStr )
				end
				if not osnSources[dil] then
					output = output .. "{{Chyba|text=OSN: Neznámý název dílu|kategorie=Opravit zdroj OSN hesla}}"
				else
					if tonumber( rok ) ~= osnSources[dil][1] then
						output = output .. "{{Chyba|text=OSN: Nekorespondující rok vydání k číslu dílu|kategorie=Opravit zdroj OSN hesla}}"
					end
					local validUrl = false
					for _, url in ipairs( osnSources[dil][2] ) do
						if idNum .. "-" .. idStr == url then
							validUrl = true
						end
					end
					if not validUrl then
						output = output .. "{{Chyba|text=OSN: Nekorespondující URL k číslu dílu|kategorie=Opravit zdroj OSN hesla}}"
					end
				end
			elseif mw.ustring.match( value, "kramerius" ) then
				valueType = "kramerius"
			else
				valueType = "(nestandardní zápis)"
			end
			
		end
		
	else
		valueType = "(bez URL)"
	end
	
	output = output .. string.format( "[[Kategorie:Monitoring:Textinfo/ZDROJ/= OSN-%s]]", valueType )
	
	output = frame:preprocess( output )
	
	return output
	
end


-- @brief
--  Monitors the presence of tables in Ottův slovník naučný pages.
-- 
-- @param
--  frame The current frame object
-- 
-- @return
--  Preprocessed wikitext
function _module.monitorOsnTables( frame )
	
	local titleObject = mw.title.getCurrentTitle()
	
	if not mw.ustring.match( titleObject.text, "^Ottův slovník naučný" ) then
		return
	end
	
	local tableTypes = {
		["wiki"] = "{|",
		["HTML"] = "<table"
	}
	
	local output = ""
	
	for tableType, tableCode in pairs( tableTypes ) do
		
		local n = select( 2, mw.ustring.gsub( titleObject:getContent(), tableCode, "%0" ) )
		
		if n > 0 then 
			output = string.format( "%s[[Kategorie:Monitoring:Heslo Ottova slovníku naučného obsahující %s tabulku (%d×)]]", output, tableType, n )
		end
		
	end
	
	output = frame:preprocess( output )
	
	return output
	
end


----------------------------------------
return _module