<?xml version="1.0"?>
<feed xmlns="http://www.w3.org/2005/Atom" xml:lang="uk">
		<id>http://wiki.isofts.kiev.ua/index.php?action=history&amp;feed=atom&amp;title=%D0%9C%D0%BE%D0%B4%D1%83%D0%BB%D1%8C%3AHatnote</id>
		<title>Модуль:Hatnote - Історія редагувань</title>
		<link rel="self" type="application/atom+xml" href="http://wiki.isofts.kiev.ua/index.php?action=history&amp;feed=atom&amp;title=%D0%9C%D0%BE%D0%B4%D1%83%D0%BB%D1%8C%3AHatnote"/>
		<link rel="alternate" type="text/html" href="http://wiki.isofts.kiev.ua/index.php?title=%D0%9C%D0%BE%D0%B4%D1%83%D0%BB%D1%8C:Hatnote&amp;action=history"/>
		<updated>2026-04-04T21:23:50Z</updated>
		<subtitle>Історія редагувань цієї сторінки в вікі</subtitle>
		<generator>MediaWiki 1.25.3</generator>

	<entry>
		<id>http://wiki.isofts.kiev.ua/index.php?title=%D0%9C%D0%BE%D0%B4%D1%83%D0%BB%D1%8C:Hatnote&amp;diff=639&amp;oldid=prev</id>
		<title>Kolk: Імпортовано 1 версія</title>
		<link rel="alternate" type="text/html" href="http://wiki.isofts.kiev.ua/index.php?title=%D0%9C%D0%BE%D0%B4%D1%83%D0%BB%D1%8C:Hatnote&amp;diff=639&amp;oldid=prev"/>
				<updated>2016-11-24T15:22:48Z</updated>
		
		<summary type="html">&lt;p&gt;Імпортовано 1 версія&lt;/p&gt;
&lt;table class='diff diff-contentalign-left'&gt;
				&lt;tr style='vertical-align: top;'&gt;
				&lt;td colspan='1' style=&quot;background-color: white; color:black; text-align: center;&quot;&gt;← Попередня версія&lt;/td&gt;
				&lt;td colspan='1' style=&quot;background-color: white; color:black; text-align: center;&quot;&gt;Версія за 15:22, 24 листопада 2016&lt;/td&gt;
				&lt;/tr&gt;&lt;tr&gt;&lt;td colspan='2' style='text-align: center;'&gt;&lt;div class=&quot;mw-diff-empty&quot;&gt;(Немає відмінностей)&lt;/div&gt;
&lt;/td&gt;&lt;/tr&gt;&lt;/table&gt;</summary>
		<author><name>Kolk</name></author>	</entry>

	<entry>
		<id>http://wiki.isofts.kiev.ua/index.php?title=%D0%9C%D0%BE%D0%B4%D1%83%D0%BB%D1%8C:Hatnote&amp;diff=638&amp;oldid=prev</id>
		<title>Nihiltres: Non-breaking space after &quot;§&quot; in _formatLink() to match Module:Section link; might not be a bad idea to require() that module but this is a good start</title>
		<link rel="alternate" type="text/html" href="http://wiki.isofts.kiev.ua/index.php?title=%D0%9C%D0%BE%D0%B4%D1%83%D0%BB%D1%8C:Hatnote&amp;diff=638&amp;oldid=prev"/>
				<updated>2016-06-23T14:47:33Z</updated>
		
		<summary type="html">&lt;p&gt;Non-breaking space after &amp;quot;§&amp;quot; in _formatLink() to match &lt;a href=&quot;/index.php?title=%D0%9C%D0%BE%D0%B4%D1%83%D0%BB%D1%8C:Section_link&amp;amp;action=edit&amp;amp;redlink=1&quot; class=&quot;new&quot; title=&quot;Модуль:Section link (такої сторінки не існує)&quot;&gt;Module:Section link&lt;/a&gt;; might not be a bad idea to require() that module but this is a good start&lt;/p&gt;
&lt;p&gt;&lt;b&gt;Нова сторінка&lt;/b&gt;&lt;/p&gt;&lt;div&gt;--------------------------------------------------------------------------------&lt;br /&gt;
--                              Module:Hatnote                                --&lt;br /&gt;
--                                                                            --&lt;br /&gt;
-- This module produces hatnote links and links to related articles. It       --&lt;br /&gt;
-- implements the {{hatnote}} and {{format link}} meta-templates and includes --&lt;br /&gt;
-- helper functions for other Lua hatnote modules.                            --&lt;br /&gt;
--------------------------------------------------------------------------------&lt;br /&gt;
&lt;br /&gt;
local libraryUtil = require('libraryUtil')&lt;br /&gt;
local checkType = libraryUtil.checkType&lt;br /&gt;
local mArguments -- lazily initialise [[Module:Arguments]]&lt;br /&gt;
local yesno -- lazily initialise [[Module:Yesno]]&lt;br /&gt;
&lt;br /&gt;
local p = {}&lt;br /&gt;
&lt;br /&gt;
--------------------------------------------------------------------------------&lt;br /&gt;
-- Helper functions&lt;br /&gt;
--------------------------------------------------------------------------------&lt;br /&gt;
&lt;br /&gt;
local function getArgs(frame)&lt;br /&gt;
	-- Fetches the arguments from the parent frame. Whitespace is trimmed and&lt;br /&gt;
	-- blanks are removed.&lt;br /&gt;
	mArguments = require('Module:Arguments')&lt;br /&gt;
	return mArguments.getArgs(frame, {parentOnly = true})&lt;br /&gt;
end&lt;br /&gt;
&lt;br /&gt;
local function removeInitialColon(s)&lt;br /&gt;
	-- Removes the initial colon from a string, if present.&lt;br /&gt;
	return s:match('^:?(.*)')&lt;br /&gt;
end&lt;br /&gt;
&lt;br /&gt;
function p.findNamespaceId(link, removeColon)&lt;br /&gt;
	-- Finds the namespace id (namespace number) of a link or a pagename. This&lt;br /&gt;
	-- function will not work if the link is enclosed in double brackets. Colons&lt;br /&gt;
	-- are trimmed from the start of the link by default. To skip colon&lt;br /&gt;
	-- trimming, set the removeColon parameter to false.&lt;br /&gt;
	checkType('findNamespaceId', 1, link, 'string')&lt;br /&gt;
	checkType('findNamespaceId', 2, removeColon, 'boolean', true)&lt;br /&gt;
	if removeColon ~= false then&lt;br /&gt;
		link = removeInitialColon(link)&lt;br /&gt;
	end&lt;br /&gt;
	local namespace = link:match('^(.-):')&lt;br /&gt;
	if namespace then&lt;br /&gt;
		local nsTable = mw.site.namespaces[namespace]&lt;br /&gt;
		if nsTable then&lt;br /&gt;
			return nsTable.id&lt;br /&gt;
		end&lt;br /&gt;
	end&lt;br /&gt;
	return 0&lt;br /&gt;
end&lt;br /&gt;
&lt;br /&gt;
function p.formatPages(...)&lt;br /&gt;
	-- Formats a list of pages using formatLink and returns it as an array. Nil&lt;br /&gt;
	-- values are not allowed.&lt;br /&gt;
	local pages = {...}&lt;br /&gt;
	local ret = {}&lt;br /&gt;
	for i, page in ipairs(pages) do&lt;br /&gt;
		ret[i] = p._formatLink(page)&lt;br /&gt;
	end&lt;br /&gt;
	return ret&lt;br /&gt;
end&lt;br /&gt;
&lt;br /&gt;
function p.formatPageTables(...)&lt;br /&gt;
	-- Takes a list of page/display tables and returns it as a list of&lt;br /&gt;
	-- formatted links. Nil values are not allowed.&lt;br /&gt;
	local pages = {...}&lt;br /&gt;
	local links = {}&lt;br /&gt;
	for i, t in ipairs(pages) do&lt;br /&gt;
		checkType('formatPageTables', i, t, 'table')&lt;br /&gt;
		local link = t[1]&lt;br /&gt;
		local display = t[2]&lt;br /&gt;
		links[i] = p._formatLink(link, display)&lt;br /&gt;
	end&lt;br /&gt;
	return links&lt;br /&gt;
end&lt;br /&gt;
&lt;br /&gt;
function p.makeWikitextError(msg, helpLink, addTrackingCategory, title)&lt;br /&gt;
	-- Formats an error message to be returned to wikitext. If&lt;br /&gt;
	-- addTrackingCategory is not false after being returned from&lt;br /&gt;
	-- [[Module:Yesno]], and if we are not on a talk page, a tracking category&lt;br /&gt;
	-- is added.&lt;br /&gt;
	checkType('makeWikitextError', 1, msg, 'string')&lt;br /&gt;
	checkType('makeWikitextError', 2, helpLink, 'string', true)&lt;br /&gt;
	yesno = require('Module:Yesno')&lt;br /&gt;
	title = title or mw.title.getCurrentTitle()&lt;br /&gt;
	-- Make the help link text.&lt;br /&gt;
	local helpText&lt;br /&gt;
	if helpLink then&lt;br /&gt;
		helpText = ' ([[' .. helpLink .. '|help]])'&lt;br /&gt;
	else&lt;br /&gt;
		helpText = ''&lt;br /&gt;
	end&lt;br /&gt;
	-- Make the category text.&lt;br /&gt;
	local category&lt;br /&gt;
	if not title.isTalkPage and yesno(addTrackingCategory) ~= false then&lt;br /&gt;
		category = 'Hatnote templates with errors'&lt;br /&gt;
		category = string.format(&lt;br /&gt;
			'[[%s:%s]]',&lt;br /&gt;
			mw.site.namespaces[14].name,&lt;br /&gt;
			category&lt;br /&gt;
		)&lt;br /&gt;
	else&lt;br /&gt;
		category = ''&lt;br /&gt;
	end&lt;br /&gt;
	return string.format(&lt;br /&gt;
		'&amp;lt;strong class=&amp;quot;error&amp;quot;&amp;gt;Error: %s%s.&amp;lt;/strong&amp;gt;%s',&lt;br /&gt;
		msg,&lt;br /&gt;
		helpText,&lt;br /&gt;
		category&lt;br /&gt;
	)&lt;br /&gt;
end&lt;br /&gt;
&lt;br /&gt;
function p.disambiguate(page, disambiguator)&lt;br /&gt;
	-- Formats a page title with a disambiguation parenthetical,&lt;br /&gt;
	-- i.e. &amp;quot;Example&amp;quot; → &amp;quot;Example (disambiguation)&amp;quot;.&lt;br /&gt;
	checkType('disambiguate', 1, page, 'string')&lt;br /&gt;
	checkType('disambiguate', 2, disambiguator, 'string', true)&lt;br /&gt;
	disambiguator = disambiguator or 'disambiguation'&lt;br /&gt;
	return string.format('%s (%s)', page, disambiguator)&lt;br /&gt;
end&lt;br /&gt;
&lt;br /&gt;
--------------------------------------------------------------------------------&lt;br /&gt;
-- Format link&lt;br /&gt;
--&lt;br /&gt;
-- Makes a wikilink from the given link and display values. Links are escaped&lt;br /&gt;
-- with colons if necessary, and links to sections are detected and displayed&lt;br /&gt;
-- with &amp;quot; § &amp;quot; as a separator rather than the standard MediaWiki &amp;quot;#&amp;quot;. Used in&lt;br /&gt;
-- the {{format hatnote link}} template.&lt;br /&gt;
--------------------------------------------------------------------------------&lt;br /&gt;
&lt;br /&gt;
function p.formatLink(frame)&lt;br /&gt;
	local args = getArgs(frame)&lt;br /&gt;
	local link = args[1]&lt;br /&gt;
	local display = args[2]&lt;br /&gt;
	if not link then&lt;br /&gt;
		return p.makeWikitextError(&lt;br /&gt;
			'no link specified',&lt;br /&gt;
			'Template:Format hatnote link#Errors',&lt;br /&gt;
			args.category&lt;br /&gt;
		)&lt;br /&gt;
	end&lt;br /&gt;
	return p._formatLink(link, display)&lt;br /&gt;
end&lt;br /&gt;
&lt;br /&gt;
function p._formatLink(link, display)&lt;br /&gt;
	checkType('_formatLink', 1, link, 'string')&lt;br /&gt;
	checkType('_formatLink', 2, display, 'string', true)&lt;br /&gt;
&lt;br /&gt;
	-- Remove the initial colon for links where it was specified manually.&lt;br /&gt;
	link = removeInitialColon(link)&lt;br /&gt;
&lt;br /&gt;
	-- Find whether a faux display value has been added with the {{!}} magic&lt;br /&gt;
	-- word.&lt;br /&gt;
	if not display then&lt;br /&gt;
		local prePipe, postPipe = link:match('^(.-)|(.*)$')&lt;br /&gt;
		link = prePipe or link&lt;br /&gt;
		display = postPipe&lt;br /&gt;
	end&lt;br /&gt;
&lt;br /&gt;
	-- Find the display value.&lt;br /&gt;
	if not display then&lt;br /&gt;
		local page, section = link:match('^(.-)#(.*)$')&lt;br /&gt;
		if page then&lt;br /&gt;
			display = page .. ' §&amp;amp;nbsp;' .. section&lt;br /&gt;
		end&lt;br /&gt;
	end&lt;br /&gt;
&lt;br /&gt;
	-- Assemble the link.&lt;br /&gt;
	if display then&lt;br /&gt;
		return string.format(&lt;br /&gt;
			'[[:%s|%s]]',&lt;br /&gt;
			string.gsub(link, '|(.*)$', ''), --display overwrites manual piping&lt;br /&gt;
			display&lt;br /&gt;
		)&lt;br /&gt;
	else&lt;br /&gt;
		return string.format('[[:%s]]', link)&lt;br /&gt;
	end&lt;br /&gt;
end&lt;br /&gt;
&lt;br /&gt;
--------------------------------------------------------------------------------&lt;br /&gt;
-- Hatnote&lt;br /&gt;
--&lt;br /&gt;
-- Produces standard hatnote text. Implements the {{hatnote}} template.&lt;br /&gt;
--------------------------------------------------------------------------------&lt;br /&gt;
&lt;br /&gt;
function p.hatnote(frame)&lt;br /&gt;
	local args = getArgs(frame)&lt;br /&gt;
	local s = args[1]&lt;br /&gt;
	local options = {}&lt;br /&gt;
	if not s then&lt;br /&gt;
		return p.makeWikitextError(&lt;br /&gt;
			'no text specified',&lt;br /&gt;
			'Template:Hatnote#Errors',&lt;br /&gt;
			args.category&lt;br /&gt;
		)&lt;br /&gt;
	end&lt;br /&gt;
	options.extraclasses = args.extraclasses&lt;br /&gt;
	options.selfref = args.selfref&lt;br /&gt;
	return p._hatnote(s, options)&lt;br /&gt;
end&lt;br /&gt;
&lt;br /&gt;
function p._hatnote(s, options)&lt;br /&gt;
	checkType('_hatnote', 1, s, 'string')&lt;br /&gt;
	checkType('_hatnote', 2, options, 'table', true)&lt;br /&gt;
	options = options or {}&lt;br /&gt;
	local classes = {'hatnote'}&lt;br /&gt;
	local extraclasses = options.extraclasses&lt;br /&gt;
	local selfref = options.selfref&lt;br /&gt;
	if type(extraclasses) == 'string' then&lt;br /&gt;
		classes[#classes + 1] = extraclasses&lt;br /&gt;
	end&lt;br /&gt;
	if selfref then&lt;br /&gt;
		classes[#classes + 1] = 'selfref'&lt;br /&gt;
	end&lt;br /&gt;
	return string.format(&lt;br /&gt;
		'&amp;lt;div role=&amp;quot;note&amp;quot; class=&amp;quot;%s&amp;quot;&amp;gt;%s&amp;lt;/div&amp;gt;',&lt;br /&gt;
		table.concat(classes, ' '),&lt;br /&gt;
		s&lt;br /&gt;
	)&lt;br /&gt;
end&lt;br /&gt;
&lt;br /&gt;
return p&lt;/div&gt;</summary>
		<author><name>Nihiltres</name></author>	</entry>

	</feed>