Modul:Excerpt: Perbedaan antara revisi
Konten dihapus Konten ditambahkan
Sophivorus (bicara | kontrib) k Sophivorus memindahkan halaman Modul:Extract ke Modul:Excerpt tanpa membuat pengalihan |
Sophivorus (bicara | kontrib) Tidak ada ringkasan suntingan |
||
Baris 3:
local yesno = require('Module:Yesno')
local ok, config = pcall(require, 'Module:
if not ok then config = {} end
Baris 33:
local ok, TNT = pcall(require, 'Module:TNT')
if not ok then return key end
return TNT.format('I18n/Module:
end
Baris 50:
-- Set variables
local fragment = getArg('fragment')
local section = fragment or getArg(2, getArg('section', mw.ustring.match(getArg(1), '[^#]+#([^#]+)') ) )
local hat = yesno( getArg('hat', true) )
local this = getArg('this')
Baris 78:
hat = getMessage('section')
end
hat = hat .. ' ' .. getMessage('
if section and not fragment then
hat = hat .. '[[' .. page .. '#' .. mw.uri.anchorEncode(section) .. '|' .. page
Baris 86:
end
hat = hat .. "''" .. '<span class="mw-editsection-like plainlinks"><span class="mw-editsection-bracket">[</span>['
hat = hat .. title:fullUrl('action=edit') .. '
hat = hat .. ']<span class="mw-editsection-bracket">]</span></span>' .. "''"
local ok, Hatnote = pcall(require, 'Module:Hatnote')
if ok then
hat = Hatnote._hatnote( hat, { extraclasses = 'dablink
else
hat = mw.html.create('div'):addClass('dablink
end
else
Baris 101:
if more and not inline then
more = "'''[[" .. page .. '#' .. (section or '') .. "|" .. getMessage('more') .. "]]'''"
more = mw.html.create('div'):addClass('noprint
else
more = nil
Baris 119:
noBold = noBold,
noSelfLinks = true,
noNonFreeFiles = true,
noBehaviorSwitches = true,
fixReferences = true,
Baris 124 ⟶ 125:
}
-- Get the
local title = page .. '#' .. (section or '')
local ok,
if not ok then return getError(
if mw.text.trim(
if section then return getError('section-empty', section) else return getError('lead-empty') end
end
-- Add a line break in case the
-- If no file was found, try to
local fileNamespaces = Transcluder.getNamespaces('File')
if (files ~= '0' or not files) and not Transcluder.matchAny(
local templates = Transcluder.get(title, { only = 'templates', templates = templates, fixReferences = true } )
local parameters = Transcluder.getParameters(templates)
Baris 150 ⟶ 151:
if parameters[p] then caption = parameters[p] break end
end
break
end
Baris 157 ⟶ 158:
-- Remove nested categories
local categories,
-- Add tracking categories
Baris 164 ⟶ 165:
local contentCategory = config.categories.content
if contentCategory and mw.title.getCurrentTitle().isContentPage then
end
local namespaceCategory = config.categories[ mw.title.getCurrentTitle().namespace ]
if namespaceCategory then
end
end
Baris 187 ⟶ 188:
tag2 = 'blockquote'
end
local block = mw.html.create(tag2):addClass('
return block:node(styles):node(hat):node(
end
-- Entry points for backwards compatibility
function p.lead(frame) return p.main(frame) end
function p.excerpt(frame) return p.main(frame) end
return p
|