Modul:Unsubst: Perbedaan antara revisi

260 bita dihapus ,  2 tahun yang lalu
←Membuat halaman berisi 'local checkType = require('libraryUtil').checkType local p = {} local BODY_PARAM = '$B' local specialParams = { ['$params'] = 'daftar parameter', ['$aliases'] = 'alias parameter', ['$flags'] = 'bendera', ['$B'] = 'konten templat' } function p.main(frame, body) -- If we are substing, this function returns a template invocation, and if -- not, it returns the template body. The template body can be specified in -- the body parameter, or in the template pa...'
dw>Trappist the monk
(sync from sandbox; see talk;)
(←Membuat halaman berisi 'local checkType = require('libraryUtil').checkType local p = {} local BODY_PARAM = '$B' local specialParams = { ['$params'] = 'daftar parameter', ['$aliases'] = 'alias parameter', ['$flags'] = 'bendera', ['$B'] = 'konten templat' } function p.main(frame, body) -- If we are substing, this function returns a template invocation, and if -- not, it returns the template body. The template body can be specified in -- the body parameter, or in the template pa...')
Baris 6: Baris 6:


local specialParams = {
local specialParams = {
['$params'] = 'parameter list',
['$params'] = 'daftar parameter',
['$aliases'] = 'parameter aliases',
['$aliases'] = 'alias parameter',
['$flags'] = 'flags',
['$flags'] = 'bendera',
['$B'] = 'template content',
['$B'] = 'konten templat'
['$template-name'] = 'template invocation name override',
}
}


Baris 48: Baris 47:
-- Find the invocation name.
-- Find the invocation name.
local mTemplateInvocation = require('Module:Template invocation')
local mTemplateInvocation = require('Module:Template invocation')
local name
local name = mTemplateInvocation.name(frame:getParent():getTitle())
 
if frame.args['$template-name'] and '' ~= frame.args['$template-name'] then
name = frame.args['$template-name'] -- override whatever the template name is with this name
else
name = mTemplateInvocation.name(frame:getParent():getTitle())
end


-- Combine passed args with passed defaults
-- Combine passed args with passed defaults