Module:Documentation: Difference between revisions
m Add debug logs |
Replace faulty dplvars |
||
| Line 16: | Line 16: | ||
end | end | ||
return pageType | return pageType | ||
end | end | ||
| Line 62: | Line 61: | ||
local badDoc = args.baddoc | local badDoc = args.baddoc | ||
mw.logObject(badDoc, "Module:Documentation: badDoc") | mw.logObject(badDoc, "Module:Documentation: badDoc") | ||
local page = mw.title.getCurrentTitle() | local page = mw.title.getCurrentTitle() | ||
| Line 76: | Line 67: | ||
page = page.basePageTitle | page = page.basePageTitle | ||
end | end | ||
local docPage = mw.title.new( args.page or page.nsText .. ':' .. page.baseText .. '/' .. defaultDocPage ) | |||
mw.logObject(docPage, "Module:Documentation: docPage") | |||
mw.logObject(page, "Module:Documentation: page") | |||
if docPage ~= page then return end | |||
local namespace = page.nsText | local namespace = page.nsText | ||
local pageType = mw.ustring.lower( args.type or getType( namespace, page ) ) | local pageType = mw.ustring.lower( args.type or getType( namespace, page ) ) | ||
| Line 81: | Line 78: | ||
local body = mw.html.create( 'div' ):addClass( 'documentation-header' ) | local body = mw.html.create( 'div' ):addClass( 'documentation-header' ) | ||
body | body | ||
:css({ | |||
['border-bottom'] = '1px solid #a2a9b1', | |||
['margin-bottom'] = '1em' | |||
}) | |||
:addClass( badDoc and 'documentation-badDoc' or '' ) | :addClass( badDoc and 'documentation-badDoc' or '' ) | ||
:tag( 'div' ) | :tag( 'div' ) | ||
| Line 100: | Line 101: | ||
mw.logObject(body, "Module:Documentation: body") | mw.logObject(body, "Module:Documentation: body") | ||
return tostring(body) | return tostring(body) | ||
end | end | ||
| Line 132: | Line 133: | ||
if not docText and not noDoc then | if not docText and not noDoc then | ||
docText = trim( f:expandTemplate{ title = ':' .. docPage.fullText } ) | docText = trim( f:expandTemplate{ title = ':' .. docPage.fullText } ) | ||
if docText == '' then | if docText == '' then | ||