Modul:Vorlage:LuaModuleDoc: Unterschied zwischen den Versionen

update
(update)
(update)
Zeile 1: Zeile 1:
--[=[ 2013-05-07
--[=[ 2013-05-10
Support {{LuaModuleDoc}}
Support {{LuaModuleDoc}}
* nav()
* nav()
Zeile 7: Zeile 7:




local import, LuaWiki = pcall( require, "Modul:LuaWiki" )
-- Module globals
local import, LuaWiki = pcall( require, "Module:LuaWiki" )
local currentTitle




Zeile 52: Zeile 54:
     --    args.pageNav defined
     --    args.pageNav defined
     -- Uses:
     -- Uses:
    --    >< currentTitle
     --    LuaWiki.getArg()
     --    LuaWiki.getArg()
     --    LuaWiki.transclude()
     --    LuaWiki.transclude()
Zeile 58: Zeile 61:
     --    navError()
     --    navError()
     local r = LuaWiki.transclude( swift, collect )
     local r = LuaWiki.transclude( swift, collect )
     local s = LuaWiki.getVariable( "TALKPAGENAME" )
     local s = false
     if not LuaWiki.isExisting( s ) then
    local t = currentTitle.talkPageTitle
    if t then
        s = t.exists
    end
     if not s then
         if super then
         if super then
             s = "NoTalkCentral"
             s = "NoTalkCentral"
Zeile 142: Zeile 149:
     --    super  -- string; central documentation root
     --    super  -- string; central documentation root
     -- Return:
     -- Return:
     --    table:  args for navigation templates
     --    table:  args for navigation template
     --            [1] basic module name
     --            [1] basic module name
     --            [2] number of language codes  +  1
     --            [2] number of language codes  +  1
Zeile 156: Zeile 163:
     local r = { }
     local r = { }
     local specified = LuaWiki.getArg( "langsRequest", false )
     local specified = LuaWiki.getArg( "langsRequest", false )
    if type( specified ) == "string" then
        if specified:match( "^%s*$" ) then
            specified = false
        end
    end
     navLang( LuaWiki.getArg( "langsDefault" ),
     navLang( LuaWiki.getArg( "langsDefault" ),
             r,
             r,
             ( type( specified ) == "string" ) )
             specified )
     navLang( specified, r, false )
     navLang( specified, r, false )
     if #r < 1 then
     if #r < 1 then
Zeile 193: Zeile 205:
     -- Uses:
     -- Uses:
     --    LuaWiki.getArg()
     --    LuaWiki.getArg()
    --    LuaWiki.getVariable()
     --    navError()
     --    navError()
     --    navLangs()
     --    navLangs()
Zeile 202: Zeile 213:
         local light  = false
         local light  = false
         local script
         local script
         local story  = LuaWiki.getVariable( "PAGENAME" ) .. "/"
         local story  = currentTitle.text .. "/"
         if lead then
         if lead then
             -- any template transclusion happens on a doc page
             -- any template transclusion happens on a doc page
Zeile 245: Zeile 256:
     -- Start execution; return navigation text; analyze namespace
     -- Start execution; return navigation text; analyze namespace
     -- Uses:
     -- Uses:
     --    LuaWiki.initVariables()
     --    >< currentTitle
     --    LuaWiki.getArg()
     --    LuaWiki.getArg()
     --    LuaWiki.getVariable()
     --    mw.title.getCurrentTitle()
     --    navPage()
     --    navPage()
     --    navError()
     --    navError()
     local r
     local r
    LuaWiki.initVariables( { { "NAMESPACENUMBER", true },
     local nsDocs = LuaWiki.getArg( "nsDocs" )
                              "PAGENAME",
                              "TALKPAGENAME" } )
     local nsDocs = LuaWiki.getArg( "nsDocs" )
     if nsDocs then
     if nsDocs then
         local ns  = LuaWiki.getVariable( "NAMESPACENUMBER" )
        currentTitle = mw.title.getCurrentTitle()
         local ns  = currentTitle.namespace
         local lead = ( ns == mw.site.namespaces.Module.id )
         local lead = ( ns == mw.site.namespaces.Module.id )
         nsDocs = tonumber( nsDocs )
         nsDocs = tonumber( nsDocs )
Anonymer Benutzer