Modul:PageTree: Unterschied zwischen den Versionen

update
w>PerfektesChaos
(update)
w>PerfektesChaos
(update)
Zeile 1: Zeile 1:
--[=[ 2014-05-20
--[=[ 2014-06-03
 
Module:pageTree
Module:pageTree
]=]
]=]
Zeile 8: Zeile 9:
local Current = { }
local Current = { }
local Sort    = false
local Sort    = false
local Strings = { "segment", "self", "stamped", "subpager", "suppress" }
local Toggles = { "lazy", "level", "lineup", "light", "linked", "list" }
local Toggles = { "lazy", "level", "lineup", "light", "linked", "list" }


Zeile 352: Zeile 354:
local function first( a1, a2, abs )
local function first( a1, a2, abs )
     -- Compare a1 with a2 in lexicographical order
     -- Compare a1 with a2 in lexicographical order
     --    a1     -- table, with page entry
     --    a1   -- table, with page entry
     --    a2     -- table, with page entry
     --    a2   -- table, with page entry
     --    alter -- true, if .show to be used rather than .seed
     --    abs -- true, if .show to be used rather than .seed
     -- Returns true if a1 < a2
     -- Returns true if a1 < a2
     if not a1.sort then
     if not a1.sort then
         if alter then
         if abs then
             face( a1 )
             face( a1 )
             a1.sort = filter( a1.show )
             a1.sort = filter( a1.show )
Zeile 365: Zeile 367:
     end
     end
     if not a2.sort then
     if not a2.sort then
         if alter then
         if abs then
             face( a2 )
             face( a2 )
             a2.sort = filter( a2.show )
             a2.sort = filter( a2.show )
Zeile 716: Zeile 718:
                 end
                 end
                 if not Current.pages[ Current.self ] then
                 if not Current.pages[ Current.self ] then
                     life = false
                    if type( Current.pages[ true ] ) == "table" then
                        Current.self = true
                     else
                        life = false
                    end
                 end
                 end
             end
             end
Zeile 783: Zeile 789:
     if r then
     if r then
         params.frame = frame
         params.frame = frame
        for k, v in pairs( Strings ) do
            if pars[ v ]  and  pars[ v ] ~= "" then
                params[ v ] = pars[ v ]
            end
        end -- for k, v
         for k, v in pairs( Toggles ) do
         for k, v in pairs( Toggles ) do
             if pars[ v ] then
             if pars[ v ] then
Zeile 788: Zeile 799:
             end
             end
         end -- for k, v
         end -- for k, v
        params.segment  = pars.segment
        params.stamped  = pars.stamped
        params.suppress = pars.suppress
        if pars.template then
            if action == "subpages" then
                params.subpager = pars.template
            end
        end
         lucky, r = pcall( forward, params )
         lucky, r = pcall( forward, params )
     else
     else
Zeile 815: Zeile 818:
-- lazy  = do not number but use bullets or nothing
-- lazy  = do not number but use bullets or nothing
-- level  = top level entries only
-- level  = top level entries only
-- light  =
-- light  = strip prefix
-- linked = show redirects
-- linked = show redirects
-- list  = show suppressed entries
-- list  = show suppressed entries
Zeile 824: Zeile 827:


function p.check( frame )
function p.check( frame )
    --    #invoke|check|Hilfe:|linked=1
     return  framed( frame, "check" )
     return  framed( frame, "check" )
end -- p.path
end -- p.path
Anonymer Benutzer