Une page de Wikiversité, la communauté pédagogique libre.
-- This Module:RefDetail can extend any re-use of a ref like<ref name="refname"/>-- with some detail in the same style.-- It is used by Modèle:RefDetail for easier writing.-- example : initial ref<ref name="ABC">referal book</ref>-- and anywhere in the same page {{RefDetail|ABC|p.123}}-- direct module use {{#invoke:RefDetail|ref|ABC|p.123}}localp={}functionp.ref(frame)localargs_invoke=frame.argslocalargs_template=frame:getParent().argslocalrefname,reftxt="",""ifargs_invokeandargs_invoke[1]thenrefname=args_invoke[1]orrefnameendifargs_templateandargs_template[1]thenrefname=args_template[1]orrefnameendifrefname~=""thenreftxt=frame:preprocess('<ref name="'..refname..'" />')end-- local reftxt = frame:preprocess('<ref name="' .. refname .. '" />')--localdetail,detailtxt="",""ifargs_invokeandargs_invoke[2]thendetail=args_invoke[2]ordetailendifargs_templateandargs_template[2]thendetail=args_template[2]ordetailendifdetail~=""thendetailtxt='<sup><span style="color:#0645ad;">'..detail..'</span></sup>'end-- local detailtxt = '<sup><span style="color:#0645ad;">' .. detail .. '</span></sup>'returnreftxt..detailtxtendreturnp