local p =
local format = string.format -- Local version of string formatting function
local function hatnote(args) local insert = table.insert local text = local tense local hatnoteArg = args.hatnote if hatnoteArg
'yes' local verb = tense and 'was' or 'is' insert(text, format("The entire %s %s in ", args.type or 'route', verb)) if indep_city then insert(text, format("%s", indep_city, region, indep_city)) else local sub1name = args.sub1name if sub2 then insert(text, "%s", region, sub2)) end if sub1 then if sub2 then insert(text, ', ') end insert(text, format("%s %s", sub1, sub1name, region, sub1, sub1name)) end end insert(text, '. ') insert(text, args.sub1_ref) insert(text, args.sub2_ref) end end if args.unnum
local function header(args) local row = mw.html.create('tr') local region_col = args.region_col if region_col then row:tag('th'):attr('scope', 'col'):wikitext(mw.language.getContentLanguage:ucfirst(region_col)) end local indep_city = args.indep_city if not(args.nosub1
'old' then row:tag('th'):attr('scope', 'col'):wikitext(args.old_def or 'Old exit'):wikitext(args.old_ref) row:tag('th'):attr('scope', 'col'):wikitext(args.exit_def or 'New exit'):wikitext(args.exit_ref) elseif exit
'name' then row:tag('th'):attr('scope', 'col'):wikitext(args.name_def or 'Name'):wikitext(args.name_ref) end row:tag('th'):attr('scope', 'col'):wikitext(args.dest_def or 'Destinations'):wikitext(args.dest_ref) row:tag('th'):attr('scope', 'col'):wikitext(args.notes_def or 'Notes'):wikitext(args.notes_ref) return '\n