Moduł:Dokumentacja: Różnice pomiędzy wersjami
Przejdź do nawigacji
Przejdź do wyszukiwania
| [wersja nieprzejrzana] | [wersja przejrzana] |
translate |
d Anulowanie wersji 114087 autorstwa BartoszKonkol (dyskusja) Znacznik: Anulowanie edycji |
||
| (Nie pokazano 15 wersji utworzonych przez 6 użytkowników) | |||
| Linia 1: | Linia 1: | ||
local p = {} | local p = {} | ||
local defaultDocPage = 'opis' | |||
local getType = function( namespace, page ) | |||
local pageType = 'template' | |||
if namespace == 'Moduł' or namespace == 'Module' then | |||
pageType = 'module' | |||
elseif namespace == 'Widget' then | |||
pageType = 'widget' | |||
elseif page.fullText:gsub( '/' .. defaultDocPage .. '$', '' ):find( '%.css$' ) then | |||
pageType = 'stylesheet' | |||
elseif page.fullText:gsub( '/' .. defaultDocPage .. '$', '' ):find( '%.js$' ) then | |||
pageType = 'script' | |||
elseif namespace == 'MediaWiki' then | |||
pageType = 'message' | |||
end | |||
return pageType | |||
end | |||
local getTypeForms = function( pageType ) | |||
if pageType == 'module' then | |||
return {gen = 'tym module', acc = 'tego modułu', pronoun_gen = "его", nomP = 'Moduły'} | |||
elseif pageType == 'widget' then | |||
return {gen = 'tym widżecie', acc = 'tego widżetu', pronoun_gen = "его", nomP = 'Widżety'} | |||
elseif pageType == 'stylesheet' then | |||
return {gen = 'tym arkuszu stylów', acc = 'tego arkusza stylów', pronoun_gen = "еro", nomP = 'Arkusze stylów'} | |||
elseif pageType == 'script' then | |||
return {gen = 'tym skrypcie', acc = 'tego skryptu', pronoun_gen = "его", nomP = 'Skrypty'} | |||
elseif pageType == 'message' then | |||
return {gen = 'tej wiadomości systemowej', acc = 'tej wiadomości systemowej', pronoun_gen = "его", nomP = 'Wiadomości'} | |||
else -- type == 'template' | |||
return {gen = 'tym szablonie', acc = 'tego szablonu', pronoun_gen = "его", nomP = 'Szablony'} | |||
end | |||
end | |||
-- Creating a documentation page or transclution through {{subst:doc}} | -- Creating a documentation page or transclution through {{subst:doc}} | ||
function p.create( f ) | function p.create( f ) | ||
local args = require( 'Moduł:ProcessArgs' ).norm() | local args = require( 'Moduł:ProcessArgs' ).norm() | ||
page = mw.title.getCurrentTitle() | local page = mw.title.getCurrentTitle() | ||
local docPage = args['strona'] or page.nsText .. ':' .. page.baseText .. '/' .. defaultDocPage | |||
local out | local out | ||
if page | if not args["treść"] and tostring( page ) == docPage then | ||
out = f:preprocess( '{{subst:Szablon:Dokumentacja/preload}}' ) | out = f:preprocess( '{{subst:Szablon:Dokumentacja/preload}}' ) | ||
else | else | ||
local templateArgs = {} | local templateArgs = {} | ||
for _, key in ipairs{ 'typ', 'strona', 'treść' } do | |||
local val = args[key] | |||
if val then | |||
if key == 'treść' then val = '\n' .. val .. '\n' end | |||
table.insert( templateArgs, key .. '=' .. val ) | |||
end | |||
end | end | ||
out = '{{Dokumentacja|' .. table.concat( templateArgs, '|' ) .. '}}' | |||
out = out:gsub( '|}}', '}}' ) | |||
if not args["treść"] then | |||
out = out .. '\n<!-- Kategorie i interwiki umieść na stronie dokumentacji. -->' | |||
end | end | ||
end | end | ||
if not mw.isSubsting() then | if not mw.isSubsting() then | ||
out = f:preprocess( out ) | out = f:preprocess( out ) | ||
if args['niekat'] | if not args['niekat'] then | ||
out = out .. '[[Kategoria: | out = out .. '[[Kategoria:Pages with templates requiring substitution]' | ||
end | end | ||
end | end | ||
| Linia 33: | Linia 73: | ||
end | end | ||
-- | -- Header2 on the documentation page | ||
function p.docPage(f) | function p.docPage( f ) | ||
local args = require( 'Moduł:ProcessArgs' ).merge( true ) | local args = require( 'Moduł:ProcessArgs' ).merge( true ) | ||
local badDoc = args['zladok'] | local badDoc = args['zladok'] | ||
local | local forceNoDoc = args['brakdok'] | ||
if f:callParserFunction( '#dplvar: | |||
local docclass = "documentation-norm" | |||
if badDoc then | |||
docclass = "documentation-bad" | |||
f:callParserFunction( '#dplvar:set', ' | elseif forceNoDoc then | ||
docclass = "documentation-no" | |||
end | |||
if forceNoDoc then | |||
f:callParserFunction( '#dplvar:set', '$doc forced_none', '1' ) | |||
end | |||
if f:callParserFunction( '#dplvar', '$doc noheader' ) == '1' then | |||
if badDoc then | |||
f:callParserFunction( '#dplvar:set', '$doc bad', '1' ) | |||
end | end | ||
return | return | ||
end | end | ||
local page = mw.title.getCurrentTitle() | local page = mw.title.getCurrentTitle() | ||
local namespace = | local namespace = page.nsText | ||
local pageType = ' | local pageType = mw.ustring.lower( args['typ'] or getType( namespace, page ) ) | ||
local typeForms = getTypeForms( pageType ) | |||
local | local body = mw.html.create( 'div' ):addClass( 'documentation-header' ) | ||
body | |||
:css{ | |||
['margin-bottom'] = '0.8em', | |||
padding = '0.8em 1em 0.7em', | |||
} | |||
:tag( 'div' ) | |||
:css( 'float', 'right' ) | |||
:wikitext( '[[', page:fullUrl( 'action=purge' ), ' ' .. f:preprocess('{{lc:{{int:purge}}}}') .. ']]' ) | |||
:done() | |||
:wikitext( | |||
'To jest strona dokumentacji, ', | |||
pageType == 'module' and 'będzie ona dołączona' or 'powinna ona być dołączona', | |||
' na stronie głównej. ', | |||
'Aby uzyskać więcej informacji sprawdź [[Szablon:Dokumentacja]].' | |||
) | |||
if badDoc then | |||
body:wikitext( "<br>'''Dokumentacja " .. typeForms.gen .. " wymaga uzupełnienia lub ulepszenia.'''" ) | |||
elseif forceNoDoc then | |||
body:wikitext( "<br>'''W " .. typeForms.gen .. " nie ma dokumentacji. Jeśli wiesz jak używać " .. typeForms.acc .. ", udokumentuj to.'''" ) | |||
end | end | ||
if not ( args["niekat"] or namespace == 'Użytkownik' or namespace == 'Użytkowniczka' ) then | |||
if | body:wikitext( '[[Kategoria:Szablony dokumentacji]]' ) | ||
end | end | ||
return body | |||
return | |||
end | end | ||
-- Wrapper around the documentation on the main page | -- Wrapper around the documentation on the main page | ||
function p.page( f ) | function p.page( f ) | ||
local args = require( 'Moduł:ProcessArgs' ).merge( true ) | -- mw.text.trim uses mw.ustring.gsub, which silently fails on large strings | ||
local function trim( s ) | |||
return (s:gsub( '^[\t\r\n\f ]+', '' ):gsub( '[\t\r\n\f ]+$', '' )) | |||
end | |||
local args = require( 'Moduł:ProcessArgs' ).merge( true ) | |||
local page = mw.title.getCurrentTitle() | local page = mw.title.getCurrentTitle() | ||
local namespace = args[' | local namespace = page.nsText | ||
local docText = trim( args["treść"] or '' ) | |||
if docText == '' then docText = nil end | |||
local docPage | |||
local noDoc | |||
local forceNoDoc | |||
if docText then | |||
docPage = page | |||
else | |||
docPage = mw.title.new( args["strona"] or namespace .. ':' .. page.text .. '/' .. defaultDocPage) | |||
noDoc = args["brakdok"] or not docPage.exists | |||
end | end | ||
local | local badDoc = args["zladok"] | ||
local pageType = mw.ustring.lower( args['typ'] or getType( namespace, page ) ) | |||
local | local typeForms = getTypeForms( pageType ) | ||
if not docText and not noDoc then | |||
f:callParserFunction( '#dplvar:set', '$doc noheader', '1' ) | |||
docText = trim( f:expandTemplate{ title = ':' .. docPage.fullText } ) | |||
if f:callParserFunction( '#dplvar', '$doc bad' ) == '1' then | |||
f:callParserFunction( '#dplvar:set', 'noheader', '1' ) | |||
docText = | |||
if f:callParserFunction( '#dplvar | |||
badDoc = 1 | badDoc = 1 | ||
end | end | ||
forceNoDoc = f:callParserFunction( '#dplvar', '$doc forced_none' ) == '1' | |||
if docText == '' and not forceNoDoc then | |||
docText = nil | |||
if | |||
noDoc = 1 | noDoc = 1 | ||
end | end | ||
end | |||
if docText then | |||
docText = '\n' .. docText .. '\n' | |||
end | end | ||
local action = f:preprocess( '{{lc:{{int: | local action = f:preprocess('{{lc:{{int:edit}}}}') | ||
local preload = '' | local preload = '' | ||
local | local docclass = "documentation-norm" | ||
local message | local message | ||
local category | local category | ||
if noDoc then | |||
if | action = f:preprocess('{{lc:{{int:create}}}}') | ||
action = f:preprocess( '{{lc:{{int:create}}}}' ) | |||
preload = '&preload=Szablon:Dokumentacja/preload' | preload = '&preload=Szablon:Dokumentacja/preload' | ||
docclass = "documentation-no" | |||
message = "'''W " .. typeForms.gen .. " nie ma dokumentacji. " .. | |||
"Jeśli wiesz jak używać " .. typeForms.acc .. ", proszę, podaj odpowiednie informacje.'''" | |||
if not ( args["niekat"] or namespace == 'Użytkownik' or namespace == 'Użytkowniczka' ) then | |||
category = typeForms.nomP .. ' bez dokumentacji' | |||
message = "'''W " .. | if not mw.title.new( 'Kategoria:' .. category ).exists then | ||
if args[' | category = 'Strony bez dokumentacji' | ||
if mw.title.new( 'Kategoria:' .. | end | ||
end | |||
elseif forceNoDoc then | |||
category = ' | docclass = "documentation-no" | ||
message = "'''W " .. typeForms.gen .. " nie ma dokumentacji. " .. | |||
"Jeśli wiesz jak używać " .. typeForms.acc .. ", proszę, podaj odpowiednie informacje.'''" | |||
if not ( args["niekat"] or namespace == 'Użytkownik' or namespace == 'Użytkowniczka' ) then | |||
category = typeForms.nomP .. ' bez dokumentacji' | |||
if not mw.title.new( 'Kategoria:' .. category ).exists then | |||
category = 'Strony bez dokumentacji' | |||
end | end | ||
end | end | ||
elseif badDoc then | elseif badDoc then | ||
docclass = "documentation-bad" | |||
message = "'''Dokumentacja " .. typeForms.gen .. " wymaga uzupełnienia lub ulepszenia.'''\n" | |||
message = "'''Dokumentacja " .. | if not ( args["niekat"] or namespace == 'Użytkownik' or namespace == 'Użytkowniczka' ) then | ||
if args[' | category = typeForms.nomP .. ' ze złą dokumentacją' | ||
if mw.title.new( 'Kategoria:' .. | if not mw.title.new( 'Kategoria:' .. category ).exists then | ||
category = ' | category = 'Strony ze złą dokumentacją' | ||
end | end | ||
end | end | ||
end | end | ||
local historyLink = f:preprocess('{{lc:{{int:history short}}}}') | |||
local purgeLink = f:preprocess('{{lc:{{int:purge}}}}') | |||
local viewLink = f:preprocess('{{lc:{{int:view}}}}') | |||
local links = { | local links = { | ||
'[' .. docPage:fullUrl( 'action=edit' .. preload ) .. ' ' .. action .. ']', | '[' .. docPage:fullUrl( 'action=edit' .. preload ) .. ' ' .. action .. ']', | ||
'[' .. | '[' .. docPage:fullUrl( 'action=history' ) .. ' ' .. historyLink .. ']', | ||
'[' .. page:fullUrl( 'action=purge' ) .. ' ' .. purgeLink .. ']' | |||
} | } | ||
if not noDoc and page ~= docPage then | |||
table.insert( links, 1, '[[' .. docPage.fullText .. '|' .. viewLink .. ']]' ) | |||
table.insert( links, 1, '[[' .. docPage.fullText .. '|' .. | |||
end | end | ||
links = mw.html.create( 'span' ) | |||
:css( 'float', 'right' ) | |||
:wikitext( mw.text.nowiki( '[ ' ), table.concat( links, ' | ' ), mw.text.nowiki( ' ]' ) ) | |||
local | local body = mw.html.create( 'div' ):addClass( 'documentation ' .. docclass ) | ||
body:css{ | |||
padding = '0.8em 1em 0.7em', | |||
['margin-top'] = '1em', | |||
clear = 'both' | |||
} | } | ||
local header = mw.html.create( 'div' ) | |||
:addClass( 'documentation-header' ) | |||
:css{ | |||
margin = '-0.8em -1em 0.8em', | |||
padding = '0.8em 1em 0.7em', | |||
['border-bottom'] = 'inherit' | |||
} | |||
header | |||
:node( links ) | |||
:tag( 'span' ) | |||
:css{ | |||
['font-weight'] = 'bold', | |||
['font-size'] = '130%', | |||
['margin-right'] = '1em', | |||
['line-height'] = '1' | |||
} | |||
:wikitext( 'Dokumentacja' ) | |||
if not noDoc and pageType ~= 'template' and pageType ~= 'message' then | |||
header | |||
:tag( 'span' ) | |||
:css( 'white-space', 'nowrap' ) | |||
:wikitext( '[[#the-code|Przejdź do kodu ↴]]' ) | |||
end | |||
body | |||
:node( header ):done() | |||
:wikitext( message ) | |||
:wikitext( docText ) | |||
if not noDoc and page ~= docPage then | |||
body | |||
:tag( 'div' ) | |||
:addClass( 'documentation-footer' ) | |||
:css{ | |||
margin = '0.7em -1em -0.7em', | |||
['border-top'] = 'inherit', | |||
padding = '0.8em 1em 0.7em', | |||
clear = 'both' | |||
} | |||
:node( links ) | |||
:wikitext( 'Powyższy opis jest dołączany ze strony [[' .. docPage.fullText .. ']].' ) | |||
end | |||
if category then | |||
body:wikitext( "[[Kategoria:" .. category .. "]]" ) | |||
end | |||
local anchor = '' | |||
if not noDoc and pageType ~= 'template' and pageType ~= 'message' then | |||
anchor = mw.html.create( 'div' ):attr( 'id', 'the-code' ) | |||
end | |||
return tostring( body ) .. tostring( anchor ) | |||
end | end | ||
return p | return p | ||
Aktualna wersja na dzień 18:08, 8 gru 2024
Używana w {{Dokumentacja}} i {{Dokumentacja/Nagłówek}}
Zależności
local p = {}
local defaultDocPage = 'opis'
local getType = function( namespace, page )
local pageType = 'template'
if namespace == 'Moduł' or namespace == 'Module' then
pageType = 'module'
elseif namespace == 'Widget' then
pageType = 'widget'
elseif page.fullText:gsub( '/' .. defaultDocPage .. '$', '' ):find( '%.css$' ) then
pageType = 'stylesheet'
elseif page.fullText:gsub( '/' .. defaultDocPage .. '$', '' ):find( '%.js$' ) then
pageType = 'script'
elseif namespace == 'MediaWiki' then
pageType = 'message'
end
return pageType
end
local getTypeForms = function( pageType )
if pageType == 'module' then
return {gen = 'tym module', acc = 'tego modułu', pronoun_gen = "его", nomP = 'Moduły'}
elseif pageType == 'widget' then
return {gen = 'tym widżecie', acc = 'tego widżetu', pronoun_gen = "его", nomP = 'Widżety'}
elseif pageType == 'stylesheet' then
return {gen = 'tym arkuszu stylów', acc = 'tego arkusza stylów', pronoun_gen = "еro", nomP = 'Arkusze stylów'}
elseif pageType == 'script' then
return {gen = 'tym skrypcie', acc = 'tego skryptu', pronoun_gen = "его", nomP = 'Skrypty'}
elseif pageType == 'message' then
return {gen = 'tej wiadomości systemowej', acc = 'tej wiadomości systemowej', pronoun_gen = "его", nomP = 'Wiadomości'}
else -- type == 'template'
return {gen = 'tym szablonie', acc = 'tego szablonu', pronoun_gen = "его", nomP = 'Szablony'}
end
end
-- Creating a documentation page or transclution through {{subst:doc}}
function p.create( f )
local args = require( 'Moduł:ProcessArgs' ).norm()
local page = mw.title.getCurrentTitle()
local docPage = args['strona'] or page.nsText .. ':' .. page.baseText .. '/' .. defaultDocPage
local out
if not args["treść"] and tostring( page ) == docPage then
out = f:preprocess( '{{subst:Szablon:Dokumentacja/preload}}' )
else
local templateArgs = {}
for _, key in ipairs{ 'typ', 'strona', 'treść' } do
local val = args[key]
if val then
if key == 'treść' then val = '\n' .. val .. '\n' end
table.insert( templateArgs, key .. '=' .. val )
end
end
out = '{{Dokumentacja|' .. table.concat( templateArgs, '|' ) .. '}}'
out = out:gsub( '|}}', '}}' )
if not args["treść"] then
out = out .. '\n<!-- Kategorie i interwiki umieść na stronie dokumentacji. -->'
end
end
if not mw.isSubsting() then
out = f:preprocess( out )
if not args['niekat'] then
out = out .. '[[Kategoria:Pages with templates requiring substitution]'
end
end
return out
end
-- Header2 on the documentation page
function p.docPage( f )
local args = require( 'Moduł:ProcessArgs' ).merge( true )
local badDoc = args['zladok']
local forceNoDoc = args['brakdok']
local docclass = "documentation-norm"
if badDoc then
docclass = "documentation-bad"
elseif forceNoDoc then
docclass = "documentation-no"
end
if forceNoDoc then
f:callParserFunction( '#dplvar:set', '$doc forced_none', '1' )
end
if f:callParserFunction( '#dplvar', '$doc noheader' ) == '1' then
if badDoc then
f:callParserFunction( '#dplvar:set', '$doc bad', '1' )
end
return
end
local page = mw.title.getCurrentTitle()
local namespace = page.nsText
local pageType = mw.ustring.lower( args['typ'] or getType( namespace, page ) )
local typeForms = getTypeForms( pageType )
local body = mw.html.create( 'div' ):addClass( 'documentation-header' )
body
:css{
['margin-bottom'] = '0.8em',
padding = '0.8em 1em 0.7em',
}
:tag( 'div' )
:css( 'float', 'right' )
:wikitext( '[[', page:fullUrl( 'action=purge' ), ' ' .. f:preprocess('{{lc:{{int:purge}}}}') .. ']]' )
:done()
:wikitext(
'To jest strona dokumentacji, ',
pageType == 'module' and 'będzie ona dołączona' or 'powinna ona być dołączona',
' na stronie głównej. ',
'Aby uzyskać więcej informacji sprawdź [[Szablon:Dokumentacja]].'
)
if badDoc then
body:wikitext( "<br>'''Dokumentacja " .. typeForms.gen .. " wymaga uzupełnienia lub ulepszenia.'''" )
elseif forceNoDoc then
body:wikitext( "<br>'''W " .. typeForms.gen .. " nie ma dokumentacji. Jeśli wiesz jak używać " .. typeForms.acc .. ", udokumentuj to.'''" )
end
if not ( args["niekat"] or namespace == 'Użytkownik' or namespace == 'Użytkowniczka' ) then
body:wikitext( '[[Kategoria:Szablony dokumentacji]]' )
end
return body
end
-- Wrapper around the documentation on the main page
function p.page( f )
-- mw.text.trim uses mw.ustring.gsub, which silently fails on large strings
local function trim( s )
return (s:gsub( '^[\t\r\n\f ]+', '' ):gsub( '[\t\r\n\f ]+$', '' ))
end
local args = require( 'Moduł:ProcessArgs' ).merge( true )
local page = mw.title.getCurrentTitle()
local namespace = page.nsText
local docText = trim( args["treść"] or '' )
if docText == '' then docText = nil end
local docPage
local noDoc
local forceNoDoc
if docText then
docPage = page
else
docPage = mw.title.new( args["strona"] or namespace .. ':' .. page.text .. '/' .. defaultDocPage)
noDoc = args["brakdok"] or not docPage.exists
end
local badDoc = args["zladok"]
local pageType = mw.ustring.lower( args['typ'] or getType( namespace, page ) )
local typeForms = getTypeForms( pageType )
if not docText and not noDoc then
f:callParserFunction( '#dplvar:set', '$doc noheader', '1' )
docText = trim( f:expandTemplate{ title = ':' .. docPage.fullText } )
if f:callParserFunction( '#dplvar', '$doc bad' ) == '1' then
badDoc = 1
end
forceNoDoc = f:callParserFunction( '#dplvar', '$doc forced_none' ) == '1'
if docText == '' and not forceNoDoc then
docText = nil
noDoc = 1
end
end
if docText then
docText = '\n' .. docText .. '\n'
end
local action = f:preprocess('{{lc:{{int:edit}}}}')
local preload = ''
local docclass = "documentation-norm"
local message
local category
if noDoc then
action = f:preprocess('{{lc:{{int:create}}}}')
preload = '&preload=Szablon:Dokumentacja/preload'
docclass = "documentation-no"
message = "'''W " .. typeForms.gen .. " nie ma dokumentacji. " ..
"Jeśli wiesz jak używać " .. typeForms.acc .. ", proszę, podaj odpowiednie informacje.'''"
if not ( args["niekat"] or namespace == 'Użytkownik' or namespace == 'Użytkowniczka' ) then
category = typeForms.nomP .. ' bez dokumentacji'
if not mw.title.new( 'Kategoria:' .. category ).exists then
category = 'Strony bez dokumentacji'
end
end
elseif forceNoDoc then
docclass = "documentation-no"
message = "'''W " .. typeForms.gen .. " nie ma dokumentacji. " ..
"Jeśli wiesz jak używać " .. typeForms.acc .. ", proszę, podaj odpowiednie informacje.'''"
if not ( args["niekat"] or namespace == 'Użytkownik' or namespace == 'Użytkowniczka' ) then
category = typeForms.nomP .. ' bez dokumentacji'
if not mw.title.new( 'Kategoria:' .. category ).exists then
category = 'Strony bez dokumentacji'
end
end
elseif badDoc then
docclass = "documentation-bad"
message = "'''Dokumentacja " .. typeForms.gen .. " wymaga uzupełnienia lub ulepszenia.'''\n"
if not ( args["niekat"] or namespace == 'Użytkownik' or namespace == 'Użytkowniczka' ) then
category = typeForms.nomP .. ' ze złą dokumentacją'
if not mw.title.new( 'Kategoria:' .. category ).exists then
category = 'Strony ze złą dokumentacją'
end
end
end
local historyLink = f:preprocess('{{lc:{{int:history short}}}}')
local purgeLink = f:preprocess('{{lc:{{int:purge}}}}')
local viewLink = f:preprocess('{{lc:{{int:view}}}}')
local links = {
'[' .. docPage:fullUrl( 'action=edit' .. preload ) .. ' ' .. action .. ']',
'[' .. docPage:fullUrl( 'action=history' ) .. ' ' .. historyLink .. ']',
'[' .. page:fullUrl( 'action=purge' ) .. ' ' .. purgeLink .. ']'
}
if not noDoc and page ~= docPage then
table.insert( links, 1, '[[' .. docPage.fullText .. '|' .. viewLink .. ']]' )
end
links = mw.html.create( 'span' )
:css( 'float', 'right' )
:wikitext( mw.text.nowiki( '[ ' ), table.concat( links, ' | ' ), mw.text.nowiki( ' ]' ) )
local body = mw.html.create( 'div' ):addClass( 'documentation ' .. docclass )
body:css{
padding = '0.8em 1em 0.7em',
['margin-top'] = '1em',
clear = 'both'
}
local header = mw.html.create( 'div' )
:addClass( 'documentation-header' )
:css{
margin = '-0.8em -1em 0.8em',
padding = '0.8em 1em 0.7em',
['border-bottom'] = 'inherit'
}
header
:node( links )
:tag( 'span' )
:css{
['font-weight'] = 'bold',
['font-size'] = '130%',
['margin-right'] = '1em',
['line-height'] = '1'
}
:wikitext( 'Dokumentacja' )
if not noDoc and pageType ~= 'template' and pageType ~= 'message' then
header
:tag( 'span' )
:css( 'white-space', 'nowrap' )
:wikitext( '[[#the-code|Przejdź do kodu ↴]]' )
end
body
:node( header ):done()
:wikitext( message )
:wikitext( docText )
if not noDoc and page ~= docPage then
body
:tag( 'div' )
:addClass( 'documentation-footer' )
:css{
margin = '0.7em -1em -0.7em',
['border-top'] = 'inherit',
padding = '0.8em 1em 0.7em',
clear = 'both'
}
:node( links )
:wikitext( 'Powyższy opis jest dołączany ze strony [[' .. docPage.fullText .. ']].' )
end
if category then
body:wikitext( "[[Kategoria:" .. category .. "]]" )
end
local anchor = ''
if not noDoc and pageType ~= 'template' and pageType ~= 'message' then
anchor = mw.html.create( 'div' ):attr( 'id', 'the-code' )
end
return tostring( body ) .. tostring( anchor )
end
return p