Module:Collective work header

require('strict')

local p = {}

local getArgs = require('Module:Arguments').getArgs local yesno = require('Module:Yesno') local header = require('Module:Header')._header

function p._collective_work_header(args) local current_title = mw.title.getCurrentTitle local basename = args.basename or current_title.rootText args.title =  .. (args.displayname or basename) ..  if not args.section and current_title.isSubpage then args.section = current_title.subpageText end if args.previous then args.previous =  .. args.previous ..  end if args['next'] then args['next'] =  .. args['next'] ..  end local notes_table = {} local volume = args.volume or args.vol if volume then table.insert(notes_table, ' From volume ' .. volume .. ' of the work. ') end if args.disclaimer then table.insert(notes_table, " \'\'\'See also\'\'\' the ' .. args.disclaimer .. '. ') end if args.notes then table.insert(notes_table, args.notes) end args.notes = table.concat(notes_table, '\n') if args.notes == '' then args.notes = nil end local cat = '' if not yesno(args.nocat) and current_title:inNamespace(0) then if yesno(args.noarticle) then cat = '' else cat = '' end end return header(args) .. cat end

function p.collective_work_header(frame) return p._collective_work_header(getArgs(frame)) end

return p