<?xml version="1.0"?>
<feed xmlns="http://www.w3.org/2005/Atom" xml:lang="en">
	<id>https://sureshjoshi.org/index.php?action=history&amp;feed=atom&amp;title=Module%3ARow_numbers</id>
	<title>Module:Row numbers - Revision history</title>
	<link rel="self" type="application/atom+xml" href="https://sureshjoshi.org/index.php?action=history&amp;feed=atom&amp;title=Module%3ARow_numbers"/>
	<link rel="alternate" type="text/html" href="https://sureshjoshi.org/index.php?title=Module:Row_numbers&amp;action=history"/>
	<updated>2026-05-13T23:09:45Z</updated>
	<subtitle>Revision history for this page on the wiki</subtitle>
	<generator>MediaWiki 1.36.1</generator>
	<entry>
		<id>https://sureshjoshi.org/index.php?title=Module:Row_numbers&amp;diff=161&amp;oldid=prev</id>
		<title>Jayprakash12345: 1 revision imported</title>
		<link rel="alternate" type="text/html" href="https://sureshjoshi.org/index.php?title=Module:Row_numbers&amp;diff=161&amp;oldid=prev"/>
		<updated>2021-09-26T15:44:22Z</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&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 15:44, 26 September 2021&lt;/td&gt;
				&lt;/tr&gt;&lt;tr&gt;&lt;td colspan=&quot;2&quot; class=&quot;diff-notice&quot; lang=&quot;en&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>Jayprakash12345</name></author>
	</entry>
	<entry>
		<id>https://sureshjoshi.org/index.php?title=Module:Row_numbers&amp;diff=160&amp;oldid=prev</id>
		<title>en&gt;Jayprakash12345: Created page with &quot;require('Module:No globals');  local count; local hcount;   --[[--------------------------&lt; G E T _ C O U N T &gt;------------------------------------------------------------  re...&quot;</title>
		<link rel="alternate" type="text/html" href="https://sureshjoshi.org/index.php?title=Module:Row_numbers&amp;diff=160&amp;oldid=prev"/>
		<updated>2021-06-03T05:18:25Z</updated>

		<summary type="html">&lt;p&gt;Created page with &amp;quot;require(&amp;#039;Module:No globals&amp;#039;);  local count; local hcount;   --[[--------------------------&amp;lt; G E T _ C O U N T &amp;gt;------------------------------------------------------------  re...&amp;quot;&lt;/p&gt;
&lt;p&gt;&lt;b&gt;New page&lt;/b&gt;&lt;/p&gt;&lt;div&gt;require('Module:No globals');&lt;br /&gt;
&lt;br /&gt;
local count;&lt;br /&gt;
local hcount;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
--[[--------------------------&amp;lt; G E T _ C O U N T &amp;gt;------------------------------------------------------------&lt;br /&gt;
&lt;br /&gt;
returns a counter value according to the keyword extracted from the table; maintains count and hcount.  Inserts&lt;br /&gt;
a space character ahead of &amp;lt;count&amp;gt; or &amp;lt;hcount&amp;gt; so that, in the case of negative indexes, the negation operator &lt;br /&gt;
is not mistaken for part of the wikitable markup.  Returns:&lt;br /&gt;
	| -&amp;lt;count&amp;gt; – a cell value&lt;br /&gt;
instead of:&lt;br /&gt;
	|-&amp;lt;count&amp;gt; – row markup with extraneous text&lt;br /&gt;
&lt;br /&gt;
The keywords have the meanings:&lt;br /&gt;
	_row_count:			use row counter value (count); the hold counter (hcount) is same as count&lt;br /&gt;
	_row_count_hold:	use the value currently assigned to hcount; bump count but do not bump hcount&lt;br /&gt;
&lt;br /&gt;
]]&lt;br /&gt;
&lt;br /&gt;
local function get_count (keyword)&lt;br /&gt;
	count = count + 1;															-- always bump the count&lt;br /&gt;
	if '_row_count' == keyword then												-- bump hcount, return new count value&lt;br /&gt;
		hcount = count;&lt;br /&gt;
		return ' ' .. count;													-- insert a leading space ahead of count&lt;br /&gt;
	elseif '_row_count_hold' == keyword then									-- current hcount value without increment&lt;br /&gt;
		return ' ' .. hcount;													-- insert a leading space ahead of hcount&lt;br /&gt;
	end&lt;br /&gt;
end&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
--[[--------------------------&amp;lt; R O W _ N U M B E R S &amp;gt;--------------------------------------------------------&lt;br /&gt;
&lt;br /&gt;
replaces keywords _row_count and _row_count_hold from the table in frame.args[1]&lt;br /&gt;
&lt;br /&gt;
]]&lt;br /&gt;
&lt;br /&gt;
local function row_numbers (frame)&lt;br /&gt;
	if not frame.args[1]:match ('^%s*\127[^\127]*UNIQ%-%-nowiki%-%x%x%x%x%x%x%x%x%-QINU[^\127]*\127%s*$') then	-- make sure that what we get for input has been wrapped in &amp;lt;nowiki&amp;gt;...&amp;lt;/nowiki&amp;gt; tags&lt;br /&gt;
		return '&amp;lt;span style=\&amp;quot;font-size:100%; font-style:normal;\&amp;quot; class=\&amp;quot;error\&amp;quot;&amp;gt;error: missing nowiki tags&amp;lt;/span&amp;gt;';&lt;br /&gt;
	end&lt;br /&gt;
&lt;br /&gt;
	count = (frame.args.index and frame.args.index:match ('^%d+$') or 1) - 1;	-- only if a number; |index= may be omitted (nil), or empty string, or non-digit; initial value is 0&lt;br /&gt;
&lt;br /&gt;
	local tbl_str = mw.text.unstripNoWiki (frame.args[1]);						-- get the table from the nowiki tags passed as arguments&lt;br /&gt;
&lt;br /&gt;
	tbl_str = tbl_str:gsub ('&amp;amp;lt;', '&amp;lt;');										-- undo &amp;lt;nowiki&amp;gt;'s escaping of the wikitext&lt;br /&gt;
	tbl_str = tbl_str:gsub ('&amp;amp;gt;', '&amp;gt;');										-- (mw.text.decode (tbl_str); is too aggressive)&lt;br /&gt;
&lt;br /&gt;
	return frame:preprocess (tbl_str:gsub('_row_count[_%w]*', get_count));		-- if there is at least one of our special reserved words, replace it with a count&lt;br /&gt;
end&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
--[[--------------------------&amp;lt; E X P O R T E D   F U N C T I O N S &amp;gt;------------------------------------------&lt;br /&gt;
]]&lt;br /&gt;
&lt;br /&gt;
return {&lt;br /&gt;
	row_numbers = row_numbers&lt;br /&gt;
	}&lt;/div&gt;</summary>
		<author><name>en&gt;Jayprakash12345</name></author>
	</entry>
</feed>