First, find the definitions for citerefentry, refentrytitle, and manvolnum.  As you can see, citerefentry is responsible for the overall formating (italic or regular), refentrytitle does nothing spectacular, and there is a little bit of logic in manvolnum to determine whether or not to include the section number in parantheses after the manual page name.  It’s nothing spectacular, and it should be obvious that it is the citerefentry element code that will need to determine whether or not to make the whole thing a link, and that the other definitions can be left alone.