[master 1/26] Make the function adding the deprecation doc text more generic