|
|
| Sətir 43: |
Sətir 43: |
| end | | end |
|
| |
|
|
| |
|
| |
| function refid(label, args)
| |
| local p = args.p or ""
| |
| local pp = args.pp or ""
| |
| local loc = args.loc or ""
| |
| return anchorid(label, args) .. p .. pp .. loc
| |
| end
| |
|
| |
| function name(args)
| |
| local P1 = trim(args[1]) or ""
| |
| if ( args[5] ~= nil) then
| |
| return P1 .. " et al."
| |
| else
| |
| local P2 = trim(args[2]) or ""
| |
| local P3 = trim(args[3]) or ""
| |
| local P4 = trim(args[4]) or ""
| |
| if ( args[4] ~= nil ) then
| |
| P4 = " " .. P4
| |
| P3 = " & " .. P3
| |
| P2 = ", " .. P2
| |
| elseif ( args[3] ~= nil ) then
| |
| P3 = " " .. P3
| |
| P2 = " & " .. P2
| |
| elseif ( args[2] ~= nil ) then
| |
| P2 = " " .. P2
| |
| end
| |
| return P1 .. P2 .. P3 .. P4
| |
| end
| |
| end
| |
|
| |
| function crossref(frame, label, args)
| |
| local config = frame.args -- the arguments passed BY the template, in the wikitext of the template itself
| |
| local LB = config.BracketLeft or ""
| |
| local RB = config.BracketRight or ""
| |
| local anchor = args.ref or args.Ref or anchorid( label, args)
| |
| local text = name(args)
| |
| local loc = args.loc
| |
| local page
| |
| local pages = args.pp or args.pages
| |
| if pages == nil or pages == '' then
| |
| page = args.p or args.page;
| |
| end
| |
| if nil == loc then loc = "" else loc = " " .. loc end
| |
| if ( page ~= nil ) then
| |
| local pagesep = config.PageSep or ", p. "
| |
| loc = loc .. pagesep .. page
| |
| end
| |
| if ( pages ~= nil ) then
| |
| local pagessep = config.PagesSep or ", pp. "
| |
| loc = loc .. pagessep .. pages
| |
| end
| |
| local pagename = args.pagename or ""
| |
| local ps = args.Postscript or ""
| |
| return LB .. "[[" .. pagename .. "#" .. anchor .. "|" .. text .. "]]" .. loc .. RB .. ps
| |
| end
| |
|
| |
|
| function r0(frame, name, group, page) | | function r0(frame, name, group, page) |