Modul:Text: Unterschied zwischen den Versionen

CamNet - das Wiki
imported>Oetterer
(Die Seite wurde neu angelegt: „--[[ This library provides access to some lua methods of the mw.text library for mediawiki templates/articles. ]] local text = {} local getArgs = require(…“)
(Änderung importierte Version 7088 von Benutzer imported>Oetterer rückgängig gemacht)
Markierung: Rückgängigmachung
 
(6 dazwischenliegende Versionen von 2 Benutzern werden nicht angezeigt)
Zeile 1: Zeile 1:
--[[
local p = {}
This library provides access to some lua methods of the mw.text library for
local Class = require('Module:Text/class')
mediawiki templates/articles.
local getArgs = require('Module:Arguments').getArgs
]]
 
function p.categorize(frame)
return tostring(Class:categorize())
end


local text = {}
function p.categoryPage(frame)
local getArgs = require('Module:Arguments').getArgs
return tostring(Class:categoryPage())
end
 
function p.explainDataStore(frame)
return tostring(Class:explainDataStore())
end
 
function p.gardeningCategoryPage(frame)
return tostring(Class:gardeningCategoryPage())
end


function text.killMarkers(frame)
function p.sfGenerateForm(frame)
local args = getArgs(frame)
return tostring(Class:sfGenerateForm())
return mw.text.killMarkers(args[1] or args.text )
end
end


function p.sfGenerateFormEntry(frame)
return tostring(Class:sfGenerateFormEntry())
end


function text.nowiki(frame)
function p.sfGenerateFormLink(frame)
local args = getArgs(frame)
return tostring(Class:sfGenerateFormLink())
local result = ''
local separator = '\n\n'
if args.sep then
separator = args.sep
args.sep = nil
end
if args.separator then
separator = args.separator
args.separator = nil
end
for _, v in pairs(args) do
result = result .. '(' .. #v .. '): ' .. mw.text.nowiki(v) .. separator
end
return result
end
end


function p.templateDocumentation(frame)
return tostring(Class:templateDocumentation())
end


function text.unstrip(frame)
function p.main(frame)
local args = getArgs(frame)
local args = getArgs(frame)
return mw.text.decode( mw.text.unstrip(args[1] or args.text) )
local me = Class:new(mw.title.getCurrentTitle().prefixedText)
me:initFromArgs(args)
me:storeData()
me:addInfobox()
me:addPageBody()
return me:render()
end
end


return text
return p

Aktuelle Version vom 25. Juni 2024, 21:14 Uhr

Documentation icon Module documentation

This module provides access to various lua functions from the mw.text library. See corresponding lua manual entries for more information.

{{#invoke:Text|function_name|args}}

See also


local p = {}
local Class = require('Module:Text/class')
local getArgs = require('Module:Arguments').getArgs

function p.categorize(frame)
	return tostring(Class:categorize())
end

function p.categoryPage(frame)
	return tostring(Class:categoryPage())
end

function p.explainDataStore(frame)
	return tostring(Class:explainDataStore())
end

function p.gardeningCategoryPage(frame)
	return tostring(Class:gardeningCategoryPage())
end

function p.sfGenerateForm(frame)
	return tostring(Class:sfGenerateForm())
end

function p.sfGenerateFormEntry(frame)
	return tostring(Class:sfGenerateFormEntry())
end

function p.sfGenerateFormLink(frame)
	return tostring(Class:sfGenerateFormLink())
end

function p.templateDocumentation(frame)
	return tostring(Class:templateDocumentation())
end

function p.main(frame)
	local args = getArgs(frame)
	local me = Class:new(mw.title.getCurrentTitle().prefixedText)
	me:initFromArgs(args)
	me:storeData()
	me:addInfobox()
	me:addPageBody()
 	return me:render()
end

return p