introduce link_to_docs() and migrate links

fixes #2423 

@danimo @karlitschek THX