<?xml version="1.0"?>
<feed xmlns="http://www.w3.org/2005/Atom" xml:lang="yi">
	<id>https://yi.hamichlol.org.il/w/index.php?action=history&amp;feed=atom&amp;title=%D7%99%D7%97%D7%99%D7%93%D7%94%3AReadTd</id>
	<title>יחידה:ReadTd - ווערסיע היסטאריע</title>
	<link rel="self" type="application/atom+xml" href="https://yi.hamichlol.org.il/w/index.php?action=history&amp;feed=atom&amp;title=%D7%99%D7%97%D7%99%D7%93%D7%94%3AReadTd"/>
	<link rel="alternate" type="text/html" href="https://yi.hamichlol.org.il/w/index.php?title=%D7%99%D7%97%D7%99%D7%93%D7%94:ReadTd&amp;action=history"/>
	<updated>2026-04-22T11:21:53Z</updated>
	<subtitle>ווערסיע היסטאריע פאר דעם בלאט אויפן וויקי</subtitle>
	<generator>MediaWiki 1.39.4</generator>
	<entry>
		<id>https://yi.hamichlol.org.il/w/index.php?title=%D7%99%D7%97%D7%99%D7%93%D7%94:ReadTd&amp;diff=296108&amp;oldid=prev</id>
		<title>צמא לדעת אין 20:53, 29 אקטאבער 2023</title>
		<link rel="alternate" type="text/html" href="https://yi.hamichlol.org.il/w/index.php?title=%D7%99%D7%97%D7%99%D7%93%D7%94:ReadTd&amp;diff=296108&amp;oldid=prev"/>
		<updated>2023-10-29T20:53:00Z</updated>

		<summary type="html">&lt;p&gt;&lt;/p&gt;
&lt;table style=&quot;background-color: #fff; color: #202122;&quot; data-mw=&quot;interface&quot;&gt;
				&lt;col class=&quot;diff-marker&quot; /&gt;
				&lt;col class=&quot;diff-content&quot; /&gt;
				&lt;col class=&quot;diff-marker&quot; /&gt;
				&lt;col class=&quot;diff-content&quot; /&gt;
				&lt;tr class=&quot;diff-title&quot; lang=&quot;yi&quot;&gt;
				&lt;td colspan=&quot;2&quot; style=&quot;background-color: #fff; color: #202122; text-align: center;&quot;&gt;→ עלטערע  ווערסיע&lt;/td&gt;
				&lt;td colspan=&quot;2&quot; style=&quot;background-color: #fff; color: #202122; text-align: center;&quot;&gt;רעוויזיע פון 20:53, 29 אקטאבער 2023&lt;/td&gt;
				&lt;/tr&gt;&lt;tr&gt;&lt;td colspan=&quot;2&quot; class=&quot;diff-lineno&quot; id=&quot;mw-diff-left-l36&quot;&gt;שורה 36:&lt;/td&gt;
&lt;td colspan=&quot;2&quot; class=&quot;diff-lineno&quot;&gt;שורה 36:&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td class=&quot;diff-marker&quot;&gt;&lt;/td&gt;&lt;td style=&quot;background-color: #f8f9fa; color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #eaecf0; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;function readTemplateData( templateName )&lt;/div&gt;&lt;/td&gt;&lt;td class=&quot;diff-marker&quot;&gt;&lt;/td&gt;&lt;td style=&quot;background-color: #f8f9fa; color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #eaecf0; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;function readTemplateData( templateName )&lt;/div&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td class=&quot;diff-marker&quot;&gt;&lt;/td&gt;&lt;td style=&quot;background-color: #f8f9fa; color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #eaecf0; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;	if type( templateName ) == 'string' then  &lt;/div&gt;&lt;/td&gt;&lt;td class=&quot;diff-marker&quot;&gt;&lt;/td&gt;&lt;td style=&quot;background-color: #f8f9fa; color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #eaecf0; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;	if type( templateName ) == 'string' then  &lt;/div&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td class=&quot;diff-marker&quot; data-marker=&quot;−&quot;&gt;&lt;/td&gt;&lt;td style=&quot;color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #ffe49c; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;		templateName = { templateName, templateName .. '/' .. docSubPage }&lt;/div&gt;&lt;/td&gt;&lt;td class=&quot;diff-marker&quot; data-marker=&quot;+&quot;&gt;&lt;/td&gt;&lt;td style=&quot;color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #a3d3ff; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;		templateName = { templateName, templateName .. '/' .. docSubPage&lt;ins style=&quot;font-weight: bold; text-decoration: none;&quot;&gt;, templateName .. '/Doc', templateName .. '/דאק' &lt;/ins&gt;}&lt;/div&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td class=&quot;diff-marker&quot;&gt;&lt;/td&gt;&lt;td style=&quot;background-color: #f8f9fa; color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #eaecf0; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;	end&lt;/div&gt;&lt;/td&gt;&lt;td class=&quot;diff-marker&quot;&gt;&lt;/td&gt;&lt;td style=&quot;background-color: #f8f9fa; color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #eaecf0; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;	end&lt;/div&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td class=&quot;diff-marker&quot;&gt;&lt;/td&gt;&lt;td style=&quot;background-color: #f8f9fa; color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #eaecf0; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;	if type( templateName ) == &amp;quot;table&amp;quot; then&lt;/div&gt;&lt;/td&gt;&lt;td class=&quot;diff-marker&quot;&gt;&lt;/td&gt;&lt;td style=&quot;background-color: #f8f9fa; color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #eaecf0; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;	if type( templateName ) == &amp;quot;table&amp;quot; then&lt;/div&gt;&lt;/td&gt;&lt;/tr&gt;

&lt;!-- diff cache key hamichlol_main_yi-mw_:diff::1.12:old-85076:rev-296108 --&gt;
&lt;/table&gt;</summary>
		<author><name>צמא לדעת</name></author>
	</entry>
	<entry>
		<id>https://yi.hamichlol.org.il/w/index.php?title=%D7%99%D7%97%D7%99%D7%93%D7%94:ReadTd&amp;diff=85076&amp;oldid=prev</id>
		<title>גאון הירדן: ייבוא מוויקיפדיה העברית, ראה רשימת התורמים</title>
		<link rel="alternate" type="text/html" href="https://yi.hamichlol.org.il/w/index.php?title=%D7%99%D7%97%D7%99%D7%93%D7%94:ReadTd&amp;diff=85076&amp;oldid=prev"/>
		<updated>2022-11-24T18:22:06Z</updated>

		<summary type="html">&lt;p&gt;ייבוא מוויקיפדיה העברית, ראה רשימת התורמים&lt;/p&gt;
&lt;p&gt;&lt;b&gt;נייער בלאַט&lt;/b&gt;&lt;/p&gt;&lt;div&gt;--[[&lt;br /&gt;
&lt;br /&gt;
templatedata services for other modules. &lt;br /&gt;
template-invokable method, testTemplateData() for testing purposes only.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
Methods:&lt;br /&gt;
	_readTemplateData( templateName )&lt;br /&gt;
		internal method. receives a page name, tries to see if it exists, and contains valid templatedata.&lt;br /&gt;
		if there is valid templatedata, it extracts the json, and uses mw methods to return a lua table containing the data.&lt;br /&gt;
		otherwise, returns nil&lt;br /&gt;
&lt;br /&gt;
	readTemplateData( templateName )&lt;br /&gt;
		gets a pagename or an array of names, and cycles through them, trying to get templatedata from this file.&lt;br /&gt;
		when it gets a valid structure, it returns it, otherwise keep cycling.&lt;br /&gt;
		templateName can be a string or a table. if it's a string, it's assumed to be a template page name, &lt;br /&gt;
		where valid templatedata exists in the page or in a subpage whose name is in the local variable docSubPage&lt;br /&gt;
&lt;br /&gt;
	testTemplateData( templateName ): for testing. invokable from template. dumps templatedata lua object, using mw.dumpObject.&lt;br /&gt;
	&lt;br /&gt;
	compat( templateName ): backword-compatability for validation module expecting subpage in specific structure. &lt;br /&gt;
]]&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
local docSubPage = 'תיעוד'&lt;br /&gt;
&lt;br /&gt;
function _readTemplateData( templateName ) &lt;br /&gt;
	local title = mw.title.makeTitle( 0, templateName )  &lt;br /&gt;
	local templateContent = title and title.exists and title:getContent() -- template's raw content&lt;br /&gt;
	local capture =  templateContent and mw.ustring.match( templateContent, '&amp;lt;templatedata%s*&amp;gt;(.*)&amp;lt;/templatedata%s*&amp;gt;' ) -- templatedata as text&lt;br /&gt;
--	capture = capture and mw.ustring.gsub( capture, '&amp;quot;(%d+)&amp;quot;', tonumber ) -- convert &amp;quot;1&amp;quot;: {} to 1: {}. frame.args uses numerical indexes for order-based params.&lt;br /&gt;
	if capture then return pcall( mw.text.jsonDecode, capture ) end&lt;br /&gt;
	return false&lt;br /&gt;
end&lt;br /&gt;
&lt;br /&gt;
function readTemplateData( templateName )&lt;br /&gt;
	if type( templateName ) == 'string' then &lt;br /&gt;
		templateName = { templateName, templateName .. '/' .. docSubPage }&lt;br /&gt;
	end&lt;br /&gt;
	if type( templateName ) == &amp;quot;table&amp;quot; then&lt;br /&gt;
		for _, name in ipairs( templateName ) do&lt;br /&gt;
			local td, result = _readTemplateData( name ) &lt;br /&gt;
			if td then return result end&lt;br /&gt;
		end&lt;br /&gt;
	end&lt;br /&gt;
	return nil&lt;br /&gt;
end&lt;br /&gt;
&lt;br /&gt;
function testTemplateData( frame )&lt;br /&gt;
	local tmplateName = frame.args['שם התבנית'] or frame.args[1]&lt;br /&gt;
	local td = readTemplateData( tmplateName )&lt;br /&gt;
&lt;br /&gt;
	return td and mw.dumpObject( td ) or ''&lt;br /&gt;
end&lt;br /&gt;
&lt;br /&gt;
function compat( template ) &lt;br /&gt;
	local td = readTemplateData( template )&lt;br /&gt;
	if not td or not td['params'] then return nil end&lt;br /&gt;
	&lt;br /&gt;
	local params = td['params']&lt;br /&gt;
	local unnamedCount = #params&lt;br /&gt;
	local paramnames = {}&lt;br /&gt;
	local required = {}&lt;br /&gt;
	&lt;br /&gt;
	for paramname, paramobject in pairs( params ) do&lt;br /&gt;
		table.insert( paramnames, paramname )&lt;br /&gt;
		if paramobject.required then &lt;br /&gt;
			table.insert( required, paramname )	&lt;br /&gt;
		end&lt;br /&gt;
	end&lt;br /&gt;
	return { unnamedCount, paramnames, required, {} }&lt;br /&gt;
end&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
return { &lt;br /&gt;
	['ReadTemplateData'] = readTemplateData,&lt;br /&gt;
	['compat'] = compat,&lt;br /&gt;
	['בדיקה'] = testTemplateData, &lt;br /&gt;
	['testTemplateData'] = testTemplateData,&lt;br /&gt;
	}&lt;/div&gt;</summary>
		<author><name>גאון הירדן</name></author>
	</entry>
</feed>