Module:Documentation: Difference between revisions

mNo edit summary
mNo edit summary
 
Line 1: Line 1:
-- <nowiki>
-- <nowiki>
local dependencyList = require( 'Module:DependencyList' )
local yn = require( 'Module:Yesno' )
local yn = require( 'Module:Yesno' )
local p = {}
local p = {}
Line 7: Line 8:
     local args = frame:getParent().args
     local args = frame:getParent().args
     local page = args[1] or mw.ustring.gsub( title.fullText, '/doc$', '' )
     local page = args[1] or mw.ustring.gsub( title.fullText, '/doc$', '' )
    local addDependencyList = yn( args.DependencyList or true )
     local ret, cats, ret1, ret2, ret3
     local ret, cats, ret1, ret2, ret3
     local onModule = title.namespace == 828
     local onModule = title.namespace == 828
Line 39: Line 41:
         if title.namespace == 10 then -- Template namespace
         if title.namespace == 10 then -- Template namespace
             cats = '[[Category:Template documentation|' .. title.baseText .. ']]'
             cats = '[[Category:Template documentation|' .. title.baseText .. ']]'
             ret2 = addDependencyList and dependencyList._main() or ''
             ret2 = addDependencyList and dependencyList._main(nil, args.category, args.isUsed) or ''
         elseif title.namespace == 116 then -- Calculator namespace
         elseif title.namespace == 116 then -- Calculator namespace
         cats = ''
         cats = ''
         ret2 = addDependencyList and dependencyList._main() or ''
         ret2 = addDependencyList and dependencyList._main(nil, args.category, args.isUsed) or ''
         elseif title.namespace == 828 then -- Module namespace
         elseif title.namespace == 828 then -- Module namespace
         cats = '[[Category:Module documentation|' .. title.baseText .. ']]'
         cats = '[[Category:Module documentation|' .. title.baseText .. ']]'
         ret2 = addDependencyList and dependencyList._main() or ''
         ret2 = addDependencyList and dependencyList._main(nil, args.category, args.isUsed) or ''
         else
         else
         cats = ''
         cats = ''
Line 81: Line 83:
             :done()
             :done()
      
      
     ret3 = addDependencyList and dependencyList._main() or ''
     ret3 = addDependencyList and dependencyList._main(nil, args.category, args.isUsed) or ''
          
          
     return ret1 .. tostring( ret2 ) .. '<div class="documentation-content">' .. ret3
     return ret1 .. tostring( ret2 ) .. '<div class="documentation-content">' .. ret3