See {{rfd top}} and {{rfd bottom}}. This module dumps the relevant <noinclude> and <includeonly> tags onto the daily log page when the templates are transcluded. It also creates an anchored link using a timestamp as the anchor text.
localrfd={}functionrfd.rfdt_before_result(frame)--this bit creates the "closed discussion" notice--define function to check whether arguments are definedlocalargs=frame.argslocalfunctionargIsSet(key)ifargs[key]andargs[key]:find('%S')thenreturntrueelsereturnfalseendendlocalfunctionmatch_result(result_parameter)--takes string as input, spews two strings as outputlocalfind_count=0localresult_match=''localicon_filename=''localparameter_lower=result_parameter:lower()--I thought about using an array and a for-loop, but the logic is --sufficiently complicated (there is no built-in "or" in Lua string --patterns) so I'll just lay it flat.if(parameter_lower:find('keep')orparameter_lower:find('withdraw')orparameter_lower:find('refine'))thenresult_match='Keep'icon_filename='File:White check mark in dark green rounded square.svg'find_count=find_count+1endif(parameter_lower:find('delete'))thenresult_match='Delete'icon_filename='File:White x in red rounded square.svg'find_count=find_count+1endif(parameter_lower:find('retarget')orparameter_lower:find('soft redirect'))thenresult_match='Retarget'icon_filename='File:Right-pointing white arrow in blue rounded square.svg'find_count=find_count+1endif(parameter_lower:find('disambig')orparameter_lower:find('dab')orparameter_lower:find('sia')orparameter_lower:find('set index'))thenresult_match='Disambiguate'icon_filename='File:Three disambiguation arrows icon in rounded blue square.svg'find_count=find_count+1endif(parameter_lower:find('no consensus')andfind_count==0)then--This catches instances of "no consensus" that isn't qualified by "default to [keep/delete]"result_match='No consensus'icon_filename='File:White equals sign on grey rounded square.svg'find_count=1endiffind_count>=2or(argIsSet('result')andfind_count==0)thenresult_match='Split or bespoke decisions'icon_filename='File:White i in purple rounded square.svg'elseiffind_count<=0thenresult_match='No decision'icon_filename='File:50% grey rounded square.svg'endreturnresult_match,icon_filenameend--Detect result first, default to "no decision" if arg not setlocalresult_match='No decision'localicon_filename='File:50% grey rounded square.svg'localresult_string=''if(argIsSet('result'))thenresult_string=' Result was: 'result_match,icon_filename=match_result(args['result'])end--Build wikitext for result iconlocalmessage_string1='<includeonly>'--includeonly tag--then dump the icon..'[['..icon_filename..'|16px|link=|alt='..result_match.."]] '''Closed discussion''', see [["--Build wikilink to full discussion.--mw.title.getCurrentTitle() will resolve correctly if substedlocaltimestamp_string=os.time()locallink_string=tostring(mw.title.getCurrentTitle())..'#'..timestamp_stringlocalmessage_string2='|full discussion]].'--Complete the includeonly result message and build the anchor on daily log pagelocalend_string='</includeonly><noinclude><span id="'..timestamp_string..'"></span>'--Put it all together and return from Luareturnmessage_string1..link_string..message_string2..result_string..end_stringendfunctionrfd.rfdt_show_result(frame)return'</noinclude>'..frame.args['result']..'<includeonly></div></includeonly><noinclude>'endfunctionrfd.rfdb_noinclude(frame)return'</noinclude>'endreturnrfd