Minecraft Wiki
Sin resumen de edición
Sin resumen de edición
(No se muestran 4 ediciones intermedias de 2 usuarios)
Línea 1: Línea 1:
 
local p = {}
 
local p = {}
  +
local defaultDocPage = 'doc'
  +
  +
local getType = function( namespace, page )
 
local pageType = 'plantilla'
 
if namespace == 'Módulo' then
 
pageType = 'módulo'
 
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 = 'mensaje'
 
end
 
  +
return pageType
 
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 arggs = require( 'Módbulo:ProcessArgs' ).norm()
+
local args = require( 'Módulo:ProcessArgs' ).norm()
page = mw.title.getCurrentTgitle()
+
local page = mw.title.getCurrentTitle()
namespace = args.type or page.nsText
+
local docPage = args.page or page.nsText .. ':' .. page.baseText .. '/' .. defaultDocPage
docPage = args.page or namespace .. ':' .. pagge.baseText .. '/doc'
 
 
 
 
local out
 
local out
if page.fullText == docbPage then
+
if not args.content and tostring( page ) == docPage then
out = f:preprocess( '{{Fgilepath: ItemCSS.png‎}}' )
+
out = f:preprocess( '{{subst:Plantilla:Documentación/preload}}' )
 
else
 
else
local tegmplateArgs = {}
+
local templateArgs = {}
  +
for _, key in ipairs{ 'type', 'page', 'content' } do
if args.type then
 
table.insert( templateArgs, 'type=' .. args.type )
+
local val = args[key]
  +
if val then
end
 
  +
if key == 'content' then val = '\n' .. val .. '\n' end
if args.page then
 
table.insert( templateArgs, 'page=' .. args.page )
+
table.insert( templateArgs, key .. '=' .. val )
  +
end
 
end
 
end
 
 
out = '{{docubmentation|' .. table.concat( templateArgs, '|' ) .. '}}\n<!-- Pon las categorías e interwikis en la página de documentación -->'
+
out = '{{documentación|' .. table.concat( templateArgs, '|' ) .. '}}'
 
out = out:gsub( '|}}', '}}' )
 
out = out:gsub( '|}}', '}}' )
  +
 
if not args.content then
  +
out = out .. '\n<!-- Coloca las categorías/interwikis en la página de documentación -->'
 
end
 
end
 
end
 
 
Línea 37: Línea 60:
 
local args = require( 'Módulo:ProcessArgs' ).merge( true )
 
local args = require( 'Módulo:ProcessArgs' ).merge( true )
 
local badDoc = args.baddoc
 
local badDoc = args.baddoc
if f:callPgarserFunction( '#dplvar:noheader' ) == '1' then
+
if f:callParserFunction( '#dplvar', '$doc noheader' ) == '1' then
 
if badDoc then
 
if badDoc then
f:callParserFunction( '#dplvar:set', 'baddoc', '1' )
+
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 = args.type or page.nsText
+
local namespace = page.nsText
local pageType = 'plantilla'
+
local pageType = mw.ustring.lower( args.type or getType( namespace, page ) )
local art = 'esta'
 
if namespace == 'Módulo' then
 
pageType = 'módulo'
 
art = 'este'
 
elseif page.fullText:find( '.css$' ) then
 
pageType = 'hoja de estilo'
 
elseif page.fullText:find( '.js$' ) then
 
pageType = 'script'
 
art = 'este'
 
elseif namespace == 'MediaWiki' then
 
pageType = 'mensaje'
 
art = 'este'
 
end
 
 
 
  +
local body = mw.html.create( 'div' ):addClass( 'documentation-header' )
local colgour = 'EAF4F9'
 
  +
body
local message = ''
 
  +
:css{
  +
['margin-bottom'] = '0.8em',
  +
padding = '0.8em 1em 0.7em',
  +
['background-color'] = '#' .. ( badDoc and 'F9F2EA' or 'EAF4F9' ),
  +
border = '1px solid #AAA'
 
}
  +
:tag( 'div' )
  +
:css( 'float', 'right' )
 
:wikitext( '[[', page:fullUrl( 'action=purge' ), ' depurar]]' )
  +
:done()
  +
:wikitext(
  +
'Esta es la página de documentación. Esta ',
  +
pageType == 'módulo' and 'será' or 'debería ser',
  +
' transcluída en la página', pageType, ' principal. ',
  +
'Véase la [[Plantilla:Documentación]] para más información'
  +
)
 
if badDoc then
 
if badDoc then
  +
body:wikitext( "<br>''La documentación de esta/este ", pageType, " necesita mejorarse o más información.'''" )
colour = 'F9F2EA'
 
message = "'''Es necesario añadir información adicional o mejorar la documentación de " .. art .. " " .. pageType .. ".'''"
 
 
end
 
end
 
if not ( args.nocat or namespace == 'Usuario' ) then
 
 
body:wikitext( '[[Categoría:Páginas de documentación]]' )
local certainty = 'debería ser'
 
if pageType == 'módulo' then
 
certainty = 'será'
 
 
end
 
end
 
 
  +
return body
local category = ''
 
if not args.nocat then
 
category = '[[Categoría:Páginas de documentación]]'
 
end
 
 
local out = table.concat( {
 
'<div style="margin-bottom:0.8em;padding:0.8em 1em 0.7em;background-color:#' .. colour .. ';border:1px solid #AAA">',
 
'<div style="float:right">[[' .. page:fullUrl( 'action=purge' ) .. ' depurar]]</div>',
 
'<p style="margin: 0">Esta es la página de documentación, la cual ' .. certainty .. ' incluida en la página principal de ' .. art .. ' ' .. pageType .. '. Véase [[Plantilla:Documentación]] para más información.</p>',
 
message,
 
'</div>',
 
category
 
}, '\n' )
 
 
return mw.text.trim( out )
 
 
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 )
  +
-- 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 ]+$', '' ))
  +
--return string.gsub( s, '^[\t\r\n\f ]*(.-)[\t\r\n\f ]*$', '%1' )
  +
end
 
local args = require( 'Módulo:ProcessArgs' ).merge( true )
 
local args = require( 'Módulo:ProcessArgs' ).merge( true )
 
local page = mw.title.getCurrentTitle()
 
local page = mw.title.getCurrentTitle()
local namespace = args.type or page.nsText
+
local namespace = page.nsText
local docPage = mw.title.new( args.page or namespace .. ':' .. page.text .. '/doc' )
+
local docText = trim( args.content or '' )
  +
if docText == '' then docText = nil end
local noDoc = args.nodoc or not docPage.exists
 
 
local badDoc = args.baddoc
 
local pageType = 'plantilla'
+
local docPage
local pageType2 = ''
+
local noDoc
 
if docText then
local art1 = 'Esta'
 
  +
docPage = page
local art2 = 'la'
 
 
else
local art3 = 'esta'
 
 
docPage = mw.title.new( args.page or namespace .. ':' .. page.text .. '/' .. defaultDocPage )
if namespace == 'Módulo' then
 
 
noDoc = args.nodoc or not docPage.exists
pageType = 'módulo'
 
art1 = 'Este'
 
art2 = 'lo'
 
art3 = 'este'
 
elseif page.fullText:find( '.css$' ) then
 
pageType = 'hoja'
 
pageType2 = ' de estilos'
 
elseif page.fullText:find( '.js$' ) then
 
pageType = 'script'
 
art1 = 'Este'
 
art2 = 'lo'
 
art3 = 'este'
 
elseif namespace == 'MediaWiki' then
 
pageType = 'mensaje'
 
art1 = 'Este'
 
art2 = 'lo'
 
art3 = 'este'
 
 
end
 
end
 
local badDoc = args.baddoc
  +
local pageType = mw.ustring.lower( args.type or getType( namespace, page ) )
 
 
local docText = ''
+
if not docText and not noDoc then
 
f:callParserFunction( '#dplvar:set', '$doc noheader', '1' )
if not noDoc then
 
 
docText = trim( f:expandTemplate{ title = ':' .. docPage.fullText } )
f:callParserFunction( '#dplvar:set', 'noheader', '1' )
 
 
if f:callParserFunction( '#dplvar', '$doc bad' ) == '1' then
docText = mw.text.trim( f:expandTemplate{ title = ':' .. docPage.fullText } )
 
if f:callParserFunction( '#dplvar:baddoc' ) == '1' then
 
 
badDoc = 1
 
badDoc = 1
 
end
 
end
 
 
 
if docText == '' then
 
if docText == '' then
 
docText = nil
 
noDoc = 1
 
noDoc = 1
else
 
docText = '__NOEDITSECTION__\n' .. docText .. '\n'
 
 
end
 
end
  +
end
 
if docText then
 
docText = '\n' .. docText .. '\n'
 
end
 
end
 
 
Línea 141: Línea 142:
 
local preload = ''
 
local preload = ''
 
local colour = 'EAF4F9'
 
local colour = 'EAF4F9'
local message = ''
+
local message
local category = ''
+
local category
 
if noDoc then
 
if noDoc then
 
action = 'crear'
 
action = 'crear'
 
preload = '&preload=Plantilla:Documentación/preload'
 
preload = '&preload=Plantilla:Documentación/preload'
 
colour = 'F9EAEA'
 
colour = 'F9EAEA'
message = "'''" .. art1 .. " " .. pageType .. "" .. pageType2 .. " no tiene documentación. Si sabes como usar" .. art2 .. ", por favor, creala.'''"
+
message = "'''Esta/Este " .. pageType .. " no tiene documentación. " ..
  +
"Si sabe cómo usar esta/este " .. pageType .. ", por favor créelo.'''"
if not args.nocat then
+
if not ( args.nocat or namespace == 'Usuario' ) then
if mw.title.new( 'Categoría:' .. pageType .. 's' .. pageType2 .. ' sin documentación' ).exists then
 
category = '[[Categoría:' .. pageType .. 's' .. pageType2 .. ' sin documentación]]'
+
category = pageType .. 's sin documentación'
 
if not mw.title.new( 'Categoría:' .. category ).exists then
else
 
category = '[[Categoría:Páginas sin documentación]]'
+
category = 'Páginas sin documentación'
 
end
 
end
 
end
 
end
 
elseif badDoc then
 
elseif badDoc then
 
colour = 'F9F2EA'
 
colour = 'F9F2EA'
message = "'''Es necesario añadir información adicional o mejorar la documentación de " .. art3 .. "" .. pageType .. "" .. pageType2 .. ".'''\n"
+
message = "'''La documentación de esta/este " .. pageType .. " necesita mejorarse o más información.'''\n"
if not args.nocat then
+
if not ( args.nocat or namespace == 'Usuario' ) then
if mw.title.new( 'Categoría:' .. pageType .. 's' .. pageType2 .. ' con una mala documentación' ).exists then
+
category = pageType .. 's con mala documentación'
  +
if not mw.title.new( 'Categoría:' .. category ).exists then
category = '[[Categoría:' .. pageType .. 's' .. pageType2 .. ' con una mala documentación]]'
+
category = 'Páginas con mala documentación'
else
 
category = '[[Categoría:Páginas con una mala documentación]]'
 
 
end
 
end
 
end
 
end
Línea 169: Línea 169:
 
local links = {
 
local links = {
 
'[' .. docPage:fullUrl( 'action=edit' .. preload ) .. ' ' .. action .. ']',
 
'[' .. docPage:fullUrl( 'action=edit' .. preload ) .. ' ' .. action .. ']',
  +
'[' .. docPage:fullUrl( 'action=history' ) .. ' historia]',
 
'[' .. page:fullUrl( 'action=purge' ) .. ' depurar]'
 
'[' .. page:fullUrl( 'action=purge' ) .. ' depurar]'
 
}
 
}
  +
if not noDoc and page ~= docPage then
local footer = ''
 
if not noDoc then
 
 
table.insert( links, 1, '[[' .. docPage.fullText .. '|ver]]' )
 
table.insert( links, 1, '[[' .. docPage.fullText .. '|ver]]' )
footer = table.concat( {
 
'<div style="margin:0.7em -1em -0.7em;background-color:#EAF4F9;border-top:1px solid #AAA;padding:0.8em 1em 0.7em;clear:both">\n',
 
'<div style="float:right">' .. mw.text.nowiki( '[' ) .. table.concat( links, ' | ' ) .. ']</div>\n',
 
'<p style="margin:0">La documentación anterior se ha incluido desde [[' .. docPage.fullText .. ']].</p>\n',
 
'</div>\n'
 
} )
 
 
end
 
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' )
local out = {
 
  +
body:css{
'<div style="backbground-color:#' .. colour .. ';border:1px solid #AAA;padding:0.8em 1em 0.7em;margin-top:1em;clear:both">\n',
 
  +
['background-color'] = '#' .. colour,
'<div style="margin:-0.8em -1em 0.8em;padding: 0.8em 1em 0.7em;background-color:#EAF4F9;border-bottom:1px solid #AAA">\n',
 
  +
border = '1px solid #AAA',
'<div style="float:right">' .. mw.text.nowiki( '[' ) .. table.concat( links, ' | ' ) .. ']</div>\n',
 
  +
padding = '0.8em 1em 0.7em',
'<span style="font-weight:bold;font-size:130%">Documentación</span>',
 
  +
['margin-top'] = '1em',
'</div>\n',
 
  +
clear = 'both'
message,
 
docText,
 
footer,
 
'</div>\n',
 
category
 
 
}
 
}
 
 
  +
local header = mw.html.create( 'div' )
return mw.text.trim( table.concat( out ) )
 
  +
:css{
  +
margin = '-0.8em -1em 0.8em',
  +
padding = '0.8em 1em 0.7em',
  +
['background-color'] = '#EAF4F9',
  +
['border-bottom'] = 'inherit'
  +
}
 
  +
header
  +
:node( links )
  +
:tag( 'span' )
  +
:css{
  +
['font-weight'] = 'bold',
  +
['font-size'] = '130%',
  +
['margin-right'] = '1em',
  +
['line-height'] = '1'
 
}
  +
:wikitext( 'Documentación' )
  +
 
local codePages = {
  +
module = true,
  +
stylesheet = true,
  +
script = true,
  +
}
  +
if not noDoc and codePages[pageType] then
  +
header
  +
:tag( 'span' )
  +
:css( 'white-space', 'nowrap' )
  +
:wikitext( '[[#el-código|Ver el código ↴]]' )
  +
end
  +
  +
body
  +
:node( header ):done()
 
:wikitext( message )
  +
:wikitext( docText )
  +
  +
if not noDoc and page ~= docPage then
  +
body
  +
:tag( 'div' )
  +
:css{
  +
margin = '0.7em -1em -0.7em',
  +
['background-color'] = '#EAF4F9',
  +
['border-top'] = 'inherit',
  +
padding = '0.8em 1em 0.7em',
  +
clear = 'both'
  +
}
  +
:node( links )
 
:wikitext( 'La documentación arriba es transcluída desde [[', docPage.fullText, ']].' )
  +
end
  +
 
if category then
  +
body:wikitext( f:expandTemplate{ title = 'Translation category', args = { category, project = '0' } } )
  +
end
  +
 
local anchor = ''
  +
if not noDoc and pageType ~= 'plantilla' and pageType ~= 'mensaje' then
  +
anchor = mw.html.create( 'div' ):attr( 'id', 'el-código' )
  +
end
  +
  +
return tostring( body ) .. tostring( anchor )
 
end
 
end
  +
 
return p
 
return p

Revisión del 05:13 19 dic 2020

Este módulo implementa {{Documentación}}.

Dependencias

[ver | editar | historia | depurar]La documentación arriba es transcluída desde Módulo:Documentation/doc.
local p = {}
local defaultDocPage = 'doc'

local getType = function( namespace, page )
	local pageType = 'plantilla'
	if namespace == 'Módulo' then
		pageType = 'módulo'
	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 = 'mensaje'
	end
	
	return pageType
end

-- Creating a documentation page or transclution through {{subst:doc}}
function p.create( f )
	local args = require( 'Módulo:ProcessArgs' ).norm()
	local page = mw.title.getCurrentTitle()
	local docPage = args.page or page.nsText .. ':' .. page.baseText .. '/' .. defaultDocPage
	
	local out
	if not args.content and tostring( page ) == docPage then
		out = f:preprocess( '{{subst:Plantilla:Documentación/preload}}' )
	else
		local templateArgs = {}
		for _, key in ipairs{ 'type', 'page', 'content' } do
			local val = args[key]
			if val then
				if key == 'content' then val = '\n' .. val .. '\n' end
				table.insert( templateArgs, key .. '=' .. val )
			end
		end
		
		out = '{{documentación|' .. table.concat( templateArgs, '|' ) .. '}}'
		out = out:gsub( '|}}', '}}' )
		
		if not args.content then
			out = out .. '\n<!-- Coloca las categorías/interwikis en la página de documentación -->'
		end
	end
	
	if not mw.isSubsting() then
		out = f:preprocess( out )
		if not args.nocat then
			out = out .. '[[Categoría:Páginas con plantillas que necesitan una sustitución]]'
		end
	end
	
	return out
end

-- Header on the documentation page
function p.docPage( f )
	local args = require( 'Módulo:ProcessArgs' ).merge( true )
	local badDoc = args.baddoc
	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.type or getType( namespace, page ) )
	
	local body = mw.html.create( 'div' ):addClass( 'documentation-header' )
	body
		:css{
			['margin-bottom'] = '0.8em',
			padding = '0.8em 1em 0.7em',
			['background-color'] = '#' .. ( badDoc and 'F9F2EA' or 'EAF4F9' ),
			border = '1px solid #AAA'
		}
		:tag( 'div' )
			:css( 'float', 'right' )
			:wikitext( '[[', page:fullUrl( 'action=purge' ), ' depurar]]' )
		:done()
		:wikitext(
			'Esta es la página de documentación. Esta ',
			pageType == 'módulo' and 'será' or 'debería ser',
			' transcluída en la página', pageType, ' principal. ',
			'Véase la [[Plantilla:Documentación]] para más información'
		)
	if badDoc then
		body:wikitext( "<br>''La documentación de esta/este ", pageType, " necesita mejorarse o más información.'''" )
	end
	if not ( args.nocat or namespace == 'Usuario' ) then
		body:wikitext( '[[Categoría:Páginas de documentación]]' )
	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 ]+$', '' ))
		--return string.gsub( s, '^[\t\r\n\f ]*(.-)[\t\r\n\f ]*$', '%1' )
	end
	local args = require( 'Módulo:ProcessArgs' ).merge( true )
	local page = mw.title.getCurrentTitle()
	local namespace = page.nsText
	local docText = trim( args.content or '' )
	if docText == '' then docText = nil end
	
	local docPage
	local noDoc
	if docText then
		docPage = page
	else
		docPage = mw.title.new( args.page or namespace .. ':' .. page.text .. '/' .. defaultDocPage )
		noDoc = args.nodoc or not docPage.exists
	end
	local badDoc = args.baddoc
	local pageType = mw.ustring.lower( args.type or getType( namespace, page ) )
	
	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
		
		if docText == '' then
			docText = nil
			noDoc = 1
		end
	end
	if docText then
		docText = '\n' .. docText .. '\n'
	end
	
	local action = 'editar'
	local preload = ''
	local colour = 'EAF4F9'
	local message
	local category
	if noDoc then
		action = 'crear'
		preload = '&preload=Plantilla:Documentación/preload'
		colour = 'F9EAEA'
		message = "'''Esta/Este " .. pageType .. " no tiene documentación. " ..
			"Si sabe cómo usar esta/este " .. pageType .. ", por favor créelo.'''"
		if not ( args.nocat or namespace == 'Usuario' ) then
			category = pageType .. 's sin documentación'
			if not mw.title.new( 'Categoría:' .. category ).exists then
				category = 'Páginas sin documentación'
			end
		end
	elseif badDoc then
		colour = 'F9F2EA'
		message = "'''La documentación de esta/este " .. pageType .. " necesita mejorarse o más información.'''\n"
		if not ( args.nocat or namespace == 'Usuario' ) then
			category = pageType .. 's con mala documentación'
			if not mw.title.new( 'Categoría:' .. category ).exists then
				category = 'Páginas con mala documentación'
			end
		end
	end
	
	local links = {
		'[' .. docPage:fullUrl( 'action=edit' .. preload ) .. ' ' .. action .. ']',
		'[' .. docPage:fullUrl( 'action=history' ) .. ' historia]',
		'[' .. page:fullUrl( 'action=purge' ) .. ' depurar]'
	}
	if not noDoc and page ~= docPage then
		table.insert( links, 1, '[[' .. docPage.fullText .. '|ver]]' )
	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' )
	body:css{
		['background-color'] = '#' .. colour,
		border = '1px solid #AAA',
		padding = '0.8em 1em 0.7em',
		['margin-top'] = '1em',
		clear = 'both'
	}
	
	local header = mw.html.create( 'div' )
		:css{
			margin = '-0.8em -1em 0.8em',
			padding = '0.8em 1em 0.7em',
			['background-color'] = '#EAF4F9',
			['border-bottom'] = 'inherit'
		}
	
	header
		:node( links )
		:tag( 'span' )
			:css{
				['font-weight'] = 'bold',
				['font-size'] = '130%',
				['margin-right'] = '1em',
				['line-height'] = '1'
			}
			:wikitext( 'Documentación' )
	
	local codePages = {
		module = true,
		stylesheet = true,
		script = true,
	}
	if not noDoc and codePages[pageType] then
		header
			:tag( 'span' )
				:css( 'white-space', 'nowrap' )
				:wikitext( '[[#el-código|Ver el código ↴]]' )
	end
	
	body
		:node( header ):done()
		:wikitext( message )
		:wikitext( docText )
	
	if not noDoc and page ~= docPage then
		body
			:tag( 'div' )
				:css{
					margin = '0.7em -1em -0.7em',
					['background-color'] = '#EAF4F9',
					['border-top'] = 'inherit',
					padding = '0.8em 1em 0.7em',
					clear = 'both'
				}
				:node( links )
				:wikitext( 'La documentación arriba es transcluída desde [[', docPage.fullText, ']].' )
	end
	
	if category then
		body:wikitext( f:expandTemplate{ title = 'Translation category', args = { category, project = '0' } } )
	end
	
	local anchor = ''
	if not noDoc and pageType ~= 'plantilla' and pageType ~= 'mensaje' then
		anchor = mw.html.create( 'div' ):attr( 'id', 'el-código' )
	end
	
	return tostring( body ) .. tostring( anchor )
end

return p