Вікікнігі
bewikibooks
https://be.wikibooks.org/wiki/%D0%93%D0%B0%D0%BB%D0%BE%D1%9E%D0%BD%D0%B0%D1%8F_%D1%81%D1%82%D0%B0%D1%80%D0%BE%D0%BD%D0%BA%D0%B0
MediaWiki 1.47.0-wmf.23
first-letter
Мультымедыя
Адмысловае
Размовы
Удзельнік
Размовы з удзельнікам
Вікікнігі
Размовы пра Вікікнігі
Файл
Размовы пра файл
MediaWiki
Размовы пра MediaWiki
Шаблон
Размовы пра шаблон
Даведка
Размовы пра даведку
Катэгорыя
Размовы пра катэгорыю
TimedText
TimedText talk
Модуль
Размовы пра модуль
Event
Event talk
Шаблон:Адміністратар
10
3085
8257
7430
2026-10-08T21:10:38Z
Jarash
1066
дадаў іменаваны выклік параметраў, каб выкарыстаць [[module:userbox]]
8257
wikitext
text/x-wiki
{{Userbox|id(1)-c=#cccccc|info-c=#eeeeee| id =[[Файл:Wikibooks-logo.svg|35px]]|id-5=9|info ='''{{{1|{{{iмя|{{PAGENAME}}}}}}}}''' з’яўляецца адн{{GENDER:{{BASEPAGENAME}}|ым|ой|ым}} з '''адміністратараў''' беларускіх [[Галоўная старонка|Вікікніг]] {{#if:{{{2|}}}||<span class="plainlinks"> ([{{fullurl:Адмысловае:ListUsers|limit=1&username={{urlencode:{{{username|{{BASEPAGENAME}}}}}}}}} <span style="color:#5871C6;">правер</span>])</span> i гатов{{GENDER:{{BASEPAGENAME}}ы|а|ы}} дапамагчы іншым удзельнікам.}}|cat(1)=Вікікнігі:Адміністратары}}
<noinclude>[[Катэгорыя:Шаблоны:Удзельнікі]]</noinclude>
464hiucrvj6d0lcvzn3p20z7a6jbpta
Шаблон:Tracked
10
3319
8254
7771
2026-10-08T20:03:14Z
Jarash
1066
night aware color
8254
wikitext
text/x-wiki
<div role="note" style="float:{{{float|right}}}; clear:{{{float|right}}}; border:1px solid #999; border-radius:2px; font-size:85%; text-align:center; padding:0.5em; margin-left:1em; margin-bottom:1em; width:12em" class="plainlinks {{#if:{{{1|}}}|mw-trackedTemplate}}">Адсочваецца ў {{#ifeq: {{padleft:|1| {{{1|T}}} }} | T
|[[phabricator:|Фабрыкатары]]<br />{{#if:{{{1|}}}|'''[[phabricator:{{{1}}}|<span class="trakfab-{{{1}}}">Заданне {{{1}}}</span>]]'''}}
{{#switch:{{lc:{{{2|}}}}}
|resolved=<span style="font-weight:bold; text-transform:uppercase">Вырашана</span>
|invalid=<span style="font-weight:bold; text-transform:uppercase">Няправільна</span>
|duplicate=<span style="font-weight:bold; text-transform:uppercase">Паўтараецца</span>
|declined=<span style="font-weight:bold; text-transform:uppercase">Адхілена</span>
|stalled=<span style="font-weight:bold; text-transform:uppercase">Застапарылася</span>
|open=<span style="font-weight:bold; text-transform:uppercase">Адчынена</span>
}}
|[//bugzilla.wikimedia.org/ Bugzilla]<br />{{#if:{{{1|}}}|'''[[bugzilla:{{{1}}}|<span class="trakbug-{{{1}}}">Памылка {{{1}}}</span>]]'''}}
{{#switch:{{lc:{{{2|}}}}}
|fixed=<span style="font-weight:bold; text-transform:uppercase">Вырашана, выпраўлена</span>
|wontfix=<span style="font-weight:bold; text-transform:uppercase">Вырашана "немагчыма выправіць"</span>
|invalid=<span style="font-weight:bold; text-transform:uppercase">Вырашана, неправільна</span>
|later=<span style="font-weight:bold; text-transform:uppercase">Вырашана "пазней"</span>
|duplicate=<span style="font-weight:bold; text-transform:uppercase">Вырашана падвойна</span>
|critical=<span style="font-weight:bold; font-size:1.5em; text-transform:uppercase">Крытычна</span>
}}
}}</div><noinclude>
{{Дакументацыя}}
</noinclude>
1gfys0w8i2vx3l5huatlcodjjigc3y7
Турэцкая кухня
0
3460
8253
2026-10-08T19:50:21Z
Jarash
1066
з [[en:Special:PermanentLink/4474270]]
8253
wikitext
text/x-wiki
'''Турэцкая кухня''' каранямі сыходзіць у войска Заходняй Турцыі, якое пакінула сваю радзіму стагоддзі таму. Тое, што зараз завецца турэцкай кухняй, прайшло вялікі шлях.
Турэцкае войска мела карысныя веды пра тое, як захаваць ежу на працягу доўгага пэрыяду, але яно ўсё адно пакутавала ад недахопу ежы. На турэцкую кухню паўплывалі культуры і цывілізацыі, з якімі сустракалася турэцкае войска. Калі з'явілася [[:w:Асманская Імперыя|Асманская Імперыя]], туркі засвоілі і прынялі шырокі спектр кулінарных традыцый; пазнейшае пашырэнне імперыі павялічыла ўзаемнае ўзбагачэнне з кулінарнымі школамі іншых культур. У сталіцы Асманскай імперыі, [[w:Стамбул|Стамбуле]], гэтыя разнастайныя ідэі спалучыліся і ўтварылі тое, што зараз вядома як "турэцкая кухня", якая ўзяла ад [[Грэчаская кухня|грэчаскага]], [[Яўрэйская кухня|яўрэйскага]], [[Армянская кухня|армянскага]], [[Іранская кухня|іранскага]] ды [[арабская кухня|арабскага]] стыляў, у выніку чаго ўтварылася "палацавая (Асманская) кухня".
== Традыцыі абеду ==
=== Сняданак ===
Тыповы турэцкі сняданак складаецца з хлеба з фетай, чорнымі аліўкамі, варэннем (або мёдам) і маслам. Часам дадаюць [[таматы]], [[агуркі]] альбо вараныя яйкі. [[Рэцэпт:Чай|Чай]]-традыцыйны напой для турэцкіх сняданкаў.
== Турэцкая кухня ==
Сёння аснову турэцкай кухні складаюць мяса і гародніна. Хоць з часоў Асманскай імперыі багацце спецый зменшылася, яна па-ранейшаму славіцца сваімі пахамі, а асаблівае месца ў ёй займаюць чабор, мята, духмяны перац, кмен і карыца.
== Турэцкія стравы ==
=== Супы ===
Супы — незаменная страва ў зімовы час. Хоць для іх прыгатавання выкарыстоўваюць розныя інгрэдыенты, самымі папулярнымі застаюцца сачавіца, [[таматы]] і рыс. Адзін з такіх традыцыйных супаў — тархана, у склад якога ўваходзіць шмат гародніны ([[цыбуля]], перац, таматы і г. д.), мука, дрожджы і ёгурт. Традыцыйна тархану нарыхтоўваюць россыпам: сушаць і захоўваюць на працягу года ці нават даўжэй. Пры гэтым рэцэпт тарханы ў розных рэгіёнах Турцыі адрозніваецца.
* Тархана чорбасы-ферментаваны, сушаны суп з цеста і ёгурта.
Гэта традыцыйны турэцкі суп.
=== Мезе (закускі) ===
Закускі не з'яўляюцца звыклай часткай турэцкай кухні, але калі туркі п'юць ракы, яны ядуць мезе, якое падаюць на маленькіх сподачках. Гэтыя частункі падобныя на тапас і могуць складацца з розных відаў рыбных кансерваў, морапрадуктаў і гародніны. Спачатку падаюць халодныя мезе, а пасля іх — гарачыя стравы, напрыклад, невялікія катлеты або смажаныя морапрадукты.
=== Мясныя стравы ===
Мясныя стравы звычайна гатуюць у збанках з рознай гароднінай. Гатаванне на грылі таксама вельмі распаўсюджанае. У мінулым туркі аддавалі перавагу бараніне. Сёння, калі здаровае харчаванне ў модзе, усё часцей падаюць цяляціну. Стравы з курыцы і індычкі таксама займаюць важнае месца ў штодзённым рацыёне
=== Рыбныя стравы ===
Рыбы ўжо не так шмат, як раней, але ў буйных гарадах і прыморскіх пасёлках яшчэ можна знайсці свежую і смачную рыбу. У турэцкай кухні рыбу звычайна гатуюць на грылі або абсмажваюць у алеі і падаюць з цытрынавым сокам, а не з больш вытанчанымі соусамі.
=== Стравы з яек ===
У часы Асманскай імперыі стравы з яек мелі такое значэнне, што адным з асноўных заданняў для будучых шэф-кухараў імператарскага палаца было прыгатаванне амлету з цыбуляй. Сёння туркі па-ранейшаму ядуць шмат страў з яек, асабліва тых, што папулярныя ўлетку.
=== Бёрэк (пікантная выпечка) ===
Бёрэк — гэта выпечка з начыннем. Для яе гатавання выкарыстоўваюць тонкае цеста філа, вядомае таксама як юфка. У яго загортваюць начынне з сыру з авечага малака, нарэзанай гародніны — напрыклад, пятрушкі або баклажанаў, — а часам і мяса. Бёрэк можна запякаць або смажыць.
=== Стравы з рысу ===
Рыс звычайна выкарыстоўваюць для прыгатавання плову, які падаюць да мясных страў. Часам у плоў дадаюць розныя інгрэдыенты і ядуць яго асобна. Рыс таксама — асноўны інгрэдыент знакамітай турэцкай долмы. [[Рэцэпт:паста|Паста]] не займае важнага месца ў турэцкай кухні, але страва пад назвай манты, якую можна параўнаць з пельменямі, карыстаецца нязменнай папулярнасцю.
=== Агароднінныя стравы ===
Агароднінныя стравы ў Турцыі звычайна гатуюць з мясам — у збанках — і падаюць як асноўную страву. Баклажаны ўваходзяць у склад многіх папулярных страў, у тым ліку карныярыку і ісьлім-кебабу. Раней лічылася, што існуе больш за тысячу спосабаў прыгатавання баклажанаў. Магчыма, гэта перабольшанне, але гістарычныя запісы сведчаць, што спробы смажыць баклажаны нярэдка прыводзілі да пажараў у дамах і наваколлі. На шчасце, такія пажары засталіся ў мінулым, а смажаныя баклажаны і цяпер — адна з любімых летніх страў туркаў. Стравы з гародніны, прыгатаванай на аліўкавым алеі, таксама займаюць важнае месца ў турэцкай кухні: так можна прыгатаваць практычна любую гародніну.
=== Дэсерт ===
Дэсерты вельмі важныя для туркаў: многія лічаць, што без іх трапеза будзе няпоўнай. [[Рэцэпт:Пахлава|Пахлава]] — не ўнікальны для Турцыі дэсерт, але адзін з самых вядомых у краіне; асабліва цэніцца пахлава з Газіянтэпа. Турэцкая кухня прапануе мноства іншых відаў выпечкі, у большасць з якіх дадаюць грэцкія арэхі або фісташкі. Малочныя дэсерты таксама вельмі папулярныя, як і дэсерты з садавінай: часта выкарыстоўваюць айву і інжыр. Ёгурт, булгур, тархана (кіслая сушаная сумесь на аснове ёгурту) і юфка (тонкія лісты цеста) — важныя складнікі турэцкай кухні.
== Крыніцы ==
* Hülya Ekşigil (рэдактар часопісу і кулінарны аўтар)
== Літаратура ==
* Турецкая кухня [Текст] / [гл. ред. : А. Барагамян]. - Москва : Директ-Медиа, 2011. - 69 с. - (Кухни народов мира; Т. 16).; ISBN 978-5-7475-0099-0
[[Катэгорыя:Нацыянальныя кухні]]
[[en:Cookbook:Cuisine of Turkey]]
[[ja:料理本/トルコ料理]]
[[ka:კულინარული წიგნი:თურქული სამზარეულო]]
[[tr:Türk Mutfağı]]
2y8rm959m02gjsbl0l1i4bdn5rq42ee
Шаблон:Userbox/styles.css
10
3461
8255
2026-10-08T20:21:27Z
Jarash
1066
Новая старонка: «/* {{pp-template}} */ .wikipediauserbox { margin: 1px; border: 1px solid var(--border-color-base, #a2a9b1); width: 238px; float: left; } .wikipediauserbox table { border-collapse: collapse; width: 238px; margin-bottom: 0; margin-top: 0; background: #eee; color: inherit; } .wikipediauserbox td { border: 0; vertical-align: middle; } .wikipediauserbox .userbox-info { border: 0; text-align: left; font-size: 8pt; padding: 0 4px 0 4px; height:...»
8255
sanitized-css
text/css
/* {{pp-template}} */
.wikipediauserbox {
margin: 1px;
border: 1px solid var(--border-color-base, #a2a9b1);
width: 238px;
float: left;
}
.wikipediauserbox table {
border-collapse: collapse;
width: 238px;
margin-bottom: 0;
margin-top: 0;
background: #eee;
color: inherit;
}
.wikipediauserbox td {
border: 0;
vertical-align: middle;
}
.wikipediauserbox .userbox-info {
border: 0;
text-align: left;
font-size: 8pt;
padding: 0 4px 0 4px;
height: 45px;
line-height: 1.25em;
color: inherit;
vertical-align: middle;
}
.wikipediauserbox .userbox-id,
.wikipediauserbox .userbox-id2 {
border: 0;
width: 45px;
height: 45px;
background: #ddd;
text-align: center;
font-size: 14pt;
font-weight: bold;
color: inherit;
padding: 0 1px 0 0;
line-height: 1.25em;
vertical-align: middle;
}
/* Выпраўленні для Цёмнага колеру */
@media screen {
html.skin-theme-clientpref-night .wikipediauserbox table {
background: #202122;
color: inherit;
}
html.skin-theme-clientpref-night .wikipediauserbox .userbox-id,
html.skin-theme-clientpref-night .wikipediauserbox .userbox-id2 {
background: #27292d;
color: inherit;
}
/* Вызначэнне фону, без колеру пярэдняга слою (часовае выпраўленне) */
html.skin-theme-clientpref-night .wikipediauserbox table[style*="background"] .userbox-info {
color: #202122;
}
}
@media screen and ( prefers-color-scheme: dark ) {
html.skin-theme-clientpref-os .wikipediauserbox table {
background: #202122;
color: inherit;
}
html.skin-theme-clientpref-os .wikipediauserbox .userbox-id,
html.skin-theme-clientpref-os .wikipediauserbox .userbox-id2 {
background: #27292d;
color: inherit;
}
/* Вызначэнне фону, без колеру пярэдняга слою (часовае выпраўленне) */
html.skin-theme-clientpref-os .wikipediauserbox table[style*="background"] .userbox-info {
color: #202122;
color: inherit;
}
}
3csm0woxl16jjlkxuaae1d2sjy4c9ay
Модуль:Userbox
828
3462
8256
2026-10-08T20:31:10Z
Jarash
1066
Новая старонка: «-- Гэты модуль рэалізуе {{userbox}}. local categoryHandler = require('Module:Category handler').main local p = {} -------------------------------------------------------------------------------- -- Дапаможныя функцыі -------------------------------------------------------------------------------- local function checkNum(val, default) -- Правярае, што значэнне ліку большае ці роўнае...»
8256
Scribunto
text/plain
-- Гэты модуль рэалізуе {{userbox}}.
local categoryHandler = require('Module:Category handler').main
local p = {}
--------------------------------------------------------------------------------
-- Дапаможныя функцыі
--------------------------------------------------------------------------------
local function checkNum(val, default)
-- Правярае, што значэнне ліку большае ці роўнае нулю. Калі так,
-- вяртае лік. Калі не, вяртае значэнне па змоўчванні.
val = tonumber(val)
if val and val >= 0 then
return val
else
return default
end
end
local function addSuffix(num, suffix)
-- Ператварае лік у радок і дадае суфікс.
if num then
return tostring(num) .. suffix
else
return nil
end
end
local function checkNumAndAddSuffix(num, default, suffix)
-- Правярае значэнне з дапамогай checkNum і дадае суфікс.
num = checkNum(num, default)
return addSuffix(num, suffix)
end
local function makeCat(cat, sort)
-- Стварае спасылку на катэгорыю.
if sort then
return mw.ustring.format('[[Катэгорыя:%s|%s]]', cat, sort)
else
return mw.ustring.format('[[Катэгорыя:%s]]', cat)
end
end
--------------------------------------------------------------------------------
-- Апрацоўка аргументаў
--------------------------------------------------------------------------------
local function makeInvokeFunc(funcName)
return function (frame)
local origArgs = require('Модуль:Arguments').getArgs(frame)
local args = {}
for k, v in pairs(origArgs) do
args[k] = v
end
return p.main(funcName, args)
end
end
p.userbox = makeInvokeFunc('_userbox')
p['userbox-2'] = makeInvokeFunc('_userbox-2')
p['userbox-r'] = makeInvokeFunc('_userbox-r')
--------------------------------------------------------------------------------
-- Асноўныя функцыі
--------------------------------------------------------------------------------
function p.main(funcName, args)
local userboxData = p[funcName](args)
local userbox = p.render(userboxData)
local cats = p.categories(args)
return userbox .. (cats or '')
end
function p._userbox(args)
-- Робіць апрацоўку аргумента для {{userbox}}.
local data = {}
-- Атрымаць значэнні тэга div.
data.float = args.float
local borderWidthNum = checkNum(args['border-width'] or args['border-s'], nil)
data.borderWidth = addSuffix(borderWidthNum, 'px')
data.borderColor = args['border-color'] or args['border-c'] or args[1] or args['id-c']
data.width = borderWidthNum and addSuffix(240 - 2 * borderWidthNum, 'px')
data.bodyClass = args.bodyclass
-- Атрымаць значэнні тэга table.
data.backgroundColor = args['info-background'] or args[2] or args['info-c']
-- Атрымаць значэнні info.
data.info = args.info or args[4] or "<code>{{{info}}}</code>"
data.infoTextAlign = args['info-a']
data.infoFontSize = checkNumAndAddSuffix(args['info-size'] or args['info-s'], nil, 'pt')
data.infoHeight = checkNumAndAddSuffix(args['logo-height'] or args['id-h'], nil, 'px')
data.infoPadding = args['info-padding'] or args['info-p']
data.infoLineHeight = args['info-line-height'] or args['info-lh']
data.infoColor = args['info-color'] or args['info-fc']
data.infoOtherParams = args['info-other-param'] or args['info-op']
data.infoClass = args['info-class']
-- Атрымаць значэнні id.
local id = args.logo or args[3] or args.id
data.id = id
data.showId = id and true or false
data.idWidth = checkNumAndAddSuffix(args['logo-width'] or args['id-w'], nil, 'px')
data.idHeight = checkNumAndAddSuffix(args['logo-height'] or args['id-h'], nil, 'px')
data.idBackgroundColor = args['logo-background'] or args[1] or args['id-c']
data.idTextAlign = args['id-a']
data.idFontSize = checkNum(args['logo-size'] or args[5] or args['id-s'], nil)
data.idColor = args['logo-color'] or args['id-fc'] or data.infoColor
data.idPadding = args['logo-padding'] or args['id-p']
data.idLineHeight = args['logo-line-height'] or args['id-lh']
data.idOtherParams = args['logo-other-param'] or args['id-op']
data.idClass = args['id-class']
return data
end
p['_userbox-2'] = function (args)
-- Робіць апрацоўку аргумента для {{userbox-2}}.
local data = {}
-- Атрымаць значэнні тэга div.
data.float = args.float
local borderWidthNum = checkNum(args['border-s'] or args[9], nil)
data.borderWidth = addSuffix(borderWidthNum, 'px')
data.borderColor = args['border-c'] or args[6] or args['id1-c'] or args[1]
data.width = borderWidthNum and addSuffix(240 - 2 * borderWidthNum, 'px')
data.bodyClass = args.bodyclass
-- Атрымаць значэнні тэга table.
data.backgroundColor = args['info-c'] or args[2]
-- Атрымаць значэнні info.
data.info = args.info or args[4] or "<code>{{{info}}}</code>"
data.infoTextAlign = args['info-a']
data.infoFontSize = checkNumAndAddSuffix(args['info-s'], nil, 'pt')
data.infoColor = args['info-fc'] or args[8]
data.infoPadding = args['info-p']
data.infoLineHeight = args['info-lh']
data.infoOtherParams = args['info-op']
-- Атрымаць значэнні id.
data.showId = true
data.id = args.logo or args[3] or args.id1 or 'id1'
data.idWidth = checkNumAndAddSuffix(args['id1-w'], nil, 'px')
data.idHeight = checkNumAndAddSuffix(args['id-h'], nil, 'px')
data.idBackgroundColor = args['id1-c'] or args[1]
data.idTextAlign = args['id-a']
data.idFontSize = checkNum(args['id1-s'], nil)
data.idLineHeight = args['id1-lh']
data.idColor = args['id1-fc'] or data.infoColor
data.idPadding = args['id1-p']
data.idOtherParams = args['id1-op']
-- Атрымаць значэнні id2.
data.showId2 = true
data.id2 = args.logo or args[5] or args.id2 or 'id2'
data.id2Width = checkNumAndAddSuffix(args['id2-w'], nil, 'px')
data.id2Height = data.idHeight
data.id2BackgroundColor = args['id2-c'] or args[7] or args[1]
data.id2TextAlign = nil -- Always center, but don't set if no content
data.id2FontSize = checkNum(args['id2-s'], nil)
data.id2LineHeight = args['id2-lh']
data.id2Color = args['id2-fc'] or data.infoColor
data.id2Padding = args['id2-p']
data.id2OtherParams = args['id2-op']
return data
end
p['_userbox-r'] = function (args)
-- Робіць апрацоўку аргумента для {{userbox-r}}.
local data = {}
-- Атрымаць значэнні тэга div.
data.float = args.float
local borderWidthNum = checkNum(args['border-width'] or args['border-s'], nil)
data.borderWidth = addSuffix(borderWidthNum, 'px')
data.borderColor = args['border-color'] or args['border-c'] or args[1] or args['id-c']
data.width = borderWidthNum and addSuffix(240 - 2 * borderWidthNum, 'px')
data.bodyClass = args.bodyclass
-- Атрымаць значэнні тэга table.
data.backgroundColor = args['info-background'] or args[2] or args['info-c']
-- Атрымаць значэнні id.
data.showId = false -- Паказваем толькі id2 у userbox-r.
-- Атрымаць значэнні info.
data.info = args.info or args[4] or "<code>{{{info}}}</code>"
data.infoTextAlign = args['info-align'] or args['info-a']
data.infoFontSize = checkNumAndAddSuffix(args['info-size'] or args['info-s'], nil, 'pt')
data.infoPadding = args['info-padding'] or args['info-p']
data.infoLineHeight = args['info-line-height'] or args['info-lh']
data.infoColor = args['info-color'] or args['info-fc']
data.infoOtherParams = args['info-other-param'] or args['info-op']
-- Атрымаць значэнні id2.
data.showId2 = true -- userbox-r заўсёды паказвае ID cell (як id2)
data.id2 = args.logo or args[3] or args.id or 'id'
data.id2Width = checkNumAndAddSuffix(args['logo-width'] or args['id-w'], nil, 'px')
data.id2Height = checkNumAndAddSuffix(args['logo-height'] or args['id-h'], nil, 'px')
data.id2BackgroundColor = args['logo-background'] or args[1] or args['id-c']
data.id2TextAlign = args['id-a']
data.id2FontSize = checkNum(args['logo-size'] or args[5] or args['id-s'], nil)
data.id2Color = args['logo-color'] or args['id-fc'] or data.infoColor
data.id2Padding = args['logo-padding'] or args['id-p']
data.id2LineHeight = args['logo-line-height'] or args['id-lh']
data.id2OtherParams = args['logo-other-param'] or args['id-op']
return data
end
function p.render(data)
-- Адмалёўвае userbox html, выкарыстоўваючы змест табліцы дадзеных.
-- Дадае TemplateStyles
local templateStyles = mw.getCurrentFrame():extensionTag{
name = 'templatestyles', args = { src = 'Template:Userbox/styles.css' }
}
-- Адмалёўвае html тэг div.
local root = mw.html.create('div')
root:addClass('wikipediauserbox')
-- Дадае уласцівасці CSS толкі калі яны маюць значэнні
if data.float then root:css('float', data.float) end
if data.borderWidth then
root:css('border-width', data.borderWidth)
end
if data.borderColor then
root:css('border-color', data.borderColor)
--Пазначыць стыль межаў, калі мы маем колер, але магчыма не пазначаная шырыня
if not data.borderWidth then
root:css('border-width', '1px') -- шырыня мяжы па змоўчванні
end
root:css('border-style', 'solid')
end
if data.width then root:css('width', data.width) end
if data.bodyClass then root:addClass(data.bodyClass) end
-- Адмалёўвае html тэг table.
local tableroot = root:tag('table')
tableroot:attr('role', 'presentation')
-- Дадае уласцівасці CSS, калі існуюць значэнні
if data.width then tableroot:css('width', data.width) end
if data.backgroundColor then tableroot:css('background', data.backgroundColor):css('color', 'inherit') end
local tablerow = tableroot:tag('tr')
-- Стварыць ячэйкі на падставе таго, што яны павінны насамрэч быць паказаныя
if data.showId == false then
-- userbox-r: спачатку info ячэйкі, потым id2 ячэйкі (калі showId2 праўда)
local infoCell = tablerow:tag('td')
infoCell:addClass('userbox-info')
if data.infoTextAlign then infoCell:css('text-align', data.infoTextAlign) end
if data.infoFontSize then infoCell:css('font-size', data.infoFontSize) end
if data.infoPadding then infoCell:css('padding', data.infoPadding) end
if data.infoHeight then infoCell:css('height', data.infoHeight) end
if data.infoLineHeight then infoCell:css('line-height', data.infoLineHeight) end
if data.infoColor then infoCell:css('color', data.infoColor) end
if data.infoOtherParams then infoCell:cssText(data.infoOtherParams) end
if data.infoClass then infoCell:addClass(data.infoClass) end
if data.info then infoCell:wikitext(data.info) end
-- Стварыць ячэйку id2 толькі калі showId2 праўда
if data.showId2 then
local id2Cell = tablerow:tag('td')
id2Cell:addClass('userbox-id2')
if data.id2Width then id2Cell:css('width', data.id2Width) end
if data.id2Height then id2Cell:css('height', data.id2Height) end
if data.id2BackgroundColor then id2Cell:css('background', data.id2BackgroundColor) end
if data.id2TextAlign then id2Cell:css('text-align', data.id2TextAlign) end
if data.id2FontSize then id2Cell:css('font-size', data.id2FontSize .. 'pt') end
if data.id2Color then id2Cell:css('color', data.id2Color) else id2Cell:css('color', 'inherit') end
if data.id2Padding then id2Cell:css('padding', data.id2Padding) end
if data.id2LineHeight then id2Cell:css('line-height', data.id2LineHeight) end
if data.id2OtherParams then id2Cell:cssText(data.id2OtherParams) end
if data.id2 then id2Cell:wikitext(data.id2) end
end
else
-- userbox і userbox-2: стварыць ячэйку id толькі калі showId праўда
if data.showId then
local idCell = tablerow:tag('td')
idCell:addClass('userbox-id')
if data.idWidth then idCell:css('width', data.idWidth) end
if data.idHeight then idCell:css('height', data.idHeight) end
if data.idBackgroundColor then idCell:css('background', data.idBackgroundColor) end
if data.idTextAlign then idCell:css('text-align', data.idTextAlign) end
if data.idFontSize then idCell:css('font-size', data.idFontSize .. 'pt') end
if data.idColor then idCell:css('color', data.idColor) else idCell:css('color', 'inherit') end
if data.idPadding then idCell:css('padding', data.idPadding) end
if data.idLineHeight then idCell:css('line-height', data.idLineHeight) end
if data.idOtherParams then idCell:cssText(data.idOtherParams) end
if data.idClass then idCell:addClass(data.idClass) end
if data.id then idCell:wikitext(data.id) end
end
-- Заўсёды ствараць ячэйку info для userbox і userbox-2
local infoCell = tablerow:tag('td')
infoCell:addClass('userbox-info')
if data.infoTextAlign then infoCell:css('text-align', data.infoTextAlign) end
if data.infoFontSize then infoCell:css('font-size', data.infoFontSize) end
if data.infoPadding then infoCell:css('padding', data.infoPadding) end
if data.infoHeight then infoCell:css('height', data.infoHeight) end
if data.infoLineHeight then infoCell:css('line-height', data.infoLineHeight) end
if data.infoColor then infoCell:css('color', data.infoColor) end
if data.infoOtherParams then infoCell:cssText(data.infoOtherParams) end
if data.infoClass then infoCell:addClass(data.infoClass) end
if data.info then infoCell:wikitext(data.info) end
-- Ствараць ячэйку id2 толькі для userbox-2 і толькі калі showId2 праўда
if data.showId2 then
local id2Cell = tablerow:tag('td')
id2Cell:addClass('userbox-id2')
if data.id2Width then id2Cell:css('width', data.id2Width) end
if data.id2Height then id2Cell:css('height', data.id2Height) end
if data.id2BackgroundColor then id2Cell:css('background', data.id2BackgroundColor) end
if data.id2TextAlign then id2Cell:css('text-align', data.id2TextAlign) end
if data.id2FontSize then id2Cell:css('font-size', data.id2FontSize .. 'pt') end
if data.id2Color then id2Cell:css('color', data.id2Color) else id2Cell:css('color', 'inherit') end
if data.id2Padding then id2Cell:css('padding', data.id2Padding) end
if data.id2LineHeight then id2Cell:css('line-height', data.id2LineHeight) end
if data.id2OtherParams then id2Cell:cssText(data.id2OtherParams) end
if data.id2 then id2Cell:wikitext(data.id2) end
end
end
local title = mw.title.getCurrentTitle()
if (title.namespace == 2) and not title.text:match("/") then
return templateStyles .. tostring(root) -- звычайная старонка удзельніка
elseif title.namespace == 14 then
return templateStyles .. tostring(root) -- катэгорыя
elseif title.isTalkPage then
return templateStyles .. tostring(root) -- старонка размоў
end
-- Праверка кантрастных колераў (спрошчана для TemplateStyles)
local legible = true
local contrast = require('Module:Color contrast')._ratio
local function has_text(wikitext)
if not wikitext then return false end
wikitext = wikitext:gsub("]]", "|]]")
wikitext = wikitext:gsub("%[%[%s*[Mm][Ee][Dd][Ii][Aa]%s*:[^|]-(|.-)]]", "")
wikitext = wikitext:gsub("%[%[%s*[Ii][Mm][Aa][Gg][Ee]%s*:[^|]-(|.-)]]", "")
wikitext = wikitext:gsub("%[%[%s*[Ff][Ii][Ll][Ee]%s*:[^|]-(|.-)]]", "")
return mw.text.trim(wikitext) ~= ""
end
if data.infoColor and data.backgroundColor and contrast { data.infoColor, data.backgroundColor, error = 0 } < 4.5 then
legible = false
end
-- Для паўтлустага тэксту >= 14pt, патрабаванне толькі 3.
local idContrastThreshold = 4.5
local id2ContrastThreshold = 4.5
if (data.idFontSize or 0) >= 14 then idContrastThreshold = 3 end
if (data.id2FontSize or 0) >= 14 then id2ContrastThreshold = 3 end
if data.showId and data.idColor and data.idBackgroundColor and contrast { data.idColor, data.idBackgroundColor, error = 0 } < idContrastThreshold then
if has_text(data.id or "") then legible = false end
end
if data.showId2 and data.id2Color and data.id2BackgroundColor and contrast { data.id2Color, data.id2BackgroundColor, error = 0 } < id2ContrastThreshold then
if has_text(data.id2 or "") then legible = false end
end
if not legible then
root:wikitext('[[Катэгорыя:Userboxes with insufficient color contrast]]')
end
return templateStyles .. tostring(root)
end
function p.categories(args, page)
-- Атрымлівае катэгорыі з [[Module:Category handler]].
-- Параметр старонкі прымушае функцыю дзейнічаць як быццам модуль выклікаўся з гэтай старонкі.
-- Гэта ўлучана для мэтаў тэсціравання.
local cats = {}
cats[#cats + 1] = args.usercategory
cats[#cats + 1] = args.usercategory2
cats[#cats + 1] = args.usercategory3
cats[#cats + 1] = args.usercategory4
cats[#cats + 1] = args.usercategory5
-- Атрымаць загаловак аб'екта
local title
if page then
title = mw.title.new(page)
else
title = mw.title.getCurrentTitle()
end
-- Пабудаваць аргументы апрацоўшчыка катэгорый.
local chargs = {}
chargs.page = page
chargs.nocat = args.nocat
chargs.main = '[[Катэгорыя:Старонкі з шаблонамі ў няслушнай прасторы назваў]]'
if args.notcatsubpages then
chargs.subpage = 'no'
end
-- Прастора ўдзельніка.
local user = ''
for i, cat in ipairs(cats) do
user = user .. makeCat(cat)
end
chargs.user = user
return categoryHandler(chargs)
end
return p
243bhdu9hywtidy7fo0bn7jdtjmhv3j