<?xml version="1.0"?>
<feed xmlns="http://www.w3.org/2005/Atom" xml:lang="en-GB">
	<id>https://www.vigyanwiki.in/index.php?action=history&amp;feed=atom&amp;title=Module%3AExcerpt</id>
	<title>Module:Excerpt - Revision history</title>
	<link rel="self" type="application/atom+xml" href="https://www.vigyanwiki.in/index.php?action=history&amp;feed=atom&amp;title=Module%3AExcerpt"/>
	<link rel="alternate" type="text/html" href="https://www.vigyanwiki.in/index.php?title=Module:Excerpt&amp;action=history"/>
	<updated>2026-05-05T10:07:06Z</updated>
	<subtitle>Revision history for this page on the wiki</subtitle>
	<generator>MediaWiki 1.39.3</generator>
	<entry>
		<id>https://www.vigyanwiki.in/index.php?title=Module:Excerpt&amp;diff=40974&amp;oldid=prev</id>
		<title>Indicwiki: 1 revision imported from :alpha:Module:Excerpt</title>
		<link rel="alternate" type="text/html" href="https://www.vigyanwiki.in/index.php?title=Module:Excerpt&amp;diff=40974&amp;oldid=prev"/>
		<updated>2022-12-13T03:56:40Z</updated>

		<summary type="html">&lt;p&gt;1 revision imported from &lt;a href=&quot;https://alpha.indicwiki.in/index.php?title=Module:Excerpt&quot; class=&quot;extiw&quot; title=&quot;alpha:Module:Excerpt&quot;&gt;alpha:Module:Excerpt&lt;/a&gt;&lt;/p&gt;
&lt;table style=&quot;background-color: #fff; color: #202122;&quot; data-mw=&quot;interface&quot;&gt;
				&lt;tr class=&quot;diff-title&quot; lang=&quot;en-GB&quot;&gt;
				&lt;td colspan=&quot;1&quot; style=&quot;background-color: #fff; color: #202122; text-align: center;&quot;&gt;← Older revision&lt;/td&gt;
				&lt;td colspan=&quot;1&quot; style=&quot;background-color: #fff; color: #202122; text-align: center;&quot;&gt;Revision as of 09:26, 13 December 2022&lt;/td&gt;
				&lt;/tr&gt;&lt;tr&gt;&lt;td colspan=&quot;2&quot; class=&quot;diff-notice&quot; lang=&quot;en-GB&quot;&gt;&lt;div class=&quot;mw-diff-empty&quot;&gt;(No difference)&lt;/div&gt;
&lt;/td&gt;&lt;/tr&gt;&lt;/table&gt;</summary>
		<author><name>Indicwiki</name></author>
	</entry>
	<entry>
		<id>https://www.vigyanwiki.in/index.php?title=Module:Excerpt&amp;diff=26353&amp;oldid=prev</id>
		<title>Admin: Protected &quot;Module:Excerpt&quot; ([Edit=Allow only administrators] (indefinite) [Move=Allow only administrators] (indefinite)) [cascading]</title>
		<link rel="alternate" type="text/html" href="https://www.vigyanwiki.in/index.php?title=Module:Excerpt&amp;diff=26353&amp;oldid=prev"/>
		<updated>2022-11-24T06:32:32Z</updated>

		<summary type="html">&lt;p&gt;Protected &amp;quot;&lt;a href=&quot;/wiki/Module:Excerpt&quot; title=&quot;Module:Excerpt&quot;&gt;Module:Excerpt&lt;/a&gt;&amp;quot; ([Edit=Allow only administrators] (indefinite) [Move=Allow only administrators] (indefinite)) [cascading]&lt;/p&gt;
&lt;table style=&quot;background-color: #fff; color: #202122;&quot; data-mw=&quot;interface&quot;&gt;
				&lt;tr class=&quot;diff-title&quot; lang=&quot;en-GB&quot;&gt;
				&lt;td colspan=&quot;1&quot; style=&quot;background-color: #fff; color: #202122; text-align: center;&quot;&gt;← Older revision&lt;/td&gt;
				&lt;td colspan=&quot;1&quot; style=&quot;background-color: #fff; color: #202122; text-align: center;&quot;&gt;Revision as of 12:02, 24 November 2022&lt;/td&gt;
				&lt;/tr&gt;&lt;tr&gt;&lt;td colspan=&quot;2&quot; class=&quot;diff-notice&quot; lang=&quot;en-GB&quot;&gt;&lt;div class=&quot;mw-diff-empty&quot;&gt;(No difference)&lt;/div&gt;
&lt;/td&gt;&lt;/tr&gt;&lt;/table&gt;</summary>
		<author><name>Admin</name></author>
	</entry>
	<entry>
		<id>https://www.vigyanwiki.in/index.php?title=Module:Excerpt&amp;diff=26341&amp;oldid=prev</id>
		<title>Admin: 1 revision imported</title>
		<link rel="alternate" type="text/html" href="https://www.vigyanwiki.in/index.php?title=Module:Excerpt&amp;diff=26341&amp;oldid=prev"/>
		<updated>2022-11-24T06:32:01Z</updated>

		<summary type="html">&lt;p&gt;1 revision imported&lt;/p&gt;
&lt;table style=&quot;background-color: #fff; color: #202122;&quot; data-mw=&quot;interface&quot;&gt;
				&lt;tr class=&quot;diff-title&quot; lang=&quot;en-GB&quot;&gt;
				&lt;td colspan=&quot;1&quot; style=&quot;background-color: #fff; color: #202122; text-align: center;&quot;&gt;← Older revision&lt;/td&gt;
				&lt;td colspan=&quot;1&quot; style=&quot;background-color: #fff; color: #202122; text-align: center;&quot;&gt;Revision as of 12:02, 24 November 2022&lt;/td&gt;
				&lt;/tr&gt;&lt;tr&gt;&lt;td colspan=&quot;2&quot; class=&quot;diff-notice&quot; lang=&quot;en-GB&quot;&gt;&lt;div class=&quot;mw-diff-empty&quot;&gt;(No difference)&lt;/div&gt;
&lt;/td&gt;&lt;/tr&gt;&lt;/table&gt;</summary>
		<author><name>Admin</name></author>
	</entry>
	<entry>
		<id>https://www.vigyanwiki.in/index.php?title=Module:Excerpt&amp;diff=26340&amp;oldid=prev</id>
		<title>wikipedia&gt;Sophivorus: Update to 1.5 (non free files are now removed by default, and inline excerpts now use no tags rather than &lt;span&gt; tags)</title>
		<link rel="alternate" type="text/html" href="https://www.vigyanwiki.in/index.php?title=Module:Excerpt&amp;diff=26340&amp;oldid=prev"/>
		<updated>2022-09-30T14:39:16Z</updated>

		<summary type="html">&lt;p&gt;Update to 1.5 (non free files are now removed by default, and inline excerpts now use no tags rather than &amp;lt;span&amp;gt; tags)&lt;/p&gt;
&lt;a href=&quot;https://www.vigyanwiki.in/index.php?title=Module:Excerpt&amp;amp;diff=26340&amp;amp;oldid=40973&quot;&gt;Show changes&lt;/a&gt;</summary>
		<author><name>wikipedia&gt;Sophivorus</name></author>
	</entry>
	<entry>
		<id>https://www.vigyanwiki.in/index.php?title=Module:Excerpt&amp;diff=40973&amp;oldid=prev</id>
		<title>alpha&gt;Sarika: Created page with &quot;local Transcluder = require('Module:Transcluder')  local yesno = require('Module:Yesno')  local ok, config = pcall(require, 'Module:Excerpt/config') if not ok then config = {}...&quot;</title>
		<link rel="alternate" type="text/html" href="https://www.vigyanwiki.in/index.php?title=Module:Excerpt&amp;diff=40973&amp;oldid=prev"/>
		<updated>2022-05-20T14:38:47Z</updated>

		<summary type="html">&lt;p&gt;Created page with &amp;quot;local Transcluder = require(&amp;#039;Module:Transcluder&amp;#039;)  local yesno = require(&amp;#039;Module:Yesno&amp;#039;)  local ok, config = pcall(require, &amp;#039;Module:Excerpt/config&amp;#039;) if not ok then config = {}...&amp;quot;&lt;/p&gt;
&lt;p&gt;&lt;b&gt;New page&lt;/b&gt;&lt;/p&gt;&lt;div&gt;local Transcluder = require('Module:Transcluder')&lt;br /&gt;
&lt;br /&gt;
local yesno = require('Module:Yesno')&lt;br /&gt;
&lt;br /&gt;
local ok, config = pcall(require, 'Module:Excerpt/config')&lt;br /&gt;
if not ok then config = {} end&lt;br /&gt;
&lt;br /&gt;
local p = {}&lt;br /&gt;
&lt;br /&gt;
-- Helper function to get arguments&lt;br /&gt;
local args&lt;br /&gt;
function getArg(key, default)&lt;br /&gt;
	value = args[key]&lt;br /&gt;
	if value and mw.text.trim(value) ~= '' then&lt;br /&gt;
		return value&lt;br /&gt;
	end&lt;br /&gt;
	return default&lt;br /&gt;
end&lt;br /&gt;
&lt;br /&gt;
-- Helper function to handle errors&lt;br /&gt;
function getError(message, value)&lt;br /&gt;
	if type(message) == 'string' then&lt;br /&gt;
		message = Transcluder.getError(message, value)&lt;br /&gt;
	end&lt;br /&gt;
	if config.categories and config.categories.errors and mw.title.getCurrentTitle().isContentPage then&lt;br /&gt;
		message:node('[[Category:' .. config.categories.errors .. ']]')&lt;br /&gt;
	end&lt;br /&gt;
	return message&lt;br /&gt;
end&lt;br /&gt;
&lt;br /&gt;
-- Helper function to get localized messages&lt;br /&gt;
function getMessage(key)&lt;br /&gt;
	local ok, TNT = pcall(require, 'Module:TNT')&lt;br /&gt;
	if not ok then return key end&lt;br /&gt;
	return TNT.format('I18n/Module:Excerpt.tab', key)&lt;br /&gt;
end&lt;br /&gt;
&lt;br /&gt;
function p.main(frame)&lt;br /&gt;
	args = Transcluder.parseArgs(frame)&lt;br /&gt;
&lt;br /&gt;
	-- Make sure the requested page exists&lt;br /&gt;
	local page = getArg(1)&lt;br /&gt;
	if not page then return getError('no-page') end&lt;br /&gt;
	local title = mw.title.new(page)&lt;br /&gt;
	if not title then return getError('no-page') end&lt;br /&gt;
	if title.isRedirect then title = title.redirectTarget end&lt;br /&gt;
	if not title.exists then return getError('page-not-found', page) end&lt;br /&gt;
	page = title.prefixedText&lt;br /&gt;
&lt;br /&gt;
	-- Set variables&lt;br /&gt;
	local section = getArg(2, mw.ustring.match( getArg(1), '[^#]+#(.+)') )&lt;br /&gt;
	local hat = yesno( getArg('hat', true) )&lt;br /&gt;
	local edit = yesno( getArg('edit', true) )&lt;br /&gt;
	local this = getArg('this')&lt;br /&gt;
	local only = getArg('only')&lt;br /&gt;
	local files = getArg('files', getArg('file', ( only == 'file' and 1 ) ) )&lt;br /&gt;
	local lists = getArg('lists', getArg('list', ( only == 'list' and 1 ) ) )&lt;br /&gt;
	local tables = getArg('tables', getArg('table', ( only == 'table' and 1 ) ) )&lt;br /&gt;
	local templates = getArg('templates', getArg('template', ( only == 'template' and 1 ) ) )&lt;br /&gt;
	local paragraphs = getArg('paragraphs', getArg('paragraph', ( only == 'paragraph' and 1 ) ) )&lt;br /&gt;
	local references = getArg('references')&lt;br /&gt;
	local subsections = not yesno( getArg('subsections') )&lt;br /&gt;
	local noBold = not yesno( getArg('bold') )&lt;br /&gt;
	local inline = yesno( getArg('inline') )&lt;br /&gt;
	local quote = yesno( getArg('quote') )&lt;br /&gt;
	local more = yesno( getArg('more') )&lt;br /&gt;
	local class = getArg('class')&lt;br /&gt;
&lt;br /&gt;
	-- Build the hatnote&lt;br /&gt;
	if hat and not inline then&lt;br /&gt;
		if this then&lt;br /&gt;
			hat = this&lt;br /&gt;
		elseif quote then&lt;br /&gt;
			hat = getMessage('this')&lt;br /&gt;
		elseif only then&lt;br /&gt;
			hat = getMessage(only)&lt;br /&gt;
		else&lt;br /&gt;
			hat = getMessage('section')&lt;br /&gt;
		end&lt;br /&gt;
		hat = hat .. ' ' .. getMessage('excerpt') .. ' '&lt;br /&gt;
		if section and not fragment then&lt;br /&gt;
			hat = hat .. '[[:' .. page .. '#' .. mw.uri.anchorEncode(section) .. '|' .. page&lt;br /&gt;
				.. ' § ' .. mw.ustring.gsub(section, '%[%[([^]|]+)|?[^]]*%]%]', '%1') .. ']].' -- remove nested links&lt;br /&gt;
		else&lt;br /&gt;
			hat = hat .. '[[:' .. page .. '|' .. page .. ']].'&lt;br /&gt;
		end&lt;br /&gt;
		if edit then&lt;br /&gt;
			hat = hat .. '&amp;lt;span class=&amp;quot;mw-editsection-like plainlinks&amp;quot;&amp;gt;&amp;lt;span class=&amp;quot;mw-editsection-bracket&amp;quot;&amp;gt;[&amp;lt;/span&amp;gt;['&lt;br /&gt;
			hat = hat .. title:fullUrl('action=edit') .. ' ' .. mw.message.new('editsection'):plain()&lt;br /&gt;
			hat = hat .. ']&amp;lt;span class=&amp;quot;mw-editsection-bracket&amp;quot;&amp;gt;]&amp;lt;/span&amp;gt;&amp;lt;/span&amp;gt;'&lt;br /&gt;
		end&lt;br /&gt;
		if config.hat then&lt;br /&gt;
			hat = config.hat .. hat .. '}}'&lt;br /&gt;
			hat = frame:preprocess(hat)&lt;br /&gt;
		else&lt;br /&gt;
			hat = mw.html.create('div'):addClass('dablink excerpt-hat'):wikitext(hat)&lt;br /&gt;
		end&lt;br /&gt;
	else&lt;br /&gt;
		hat = nil&lt;br /&gt;
	end&lt;br /&gt;
&lt;br /&gt;
	-- Build the &amp;quot;Read more&amp;quot; link&lt;br /&gt;
	if more and not inline then&lt;br /&gt;
		more = &amp;quot;'''[[&amp;quot; .. page .. '#' .. (section or '') .. &amp;quot;|&amp;quot; .. getMessage('more') .. &amp;quot;]]'''&amp;quot;&lt;br /&gt;
		more = mw.html.create('div'):addClass('noprint excerpt-more'):wikitext(more)&lt;br /&gt;
	else&lt;br /&gt;
		more = nil&lt;br /&gt;
	end&lt;br /&gt;
&lt;br /&gt;
	-- Build the templates option from the config blacklist&lt;br /&gt;
	local blacklist = config.blacklist and table.concat(config.blacklist, ',') or ''&lt;br /&gt;
	if templates then&lt;br /&gt;
		if string.sub(templates, 1, 1) == '-' then&lt;br /&gt;
			templates = templates .. ',' .. blacklist&lt;br /&gt;
		end&lt;br /&gt;
	else&lt;br /&gt;
		templates = '-' .. blacklist&lt;br /&gt;
	end&lt;br /&gt;
&lt;br /&gt;
	-- Build the options for Module:Transcluder out of the template arguments and the desired defaults&lt;br /&gt;
	local options = {&lt;br /&gt;
		files = files,&lt;br /&gt;
		lists = lists,&lt;br /&gt;
		tables = tables,&lt;br /&gt;
		paragraphs = paragraphs,&lt;br /&gt;
		templates = templates,&lt;br /&gt;
		sections = subsections,&lt;br /&gt;
		categories = 0,&lt;br /&gt;
		references = references,&lt;br /&gt;
		only = only and mw.text.trim(only, 's') .. 's',&lt;br /&gt;
		noBold = noBold,&lt;br /&gt;
		noSelfLinks = true,&lt;br /&gt;
		noNonFreeFiles = true,&lt;br /&gt;
		noBehaviorSwitches = true,&lt;br /&gt;
		fixReferences = true,&lt;br /&gt;
		linkBold = true,&lt;br /&gt;
	}&lt;br /&gt;
&lt;br /&gt;
	-- Get the excerpt itself&lt;br /&gt;
	local title = page .. '#' .. (section or '')&lt;br /&gt;
	local ok, excerpt = pcall(Transcluder.get, title, options)&lt;br /&gt;
	if not ok then return getError(excerpt) end&lt;br /&gt;
	if mw.text.trim(excerpt) == '' and not only then&lt;br /&gt;
		if section then return getError('section-empty', section) else return getError('lead-empty') end&lt;br /&gt;
	end&lt;br /&gt;
&lt;br /&gt;
	-- Add a line break before an after so that the parser interprets lists, tables, etc. correctly&lt;br /&gt;
	excerpt = '\n' .. excerpt .. '\n'&lt;br /&gt;
&lt;br /&gt;
	-- If no file was found, try to excerpt one from the removed infoboxes&lt;br /&gt;
	local fileNamespaces = Transcluder.getNamespaces('File')&lt;br /&gt;
	if ((only == 'file' or only == 'files') or (not only and (files ~= '0' or not files))) and -- caller asked for files&lt;br /&gt;
		not Transcluder.matchAny(excerpt, '%[%[', fileNamespaces, ':') and -- and there are no files in Transcluder's output&lt;br /&gt;
		config.captions -- and we have the config option required to try finding files in templates&lt;br /&gt;
	then&lt;br /&gt;
		local templates = Transcluder.get(title, { only = 'templates', templates = blacklist, fixReferences = true } )&lt;br /&gt;
		local parameters = Transcluder.getParameters(templates)&lt;br /&gt;
		local file, captions, caption&lt;br /&gt;
		for _, pair in pairs(config.captions) do&lt;br /&gt;
			file = pair[1]&lt;br /&gt;
			file = parameters[file]&lt;br /&gt;
			if file and Transcluder.matchAny(file, '^.*%.', {'[Jj][Pp][Ee]?[Gg]','[Pp][Nn][Gg]','[Gg][Ii][Ff]','[Ss][Vv][Gg]'}, '.*') then&lt;br /&gt;
				file = mw.ustring.match(file, '%[?%[?.-:([^{|]+)%]?%]?') or file -- [[File:Example.jpg{{!}}upright=1.5]] to Example.jpg&lt;br /&gt;
				captions = pair[2]&lt;br /&gt;
				for _, p in pairs(captions) do&lt;br /&gt;
					if parameters[p] then caption = parameters[p] break end&lt;br /&gt;
				end&lt;br /&gt;
				excerpt = '[[File:' .. file .. '|thumb|' .. (caption or '') .. ']]' .. excerpt&lt;br /&gt;
				excerpt = Transcluder.removeNonFreeFiles(excerpt)&lt;br /&gt;
				break&lt;br /&gt;
			end&lt;br /&gt;
		end&lt;br /&gt;
	end&lt;br /&gt;
&lt;br /&gt;
	-- Remove nested categories&lt;br /&gt;
	excerpt = frame:preprocess(excerpt)&lt;br /&gt;
	local categories, excerpt = Transcluder.getCategories(excerpt, options.categories)&lt;br /&gt;
&lt;br /&gt;
	-- Add tracking categories&lt;br /&gt;
	if config.categories then&lt;br /&gt;
		local contentCategory = config.categories.content&lt;br /&gt;
		if contentCategory and mw.title.getCurrentTitle().isContentPage then&lt;br /&gt;
			excerpt = excerpt .. '[[Category:' .. contentCategory .. ']]'&lt;br /&gt;
		end&lt;br /&gt;
		local namespaceCategory = config.categories[ mw.title.getCurrentTitle().namespace ]&lt;br /&gt;
		if namespaceCategory then&lt;br /&gt;
			excerpt = excerpt .. '[[Category:' .. namespaceCategory .. ']]'&lt;br /&gt;
		end&lt;br /&gt;
	end&lt;br /&gt;
&lt;br /&gt;
	-- Load the styles&lt;br /&gt;
	local styles&lt;br /&gt;
	if config.styles then&lt;br /&gt;
		styles = frame:extensionTag( 'templatestyles', '', { src = config.styles } )&lt;br /&gt;
	end&lt;br /&gt;
&lt;br /&gt;
	-- Combine and return the elements&lt;br /&gt;
	local tag1 = 'div'&lt;br /&gt;
	local tag2 = 'div'&lt;br /&gt;
	if inline then&lt;br /&gt;
		tag1 = 'span'&lt;br /&gt;
		tag2 = 'span'&lt;br /&gt;
	elseif quote then&lt;br /&gt;
		tag2 = 'blockquote'&lt;br /&gt;
	end&lt;br /&gt;
	excerpt = mw.html.create(tag1):addClass('excerpt'):wikitext(excerpt)&lt;br /&gt;
	local block = mw.html.create(tag2):addClass('excerpt-block'):addClass(class)&lt;br /&gt;
	return block:node(styles):node(hat):node(excerpt):node(more)&lt;br /&gt;
end&lt;br /&gt;
&lt;br /&gt;
-- Entry points for backwards compatibility&lt;br /&gt;
function p.lead(frame) return p.main(frame) end&lt;br /&gt;
function p.excerpt(frame) return p.main(frame) end&lt;br /&gt;
&lt;br /&gt;
return p&lt;/div&gt;</summary>
		<author><name>alpha&gt;Sarika</name></author>
	</entry>
</feed>